Skip to content

Commit

Permalink
更新产品custom option sku 含有 & 特殊字符被转义成 “&” 进而导致的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyecommerce committed Aug 19, 2017
1 parent d2cf7dd commit 2af0be0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions app/appadmin/modules/Catalog/block/productinfo/Manageredit.php
Expand Up @@ -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');
Expand Down
Expand Up @@ -436,7 +436,7 @@ function thissubmit(thiss){
alert("select can not empty");
}
$str += '<td rel="'+attr+'">'+val+'</td>';
val = val.replace(" ", "*")
val = val.replace(/ /g, "*")
if(!general_sku){
general_sku = val;
}else{
Expand Down

0 comments on commit 2af0be0

Please sign in to comment.