diff --git a/admin-dev/themes/template/products/attachments.tpl b/admin-dev/themes/template/products/attachments.tpl index a3ecbe830..012f8432f 100644 --- a/admin-dev/themes/template/products/attachments.tpl +++ b/admin-dev/themes/template/products/attachments.tpl @@ -48,6 +48,7 @@ {/foreach} +  *
 
diff --git a/admin-dev/themes/template/products/form.tpl b/admin-dev/themes/template/products/form.tpl index 9b46319cc..1b2fa0cc6 100644 --- a/admin-dev/themes/template/products/form.tpl +++ b/admin-dev/themes/template/products/form.tpl @@ -99,6 +99,8 @@ $('#virtual_product').attr('checked', 'checked'); $('li.tab-row a[id*="Pack"]').hide(); $('li.tab-row a[id*="Shipping"]').hide(); + $('#condition').attr('disabled', 'disabled'); + $('#condition option[value=new]').attr('selected', 'selected'); {else} $('#simple_product').attr('checked', 'checked'); $('li.tab-row a[id*="Pack"]').hide(); @@ -124,6 +126,8 @@ $('#ppack').val(1).attr('checked', true).attr('disabled', 'disabled'); $('#ppackdiv').show(); $('li.tab-row a[id*="Shipping"]').show(); + $('#condition').removeAttr('disabled'); + $('#condition option[value=new]').removeAttr('selected'); } else if (val == 2) { @@ -133,9 +137,16 @@ $('#is_virtual').val(1); $("#virtual_good_attributes").show(); $('li.tab-row a[id*="Shipping"]').hide(); + $('#condition').attr('disabled', 'disabled'); + $('#condition option[value=refurbished]').removeAttr('selected'); + $('#condition option[value=used]').removeAttr('selected'); } else + { $('li.tab-row a[id*="Shipping"]').show(); + $('#condition').removeAttr('disabled'); + $('#condition option[value=new]').removeAttr('selected'); + } }); diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 2c3d5ea94..d93d7ad10 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -396,12 +396,16 @@ class AdminProductsControllerCore extends AdminController * @param $token * @return void */ - public function processAttachment($token) + public function processAttachments($token) { if ($this->action == 'attachments') if ($id = (int)Tools::getValue($this->identifier)) - if (Attachment::attachToProduct($id, Tools::getValue('attachments'))) + { + $attachments = trim(Tools::getValue('arrayAttachments'), ','); + $attachments = explode(',', $attachments); + if (Attachment::attachToProduct($id, $attachments)) $this->redirect_after = self::$currentIndex.'&id_product='.(int)$id.(isset($_POST['id_category']) ? '&id_category='.(int)$_POST['id_category'] : '').'&conf=4&add'.$this->table.'&action=Attachments&token='.($token ? $token : $this->token); + } } public function processDuplicate($token)