Пример #1
0
 /**
  * Verify that the specified customer has different default billing and shipping addresses.
  *
  * @magentoDataFixture Magento/Customer/_files/customer.php
  * @magentoDataFixture Magento/Customer/_files/customer_primary_addresses.php
  */
 public function testGetPrimaryAddressesBillingShippingDifferent()
 {
     $this->customerSession->setCustomerId(1);
     $addresses = $this->block->getPrimaryAddresses();
     $this->assertCount(2, $addresses);
     $this->assertNotEquals($addresses[0], $addresses[1]);
     $this->assertTrue($addresses[0]->isDefaultBilling());
     $this->assertTrue($addresses[1]->isDefaultShipping());
 }
Пример #2
0
 /**
  * Add review summary
  *
  * @return \Magento\Framework\View\Element\AbstractBlock
  */
 protected function _beforeToHtml()
 {
     $this->_getCollection()->load()->addReviewSummary();
     return parent::_beforeToHtml();
 }
Пример #3
0
 /**
  * Constructor
  *
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory
  * @param CustomerAccountServiceInterface $customerAccountService
  * @param CustomerAddressServiceInterface $addressService
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, CustomerAccountServiceInterface $customerAccountService, CustomerAddressServiceInterface $addressService, array $data = array())
 {
     parent::__construct($context, $customerSession, $subscriberFactory, $customerAccountService, $addressService, $data);
     $this->_isScopePrivate = true;
 }
 public function __construct(\Dotdigitalgroup\Email\Helper\Data $data, \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, \Magento\Customer\Api\AccountManagementInterface $customerAccountManagement, array $data = [])
 {
     $this->_helper = $data;
     parent::__construct($context, $customerSession, $subscriberFactory, $customerRepository, $customerAccountManagement);
 }
Пример #5
0
 /**
  * @param \Magento\Framework\View\Element\Template\Context $context
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory
  * @param CustomerRepositoryInterface $customerRepository
  * @param AccountManagementInterface $customerAccountManagement
  * @param array $data
  */
 public function __construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, CustomerRepositoryInterface $customerRepository, AccountManagementInterface $customerAccountManagement, array $data = [])
 {
     parent::__construct($context, $customerSession, $subscriberFactory, $customerRepository, $customerAccountManagement, $data);
     $this->_isScopePrivate = true;
 }
Пример #6
0
 /**
  * Add review summary
  *
  * @return \Magento\Framework\View\Element\AbstractBlock
  */
 protected function _beforeToHtml()
 {
     $reviews = $this->getReviews();
     if ($reviews) {
         $reviews->load()->addReviewSummary();
     }
     return parent::_beforeToHtml();
 }