diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index c1bc43931..9550cba4a 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1710,6 +1710,7 @@ if (false) */ public function initForm() { + $this->display = 'edit'; $this->addJqueryUI('ui.datepicker'); $this->context->smarty->assign('pos_select', (($tab = Tools::getValue('tabs')) ? $tab : '0')); $this->context->smarty->assign('token',$this->token); @@ -3419,7 +3420,7 @@ $product->supplier_name = Supplier::getNameById($product->id_supplier); return $this->initFormAttributes($obj, $languages, $defaultLanguage); } - public function initFormAttributes($obj, $languages, $defaultLanguage) + public function initFormAttributes($product, $languages, $defaultLanguage) { if (!Combination::isFeatureActive()) { @@ -3440,26 +3441,26 @@ $product->supplier_name = Supplier::getNameById($product->id_supplier); $default_country = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT')); $product->productDownload = new ProductDownload(); - $id_product_download = (int) $product->productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id')); + $id_product_download = (int) $product->productDownload->getIdFromIdProduct($this->getFieldValue($product, 'id')); if (!empty($id_product_download)) $product->productDownload = new ProductDownload($id_product_download); // $smarty->assign('productDownload', $productDownload); $smarty->assign('currency', $currency); - $images = Image::getImages($this->context->language->id, $obj->id); - if ($obj->id) + $images = Image::getImages($this->context->language->id, $product->id); + if ($product->id) { $smarty->assign('tax_exclude_option', Tax::excludeTaxeOption()); $smarty->assign('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')); $smarty->assign('ps_use_ecotax', Configuration::get('PS_USE_ECOTAX')); - $smarty->assign('field_value_unity', $this->getFieldValue($obj, 'unity')); + $smarty->assign('field_value_unity', $this->getFieldValue($product, 'unity')); $smarty->assign('reasons', $reasons = StockMvtReason::getStockMvtReasons($this->context->language->id)); $smarty->assign('ps_stock_mvt_reason_default', $ps_stock_mvt_reason_default = Configuration::get('PS_STOCK_MVT_REASON_DEFAULT')); - $smarty->assign('minimal_quantity', $this->getFieldValue($obj, 'minimal_quantity') ? $this->getFieldValue($obj, 'minimal_quantity') : 1); - $smarty->assign('available_date', ($this->getFieldValue($obj, 'available_date') != 0) ? stripslashes(htmlentities(Tools::displayDate($this->getFieldValue($obj, 'available_date'), $language['id_lang']))) : '0000-00-00'); + $smarty->assign('minimal_quantity', $this->getFieldValue($product, 'minimal_quantity') ? $this->getFieldValue($product, 'minimal_quantity') : 1); + $smarty->assign('available_date', ($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities(Tools::displayDate($this->getFieldValue($product, 'available_date'), $language['id_lang']))) : '0000-00-00'); // date picker include @@ -3501,14 +3502,14 @@ $product->supplier_name = Supplier::getNameById($product->id_supplier); $content .= '
' : '').'
-
+
';
}
- $content .= '
'.$this->l('Delete all combinations').'
'.$this->l('Delete all combinations').'