Exemplo n.º 1
0
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('product_id', 'int', null);
     if ($this->id != null) {
         $this->record = BackendCatalogModel::get($this->id);
     }
     // get categories
     $this->categories = BackendCatalogModel::getCategories(true);
     // Get all products grouped by categories
     $this->allProductsGroupedByCategories = BackendCatalogModel::getAllProductsGroupedByCategories();
     // get specifications
     $this->specifications = BackendCatalogModel::getSpecifications();
     // get brands
     $this->brands = BackendCatalogModel::getBrandsForDropdown();
 }
Exemplo n.º 2
0
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('id', 'int', null);
     if ($this->id == null || !BackendCatalogModel::exists($this->id)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
     $this->record = BackendCatalogModel::get($this->id);
     $this->categories = (array) BackendCatalogModel::getCategories(true);
     $this->products = (array) BackendCatalogModel::getAll();
     $this->allProductsGroupedByCategories = (array) BackendCatalogModel::getAllProductsGroupedByCategories();
     $this->relatedProducts = (array) BackendCatalogModel::getRelatedProducts($this->id);
     $this->specifications = (array) BackendCatalogModel::getSpecifications();
     // get brands
     $this->brands = BackendCatalogModel::getBrandsForDropdown();
 }