コード例 #1
0
ファイル: actioner.php プロジェクト: WinGood/24karcher
 /**
  * Обновляет параметры товара (быстрый вариант).
  * @return type
  */
 public function fastSaveProduct()
 {
     $this->messageSucces = $this->lang['ACT_SAVE_PROD'];
     $this->messageError = $this->lang['ACT_NOT_SAVE_PROD'];
     $model = new Models_Product();
     $variant = $_POST['variant'];
     unset($_POST['variant']);
     $arr = array($_POST['field'] => $_POST['value']);
     // Обновление.
     if ($variant) {
         $model->fastUpdateProductVariant($_POST['id'], $arr, $_POST['product_id']);
         $arrVar = $model->getVariants($_POST['product_id']);
         foreach ($arrVar as $key => $variant) {
             if ($variant['id'] == $_POST['id']) {
                 $this->data = MG::priceCourse($variant['price_course']);
             }
         }
     } else {
         $model->fastUpdateProduct($_POST['id'], $arr);
         $tempProd = $model->getProduct($_POST['id']);
         $this->data = MG::priceCourse($tempProd['price_course']);
     }
     return true;
 }