Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Remove display of Discount label Rate Topic   * * * * * 1 votes

 
  • Guest_John_*
  • Guests

Posted 23 January 2012 - 04:25 PM #1

Hi, I'm trying to stop the discount label icon and the % discount from appearing on product listings but I still want to show the list price and my price.

I tried toggling off the relevant 'show' flags in products.tpl but this made no difference, even after clearing the cache. Can I simply comment out the relevant captures for variables List_Discount and Discount_Label in the affected templates (in this case, both products.tpl and default_template.tpl)?

Thanks. version 2.1.4

 
  • Guest_John_*
  • Guests

Posted 26 January 2012 - 04:04 PM #2

It's ok. I sorted it.

 
  • WebWatch
  • Advanced Member
  • Members
  • Join Date: 27-Aug 11
  • 66 posts

Posted 27 January 2012 - 08:00 AM #3

Would you mind sharing what you ended up doing ?

To save me and other the same time and hassle figuring it out ?
Thanks.

CS-Cart 4.4.3


 
  • Guest_John_*
  • Guests

Posted 01 March 2012 - 10:33 AM #4

Here's what I did:-

Removing the Discount label and the % discount amount
1) Removing the label from high level product listing
Edit the template blocks/list_templates/products_list.tpl
Comment out (i.e. {*…….*}) the following code:
<div class = “float_left”>
(assign var=”discount_label” value = “discount_label=&obj_id ‘”}
{smarty.capture.$discount_label}
</div>


2) Removing the label from the product details display
Edit the template customer/blocks/product_templates/default_template.tpl
Comment out the following code:
{if $show_discont_label && $smarty.capture.$discount_label|trim)
<div class = “float_left”>
($smarty.capture.$discount_label)
</div>
{/if}

3) Removing the You save discount percentage

At the moment the detail-level product price displays as follows:
You save: £0.70 (14%)
I wanted:
You save: £0.70
Although this is displayed by the template customer/blocks/product_templates/default_template.tpl, you cannot get rid of the % amount simply by editing out the display of the variable list_discount because this is already a formatted version of the discount amount and percentage. You have to edit customer/common_templates/product_data.tpl as follows:
Find:
{if $product.discount}
<span class="list-price nowrap" id="line_discount_value_{$obj_prefix}{$obj_id}">{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.discount span_id="discount_value_`$obj_prefix``$obj_id`" class="list-price nowrap"}&nbsp;(<span id="prc_discount_value_{$obj_prefix}{$obj_id}" class="list-price nowrap">{$product.discount_prc}</span>%)</span>
{elseif $product.list_discount}

<span class="list-price nowrap" id="line_discount_value_{$obj_prefix}{$obj_id}">
{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.list_discount span_id="discount_value_`$obj_prefix``$obj_id`" class="list-price nowrap"}&nbsp;(<span id="prc_discount_value_{$obj_prefix}{$obj_id}" class="list-price nowrap">{$product.list_discount_prc}</span>%)</span>
Duplicate this section of code, comment out the original and change the new version to:
{if $product.discount}
<span class="list-price nowrap" id="line_discount_value_{$obj_prefix}{$obj_id}">{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.discount span_id="discount_value_`$obj_prefix``$obj_id`" class="list-price nowrap"}</span>
{elseif $product.list_discount}

<span class="list-price nowrap" id="line_discount_value_{$obj_prefix}{$obj_id}">
{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.list_discount span_id="discount_value_`$obj_prefix``$obj_id`" class="list-price nowrap"}</span>

This chops off the (14%) bit.

Don’t forget to clear the cache to ensure the changes are put into effect.

 
  • WebWatch
  • Advanced Member
  • Members
  • Join Date: 27-Aug 11
  • 66 posts

Posted 02 March 2012 - 09:03 AM #5

Thank you for your detailed instructions! :grin:

CS-Cart 4.4.3


 
  • xzxneon
  • Junior Member
  • Trial users
  • Join Date: 21-Feb 09
  • 6 posts

Posted 11 March 2013 - 04:50 PM #6

A lot easier is in style.css just put this
.save-price {display:none;}


 
  • Guest_TheEinstein_*
  • Guests

Posted 27 June 2014 - 09:37 PM #7

To remove the banners (boxes with % saved on images) on the pictures for both "categories.view" and "products.view" (in your url) insert these lines in your "custom.css:"

.save-price {display:none;}
.discount-label {display:none;}

 
  • Guest_Michael_*
  • Guests

Posted 14 August 2015 - 12:32 AM #8

Where do you insert those lines? Any chance of some step by step instructions for those who are not 100% confident with this setup?

Thank you

 
  • Guest_Stefan_*
  • Guests

Posted 02 September 2015 - 02:12 AM #9

Where do you insert those lines? Any chance of some step by step instructions for those who are not 100% confident with this setup?

Thank you

Yes please I need to know too.

Thanks



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 02 September 2015 - 08:49 AM #10

Design -> Themes -> Visual Editor -> CSS section. Add the following rules:

.ty-save-price, .ty-discount-label {
    display:none;
} 

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • krola
  • Advanced Member
  • Members
  • Join Date: 18-Jun 11
  • 68 posts

Posted 18 May 2017 - 10:09 AM #11

I would like to remove only the (double) discount percentage on my product detail page

 

see attachment

 

NOW

You save: €0.70 (14%)
I WANT
You save: €0.70

 

I tried the options above by my version is different so I dont dare change the code.

Hope someone can help

Thank!

version 4.3.4

Attached Thumbnails

  • korting-melding.jpg


 
  • Cart-Power
  • Senior Member
  • Authorized Reseller
  • Join Date: 12-May 14
  • 1549 posts

Posted 19 May 2017 - 10:36 AM #12

Hello! 
 

I would like to remove only the (double) discount percentage on my product detail page
 
see attachment
 
NOW
You save: €0.70 (14%)
I WANT
You save: €0.70
 
I tried the options above by my version is different so I dont dare change the code.
Hope someone can help
Thank!
version 4.3.4

 
In order to remove this info you should change the design/themes/your-active-theme/templates/common/product_data.tpl file. You can do it via My changes add-on, for example. 
 
You need to find the part of the code: 
 

{********************** You Save ******************}
{capture name="list_discount_`$obj_id`"}
    {if $show_price_values && $show_list_discount && $details_page}
        <span class="cm-reload-{$obj_prefix}{$obj_id}" id="line_discount_update_{$obj_prefix}{$obj_id}">
            <input type="hidden" name="appearance[show_price_values]" value="{$show_price_values}" />
            <input type="hidden" name="appearance[show_list_discount]" value="{$show_list_discount}" />
            {if $product.discount}
                <span class="ty-list-price ty-save-price ty-nowrap" id="line_discount_value_{$obj_prefix}{$obj_id}">{__("you_save")}: {include file="common/price.tpl" value=$product.discount span_id="discount_value_`$obj_prefix``$obj_id`" class="ty-list-price ty-nowrap"}&nbsp;(<span id="prc_discount_value_{$obj_prefix}{$obj_id}" class="ty-list-price ty-nowrap">{$product.discount_prc}</span>%)</span>
            {elseif $product.list_discount}
                <span class="ty-list-price ty-save-price ty-nowrap" id="line_discount_value_{$obj_prefix}{$obj_id}"> {__("you_save")}: {include file="common/price.tpl" value=$product.list_discount span_id="discount_value_`$obj_prefix``$obj_id`"}&nbsp;(<span id="prc_discount_value_{$obj_prefix}{$obj_id}">{$product.list_discount_prc}</span>%)</span>
            {/if}
        <!--line_discount_update_{$obj_prefix}{$obj_id}--></span>
    {/if}
{/capture}
{if $no_capture}
    {assign var="capture_name" value="list_discount_`$obj_id`"}
    {$smarty.capture.$capture_name nofilter}
{/if}

And remove the following part of the code:

(<span id="prc_discount_value_{$obj_prefix}{$obj_id}">{$product.list_discount_prc}</span>%)

in this section.

 

Do not forget to clear the cache of your installation and templates.

 

Best regards,


Cart-Power.com / Cart-Power.ru (sales@cart-power.com) offers you:
CS-Cart add-ons :: CS-Cart themes :: CS-Cart development :: CS-Cart license
Работаем с англоязычными и русскоязычными клиентами (work with English-speaking and Russian-speaking customers)