[-] MO : #PSCFV-3274 - No links to remove discounts without code in module blockcart
This commit is contained in:
@@ -383,12 +383,15 @@ var ajaxCart = {
|
|||||||
{
|
{
|
||||||
if (parseFloat(jsonData.discounts[i].price_float) > 0)
|
if (parseFloat(jsonData.discounts[i].price_float) > 0)
|
||||||
{
|
{
|
||||||
|
var delete_link = '';
|
||||||
|
if (jsonData.discounts[i].code.length)
|
||||||
|
delete_link = '<a class="delete_voucher" href="'+jsonData.discounts[i].link+'" title="'+delete_txt+'"><img src="'+img_dir+'icon/delete.gif" alt="'+delete_txt+'" class="icon" /></a>';
|
||||||
$('#vouchers tbody').append($(
|
$('#vouchers tbody').append($(
|
||||||
'<tr class="bloc_cart_voucher" id="bloc_cart_voucher_'+jsonData.discounts[i].id+'">'
|
'<tr class="bloc_cart_voucher" id="bloc_cart_voucher_'+jsonData.discounts[i].id+'">'
|
||||||
+' <td class="quantity">1x</td>'
|
+' <td class="quantity">1x</td>'
|
||||||
+' <td class="name" title="'+jsonData.discounts[i].description+'">'+jsonData.discounts[i].name+'</td>'
|
+' <td class="name" title="'+jsonData.discounts[i].description+'">'+jsonData.discounts[i].name+'</td>'
|
||||||
+' <td class="price">-'+jsonData.discounts[i].price+'</td>'
|
+' <td class="price">-'+jsonData.discounts[i].price+'</td>'
|
||||||
+' <td class="delete"><a class="delete_voucher" href="'+jsonData.discounts[i].link+'" title="'+delete_txt+'"><img src="'+img_dir+'icon/delete.gif" alt="'+delete_txt+'" class="icon" /></a></td>'
|
+' <td class="delete">' + delete_link + '</td>'
|
||||||
+'</tr>'
|
+'</tr>'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
"name": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
|
"name": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
|
||||||
"description": "{$discount.description|addslashes|replace:'\\\'':'\''}",
|
"description": "{$discount.description|addslashes|replace:'\\\'':'\''}",
|
||||||
"nameDescription": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
|
"nameDescription": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}",
|
||||||
|
"code": "{$discount.code}",
|
||||||
"link": "{$link->getPageLink("$order_process", true, NULL, "deleteDiscount={$discount.id_discount}")}",
|
"link": "{$link->getPageLink("$order_process", true, NULL, "deleteDiscount={$discount.id_discount}")}",
|
||||||
"price": "{if $priceDisplay == 1}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_tax_exc}{else}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_real}{/if}",
|
"price": "{if $priceDisplay == 1}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_tax_exc}{else}{convertPrice|html_entity_decode:2:'UTF-8' price=$discount.value_real}{/if}",
|
||||||
"price_float": "{if $priceDisplay == 1}{$discount.value_tax_exc}{else}{$discount.value_real}{/if}"
|
"price_float": "{if $priceDisplay == 1}{$discount.value_tax_exc}{else}{$discount.value_real}{/if}"
|
||||||
|
|||||||
@@ -115,7 +115,11 @@ var img_dir = '{$img_dir}';
|
|||||||
<td class="quantity">1x</td>
|
<td class="quantity">1x</td>
|
||||||
<td class="name" title="{$discount.description}">{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'}</td>
|
<td class="name" title="{$discount.description}">{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'}</td>
|
||||||
<td class="price">-{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}</td>
|
<td class="price">-{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}</td>
|
||||||
<td class="delete"><a class="delete_voucher" href="{$link->getPageLink('$order_process.php', true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete' mod='blockcart'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete' mod='blockcart'}" class="icon" /></a></td>
|
<td class="delete">
|
||||||
|
{if strlen($discount.code)}
|
||||||
|
<a class="delete_voucher" href="{$link->getPageLink('$order_process.php', true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete' mod='blockcart'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete' mod='blockcart'}" class="icon" /></a>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
|
|||||||
Reference in New Issue
Block a user