Ejemplo n.º 1
0
 /**
  * Initializes controller.
  *
  * @see FrontController::init()
  *
  * @throws PrestaShopException
  */
 public function init()
 {
     if (Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         parent::init();
         $this->doProductSearch('catalog/listing/best-sales');
     } else {
         Tools::redirect('index.php?controller=404');
     }
 }
Ejemplo n.º 2
0
 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
         parent::initContent();
         if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop()) {
             $this->assignManufacturer();
             $this->label = $this->trans('List of products by manufacturer %s', array($this->manufacturer->name), 'Shop.Theme.Catalog');
             $this->doProductSearch('catalog/listing/manufacturer', array('entity' => 'manufacturer', 'id' => $this->manufacturer->id));
         } else {
             $this->assignAll();
             $this->label = $this->trans('List of all manufacturers', array(), 'Shop.Theme.Catalog');
             $this->setTemplate('catalog/manufacturers', array('entity' => 'manufacturers'));
         }
     } else {
         $this->redirect_after = '404';
         $this->redirect();
     }
 }
Ejemplo n.º 3
0
 public function getTemplateVarPage()
 {
     $page = parent::getTemplateVarPage();
     $page['body_classes']['category-id-' . $this->category->id] = true;
     $page['body_classes']['category-' . $this->category->name] = true;
     $page['body_classes']['category-id-parent-' . $this->category->id_parent] = true;
     $page['body_classes']['category-depth-level-' . $this->category->level_depth] = true;
     return $page;
 }
Ejemplo n.º 4
0
 /**
  * Initializes controller.
  *
  * @see FrontController::init()
  *
  * @throws PrestaShopException
  */
 public function init()
 {
     parent::init();
     $this->doProductSearch('catalog/listing/new-products');
 }
Ejemplo n.º 5
0
 /**
  * Initializes controller.
  *
  * @see FrontController::init()
  *
  * @throws PrestaShopException
  */
 public function init()
 {
     parent::init();
     $this->doProductSearch('catalog/listing/prices-drop');
 }