Generic.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Checkout\Block\Cart\Item\Renderer\Actions;
  7. use Magento\Framework\View\Element\Template;
  8. use Magento\Quote\Model\Quote\Item\AbstractItem;
  9. class Generic extends Template
  10. {
  11. /**
  12. * @var AbstractItem
  13. */
  14. protected $item;
  15. /**
  16. * Returns current quote item
  17. *
  18. * @return AbstractItem
  19. * @codeCoverageIgnore
  20. */
  21. public function getItem()
  22. {
  23. return $this->item;
  24. }
  25. /**
  26. * Set current quote item
  27. *
  28. * @param AbstractItem $item
  29. * @return $this
  30. * @codeCoverageIgnore
  31. */
  32. public function setItem(AbstractItem $item)
  33. {
  34. $this->item = $item;
  35. return $this;
  36. }
  37. /**
  38. * Check if product is visible in site visibility
  39. *
  40. * @return bool
  41. * @codeCoverageIgnore
  42. */
  43. public function isProductVisibleInSiteVisibility()
  44. {
  45. return $this->getItem()->getProduct()->isVisibleInSiteVisibility();
  46. }
  47. /**
  48. * Check if cart item is virtual
  49. *
  50. * @return bool
  51. * @codeCoverageIgnore
  52. */
  53. public function isVirtual()
  54. {
  55. return (bool)$this->getItem()->getIsVirtual();
  56. }
  57. }