/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Directory\Block\Data $directoryBlock * @param \Magento\Shipping\Model\CarrierFactoryInterface $carrierFactory * @param PriceCurrencyInterface $priceCurrency * @param array $data */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Directory\Block\Data $directoryBlock, \Magento\Shipping\Model\CarrierFactoryInterface $carrierFactory, PriceCurrencyInterface $priceCurrency, array $data = []) { $this->priceCurrency = $priceCurrency; $this->_directoryBlock = $directoryBlock; $this->_carrierFactory = $carrierFactory; parent::__construct($context, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; }
/** * @return array */ public function getTotals() { if (is_null($this->_totals)) { return parent::getTotals(); } return $this->_totals; }
/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Checkout\Model\CompositeConfigProvider $configProvider * @param array $layoutProcessors * @param array $data * @codeCoverageIgnore */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Checkout\Model\CompositeConfigProvider $configProvider, array $layoutProcessors = [], array $data = []) { $this->configProvider = $configProvider; $this->layoutProcessors = $layoutProcessors; parent::__construct($context, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; }
/** * @return array */ public function getTotals() { if ($this->_totals === null) { return parent::getTotals(); } return $this->_totals; }
/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Directory\Block\Data $directoryBlock * @param \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory * @param array $data */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Directory\Block\Data $directoryBlock, \Magento\Sales\Model\Quote\Address\CarrierFactoryInterface $carrierFactory, array $data = array()) { $this->_directoryBlock = $directoryBlock; $this->_carrierFactory = $carrierFactory; parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; }
/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Catalog\Helper\Image $imageHelper * @param \Magento\Customer\CustomerData\JsLayoutDataProviderPoolInterface $jsLayoutDataProvider * @param array $data * @codeCoverageIgnore */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Catalog\Helper\Image $imageHelper, \Magento\Customer\CustomerData\JsLayoutDataProviderPoolInterface $jsLayoutDataProvider, array $data = []) { if (isset($data['jsLayout'])) { $this->jsLayout = array_merge_recursive($jsLayoutDataProvider->getData(), $data['jsLayout']); unset($data['jsLayout']); } else { $this->jsLayout = $jsLayoutDataProvider->getData(); } parent::__construct($context, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = false; $this->imageHelper = $imageHelper; }
/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, array $data = array()) { parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); $this->_isScopePrivate = true; }
/** * Get cache key informative items * * @return array */ public function getCacheKeyInfo() { $cacheKeyInfo = parent::getCacheKeyInfo(); $cacheKeyInfo['item_renders'] = $this->_serializeRenders(); return $cacheKeyInfo; }
/** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param PriceCurrencyInterface $priceCurrency * @param array $data */ public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, PriceCurrencyInterface $priceCurrency, array $data = array()) { $this->priceCurrency = $priceCurrency; parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); }
/** * {@inheritDoc} */ protected function _beforeToHtml() { if ($this->_customerSession->isLoggedIn()) { $customer = $this->customerRepository->getById($this->_customerSession->getCustomerId()); if ($defaultShipping = $customer->getDefaultShipping()) { $address = $this->addressRepository->getById($defaultShipping); if ($address) { /** @var \Magento\Quote\Api\Data\EstimateAddressInterface $estimatedAddress */ $estimatedAddress = $this->estimatedAddressFactory->create(); $estimatedAddress->setCountryId($address->getCountryId()); $estimatedAddress->setPostcode($address->getPostcode()); $estimatedAddress->setRegion((string) $address->getRegion()->getRegion()); $estimatedAddress->setRegionId($address->getRegionId()); $this->shippingMethodManager->estimateByAddress($this->getQuote()->getId(), $estimatedAddress); $this->quoteRepository->save($this->getQuote()); } } } return parent::_beforeToHtml(); }
/** * {@inheritDoc} */ protected function _beforeToHtml() { $this->collectQuote->collect($this->getQuote()); return parent::_beforeToHtml(); }
/** * Return customer quote items * * @return array */ public function getItems() { if ($this->getCustomItems()) { return $this->getCustomItems(); } return parent::getItems(); }