From 25bdfefcbb73539af72718a92f9a631b47e6500a Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Fri, 20 Jul 2012 08:54:47 +0000 Subject: [PATCH] [-] MO : #PSCFV-3274 - No links to remove discounts without code in module blockcart --- modules/blockcart/ajax-cart.js | 5 ++++- modules/blockcart/blockcart-json.tpl | 1 + modules/blockcart/blockcart.tpl | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index 4a2f664ed..c71f5e95d 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -383,12 +383,15 @@ var ajaxCart = { { if (parseFloat(jsonData.discounts[i].price_float) > 0) { + var delete_link = ''; + if (jsonData.discounts[i].code.length) + delete_link = ''+delete_txt+''; $('#vouchers tbody').append($( '' +' 1x' +' '+jsonData.discounts[i].name+'' +' -'+jsonData.discounts[i].price+'' - +' '+delete_txt+'' + +' ' + delete_link + '' +'' )); } diff --git a/modules/blockcart/blockcart-json.tpl b/modules/blockcart/blockcart-json.tpl index 680805742..d70724d4c 100644 --- a/modules/blockcart/blockcart-json.tpl +++ b/modules/blockcart/blockcart-json.tpl @@ -88,6 +88,7 @@ "name": "{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|addslashes|replace:'\\\'':'\''}", "description": "{$discount.description|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}")}", "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}" diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl index ad5a71a3e..bb5d0ca53 100644 --- a/modules/blockcart/blockcart.tpl +++ b/modules/blockcart/blockcart.tpl @@ -115,7 +115,11 @@ var img_dir = '{$img_dir}'; 1x {$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'} -{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if} - {l s='Delete' mod='blockcart'} + + {if strlen($discount.code)} + {l s='Delete' mod='blockcart'} + {/if} + {/if} {/foreach}