How to hide empty discount value on options reload

Hello,



I made some changes and now can apply promotion only to selected options (in catalog promotions mode) but if I change options the discount label change on reload only if there is promotion for that option…



how can I hide discount label if promotion for selected option is 0??? I was trying different conditions but it does not function properly with ajax reload…



Any hint?

well, it was just a matter to be more attentive.



in product_data.tpl



change


{capture name="discount_label_`$obj_prefix``$obj_id`"}
{if $show_discount_label && ($product.discount_prc || $product.list_discount_prc) && $show_price_values}





-{if $product.discount}{$product.discount_prc}{else}{$product.list_discount_prc}{/if}%


{/if}
{/capture}
{if $no_capture}
{assign var="capture_name" value="discount_label_`$obj_prefix``$obj_id`"}
{$smarty.capture.$capture_name}
{/if}




to


```php

{capture name=“discount_label_$obj_prefix``$obj_id”}




{if $show_discount_label && ($product.discount_prc || $product.list_discount_prc) && $show_price_values}

-{if $product.discount}{$product.discount_prc}{else}{$product.list_discount_prc}{/if}%
{/if}

{/capture}
{if $no_capture}
{assign var="capture_name" value="discount_label_`$obj_prefix``$obj_id`"}
{$smarty.capture.$capture_name}
{/if}
```

same thing you can do for "old price" and "you save".