Example #1
0
 /**
  * Apply front-end price limitation filters to the collection
  *
  * @return $this
  */
 public function applyFrontendPriceLimitations()
 {
     $this->_productLimitationFilters->setUsePriceIndex(true);
     if (!isset($this->_productLimitationFilters['customer_group_id'])) {
         $customerGroupId = $this->_customerSession->getCustomerGroupId();
         $this->_productLimitationFilters['customer_group_id'] = $customerGroupId;
     }
     if (!isset($this->_productLimitationFilters['website_id'])) {
         $websiteId = $this->_storeManager->getStore($this->getStoreId())->getWebsiteId();
         $this->_productLimitationFilters['website_id'] = $websiteId;
     }
     $this->_applyProductLimitations();
     return $this;
 }
 public function testGetUsePriceIndex()
 {
     $this->assertFalse($this->productLimitation->isUsingPriceIndex());
     $this->productLimitation->setUsePriceIndex(true);
     $this->assertTrue($this->productLimitation->isUsingPriceIndex());
 }