public function __construct(Context $context, StoreManagerInterface $storeManager, MerchantCollection $merchantCollection, CustomerRegistry $customerRegistry) { parent::__construct($context); $website = $storeManager->getWebsite(); $this->merchant = $merchantCollection->getItemById($website->getId())->getMerchant(); $this->customerRegistry = $customerRegistry; }
public function __construct(Context $context, StoreManagerInterface $storeManager, CustomerFactory $customerFactory, AddressFactory $addressFactory, Session $customerSession, ProductRepositoryInterface $productRepository, Cart $cart, Collection $merchantCollection, Application $application) { parent::__construct($context); $this->customerFactory = $customerFactory; $this->addressFactory = $addressFactory; $this->customerSession = $customerSession; $this->productRepository = $productRepository; $this->cart = $cart; $this->merchant = $merchantCollection->getItemById($storeManager->getWebsite()->getId())->getMerchant(); $this->application = $application->getApp(); $this->countryProvider = $this->application['country_code.provider']; }