我在 prestashop 上有以下代码。我正在尝试将 {$combination.price} 降低 20%。但是最后更改数组似乎不起作用?即{$combination.price/1.2)
谁能帮帮我,我怎样才能以 20% 的折扣退回价格?
{if isset($groups)}
// Combinations
{foreach from=$combinations key=idCombination item=combination}
var specific_price_combination = new Array();
var available_date = new Array();
specific_price_combination['reduction_percent'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type ==
'percentage'}{$combination.specific_price.reduction*100}{else}0{/if};
specific_price_combination['reduction_price'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type ==
'amount'}{$combination.specific_price.reduction}{else}0{/if};
specific_price_combination['price'] = {if $combination.specific_price AND $combination.specific_price.price}{$combination.specific_price.price}{else}0{/if};
specific_price_combination['reduction_type'] = '{if $combination.specific_price}{$combination.specific_price.reduction_type}{/if}';
specific_price_combination['id_product_attribute'] = {if $combination.specific_price}{$combination.specific_price.id_product_attribute|intval}{else}0{/if};
available_date['date'] = '{$combination.available_date}';
available_date['date_formatted'] = '{dateFormat date=$combination.available_date full=false}';
addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image},
'{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity}, available_date, specific_price_combination);
{/foreach}
{/if}