diff --git a/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php b/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php index 41d9d022a..1dd2c60b8 100644 --- a/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php +++ b/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php @@ -425,12 +425,22 @@ protected function initParamType() $custom_option = $custom_option ? json_decode($custom_option, true) : []; $custom_option_arr = []; if (is_array($custom_option) && !empty($custom_option)) { - foreach ($custom_option as $one) { - $one['qty'] = (int) $one['qty']; - $one['price'] = (float) $one['price']; - $custom_option_arr[$one['sku']] = $one; + foreach ($custom_option as $option) { + if(is_array($option) && !empty($option)){ + foreach($option as $key => $val){ + if($key == 'qty'){ + $option[$key] = (int) $option[$key]; + } else if ($key == 'price') { + $option[$key] = (float) $option[$key]; + } else { + $option[$key] = html_entity_decode($val); + } + } + } + $custom_option_arr[$option['sku']] = $option; } } + $this->_param['custom_option'] = $custom_option_arr; //var_dump($this->_param['custom_option']); $image_gallery = CRequest::param('image_gallery'); diff --git a/app/appadmin/theme/base/default/catalog/productinfo/manageredit.php b/app/appadmin/theme/base/default/catalog/productinfo/manageredit.php index 4451cf48b..65ed955d6 100644 --- a/app/appadmin/theme/base/default/catalog/productinfo/manageredit.php +++ b/app/appadmin/theme/base/default/catalog/productinfo/manageredit.php @@ -436,7 +436,7 @@ function thissubmit(thiss){ alert("select can not empty"); } $str += ''+val+''; - val = val.replace(" ", "*") + val = val.replace(/ /g, "*") if(!general_sku){ general_sku = val; }else{