123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- /**
- * Mustishipping checkout shipping
- *
- * @author Magento Core Team <core@magentocommerce.com>
- */
- namespace Magento\Multishipping\Block\Checkout\Billing;
- /**
- * @api
- * @since 100.0.2
- */
- class Items extends \Magento\Sales\Block\Items\AbstractItems
- {
- /**
- * @var \Magento\Multishipping\Model\Checkout\Type\Multishipping
- */
- protected $_multishipping;
- /**
- * @var \Magento\Checkout\Model\Session
- */
- protected $_checkoutSession;
- /**
- * @param \Magento\Framework\View\Element\Template\Context $context
- * @param \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping
- * @param \Magento\Checkout\Model\Session $checkoutSession
- * @param array $data
- */
- public function __construct(
- \Magento\Framework\View\Element\Template\Context $context,
- \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping,
- \Magento\Checkout\Model\Session $checkoutSession,
- array $data = []
- ) {
- $this->_multishipping = $multishipping;
- $this->_checkoutSession = $checkoutSession;
- parent::__construct($context, $data);
- $this->_isScopePrivate = true;
- }
- /**
- * Get multishipping checkout model
- *
- * @return \Magento\Multishipping\Model\Checkout\Type\Multishipping
- */
- public function getCheckout()
- {
- return $this->_multishipping;
- }
- /**
- * Retrieve quote model object
- *
- * @return \Magento\Quote\Model\Quote
- */
- public function getQuote()
- {
- return $this->_checkoutSession->getQuote();
- }
- /**
- * Retrieve virtual product edit url
- *
- * @return string
- */
- public function getVirtualProductEditUrl()
- {
- return $this->getUrl('checkout/cart');
- }
- /**
- * Retrieve virtual product collection array
- *
- * @return array
- */
- public function getVirtualQuoteItems()
- {
- $items = [];
- foreach ($this->getQuote()->getItemsCollection() as $_item) {
- if ($_item->getProduct()->getIsVirtual() && !$_item->getParentItemId()) {
- $items[] = $_item;
- }
- }
- return $items;
- }
- }
|