コード例 #1
0
ファイル: Modeled.php プロジェクト: xiaoguizhidao/tyler-live
 public function getIsExcluded()
 {
     if (!$this->model) {
         return true;
     }
     $moduleName = Mage::app()->getRequest()->getModuleName();
     if (in_array($moduleName, array('sqli_singlesearchresult', 'catalogsearch'))) {
         return false;
     }
     $categoryId = $this->getCurrentCategoryId();
     $exclude = false;
     $includeCategories = $this->model->getIncludeInArray();
     if ($includeCategories) {
         if (!in_array($categoryId, $includeCategories)) {
             $exclude = true;
         }
     }
     if (!$exclude) {
         $excludeCategories = $this->model->getExcludeFromArray();
         if (in_array($categoryId, $excludeCategories)) {
             $exclude = true;
         }
     }
     return $exclude;
 }
コード例 #2
0
ファイル: Modeled.php プロジェクト: rcclaudrey/dev
 public function getIsExcluded()
 {
     if (!$this->model) {
         return true;
     }
     $moduleName = Mage::app()->getRequest()->getModuleName();
     if (in_array($moduleName, array('sqli_singlesearchresult', 'catalogsearch'))) {
         return false;
     }
     $categoryId = $this->getCurrentCategoryId();
     $exclude = false;
     /** @var Amasty_Xlanding_Model_Page $currentLanding */
     $currentLanding = Mage::registry('amlanding_page');
     $includeCategories = $this->model->getIncludeInArray();
     if ($includeCategories) {
         if (!in_array($categoryId, $includeCategories)) {
             $landingIncluded = $currentLanding && in_array($currentLanding->getIdentifier(), $includeCategories);
             if (!$landingIncluded) {
                 $exclude = true;
             }
         }
     }
     if (!$exclude) {
         $excludeCategories = $this->model->getExcludeFromArray();
         if (in_array($categoryId, $excludeCategories)) {
             $exclude = true;
         }
         $landingExcluded = $currentLanding && in_array($currentLanding->getIdentifier(), $excludeCategories);
         if ($landingExcluded) {
             $exclude = true;
         }
     }
     if (!$exclude) {
         $ids = trim(str_replace(' ', '', $this->model->getDependOn()));
         if (!empty($ids)) {
             $ids = explode(',', $ids);
             /** @var Amasty_Shopby_Helper_Attributes $attrHelper */
             $attrHelper = Mage::helper('amshopby/attributes');
             $allSelectedIds = $attrHelper->getRequestedOptionIds();
             if (!array_intersect($allSelectedIds, $ids)) {
                 $exclude = true;
             }
         }
     }
     return $exclude;
 }
コード例 #3
0
ファイル: Modeled.php プロジェクト: victorkho/telor
 public function getIsExcluded()
 {
     if (!$this->model) {
         return true;
     }
     $categoryId = $this->getCurrentCategoryId();
     $exclude = false;
     $includeCategories = $this->model->getIncludeInArray();
     if ($includeCategories) {
         if (!in_array($categoryId, $includeCategories)) {
             $exclude = true;
         }
     }
     if (!$exclude) {
         $excludeCategories = $this->model->getExcludeFromArray();
         if (in_array($categoryId, $excludeCategories)) {
             $exclude = true;
         }
     }
     return $exclude;
 }