Exemplo n.º 1
0
 /**
  * Update product info
  *
  * @param  void
  * @return object	info
  */
 public function update()
 {
     // For single product update SKU must save the original SKU ID (since SKU was generated automatically)
     // Find the SKU ID for this product and save
     include_once PATH_CORE . DS . 'components' . DS . 'com_storefront' . DS . 'models' . DS . 'Warehouse.php';
     $warehouse = new StorefrontModelWarehouse();
     $sku = $warehouse->getProductSkus($this->data->id);
     // Must be just one SKU
     if (sizeof($sku) != 1) {
         throw new Exception(Lang::txt('Only one SKU is allowed'));
     }
     $skuId = $sku[0];
     // save product sku with the current ID to resave the changes with this ID
     $sku = $this->getSku()->setId($skuId);
     return parent::update();
 }