コード例 #1
0
ファイル: View.php プロジェクト: aiesh/magento2
 /**
  * Check if category display mode is "Static Block Only"
  * For anchor category with applied filter Static Block Only mode not allowed
  *
  * @return bool
  */
 public function isContentMode()
 {
     $category = $this->getCurrentCategory();
     $res = false;
     if ($category->getDisplayMode() == \Magento\Catalog\Model\Category::DM_PAGE) {
         $res = true;
         if ($category->getIsAnchor()) {
             $state = $this->_catalogLayer->getState();
             if ($state && $state->getFilters()) {
                 $res = false;
             }
         }
     }
     return $res;
 }
コード例 #2
0
 public function testGetState()
 {
     $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Layer\\State', $this->model->getState());
 }
コード例 #3
0
 /**
  * Is filter enabled
  *
  * @param \Magento\Catalog\Model\Layer $layer
  * @param array $filters
  * @return bool
  */
 public function isEnabled($layer, array $filters = [])
 {
     return $this->canShowOptions($filters) || count($layer->getState()->getFilters());
 }