コード例 #1
0
 public function index()
 {
     $this->setViewVariable('currentCatalog', CatalogModel::getInstance()->getRootCatalog());
     $this->setViewVariable('nearestChildren', CatalogModel::getInstance()->getNearestChildren(0));
     $this->setViewVariable('specialOfferProducts', $this->splitByRows(SpecialOfferModel::getInstance()->getProducts()));
     $this->render(['layout' => 'index']);
 }
コード例 #2
0
 public function destroy($catalogId, $productId)
 {
     if (!$this->isPostRequest()) {
         exit;
     }
     try {
         SpecialOfferModel::getInstance()->delete($catalogId, $productId);
         messages::add('SpecialOffer_Deleted', 1, 'success');
         $this->systemRedirect('/specialOffer');
     } catch (\Exception $e) {
         messages::add('UnknownError', 1, 'error');
         $this->systemRedirect('/specialOffer');
     }
 }