/**
  * Dispay type.
  *
  * @return mixed|string grid:list
  */
 public function getDisplayType()
 {
     $mode = $this->context->getRequest()->getActionName();
     $type = '';
     switch ($mode) {
         case 'related':
             $type = $this->getRelatedProductsType();
             break;
         case 'upsell':
             $type = $this->getUpsellProductsType();
             break;
         case 'crosssell':
             $type = $this->getCrosssellProductsType();
             break;
         case 'bestsellers':
             $type = $this->getBestSellerProductsType();
             break;
         case 'mostviewed':
             $type = $this->getMostViewedProductsType();
             break;
         case 'recentlyviewed':
             $type = $this->getRecentlyviewedProductsType();
             break;
         case 'push':
             $type = $this->getProductpushProductsType();
     }
     return $type;
 }
 /**
  * @param Context $context
  * @param ObjectManagerInterface $objectManager
  * @param StdlibString $string
  * @param ScopeConfigInterface $scopeConfig
  */
 public function __construct(Context $context, ObjectManagerInterface $objectManager, StdlibString $string)
 {
     $this->request = $context->getRequest();
     $this->objectManager = $objectManager;
     $this->string = $string;
     $this->scopeConfig = $context->getScopeConfig();
 }
示例#3
0
 /**
  * @param \Magento\Framework\App\Helper\Context $context
  * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
  * @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
  */
 public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\ProductMetadataInterface $productMetadata)
 {
     $this->_localeResolver = $localeResolver;
     $this->_productMetadata = $productMetadata;
     $this->_request = $context->getRequest();
     parent::__construct($context);
 }
示例#4
0
 /**
  * @param Context $context
  * @param ObjectManagerInterface $objectManager
  * @param StdlibString $string
  * @param Data|null $queryHelper
  */
 public function __construct(Context $context, ObjectManagerInterface $objectManager, StdlibString $string, Data $queryHelper = null)
 {
     $this->request = $context->getRequest();
     $this->objectManager = $objectManager;
     $this->string = $string;
     $this->scopeConfig = $context->getScopeConfig();
     $this->queryHelper = $queryHelper === null ? $this->objectManager->get(Data::class) : $queryHelper;
 }
示例#5
0
 /**
  * @magentoDataFixture Magento/Customer/_files/customer.php
  * @magentoDataFixture Magento/Wishlist/_files/wishlist_with_product_qty_increments.php
  * @magentoAppArea frontend
  */
 public function testGetWishlistByCustomerId()
 {
     /** @var \Magento\Wishlist\Model\Wishlist $wishlist */
     $wishlist = $this->_objectManager->create('Magento\\Wishlist\\Model\\Wishlist')->loadByCustomerId($this->_fixtureCustomerId);
     /** @var \Magento\Framework\App\Request\Http $request */
     $request = $this->_contextHelper->getRequest();
     $request->setParam('wishlist_id', '');
     $this->assertEquals($wishlist, $this->_wishlistHelper->getWishlist());
 }
示例#6
0
 /**
  * Constructor
  *
  * @param Context        $context
  * @param QueryFactory   $queryFactory
  * @param UrlFactory     $urlFactory
  * @param SuggestFactory $suggestFactory
  * @param TextHelper     $textHelper
  */
 public function __construct(Context $context, QueryFactory $queryFactory, UrlFactory $urlFactory, SuggestFactory $suggestFactory, TextHelper $textHelper)
 {
     $this->request = $context->getRequest();
     $this->query = $queryFactory->get();
     $this->text = $textHelper;
     $this->urlFactory = $urlFactory;
     $this->suggestFactory = $suggestFactory;
     parent::__construct($context);
 }
示例#7
0
 /**
  * @param \Magento\Framework\App\Helper\Context $context
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Ebizmarts\MageMonkey\Model\Logger\Logger $logger
  * @param \Magento\Customer\Model\GroupRegistry $groupRegistry
  */
 public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Ebizmarts\MageMonkey\Model\Logger\Logger $logger, \Magento\Customer\Model\GroupRegistry $groupRegistry, \Magento\Framework\App\State $state)
 {
     $this->_storeManager = $storeManager;
     $this->_mlogger = $logger;
     $this->_groupRegistry = $groupRegistry;
     $this->_scopeConfig = $context->getScopeConfig();
     $this->_request = $context->getRequest();
     $this->_state = $state;
     parent::__construct($context);
 }