how to change the display for discounts

  • Posts: 2
  • Thank you received: 0
13 years 4 months ago #21930

First of all, wow, what a fantastic component.

Second, I created a discount for my products but I don't like the wording of the discount per product. I found the appropriate language file but I would like to get rid of the hyphen (or minus sign), which does not appear to be in the language file. I prefer to hack the core to avoid problems when upgrading.

For example, one my products sells for $25 with a 20% discount. It appears on the website to customers as "$20 -20% each". This reads as if the customer will get an additional 20%.

I changed the language file so that its says "$20 -20% savings" but this is awkward, particularly with the hyphen (which many will translate as a "subtract" sign).

The price listing is a bit misleading because the product is originally $25, so it should say:
$20 (Save 20%) or $20 (originally $25) or something without the hyphen.

Any thoughts?

Please Log in or Create an account to join the conversation.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
13 years 4 months ago #21934

Hi,

Near the top of the translation file, you will find the text:

PRICE_DISCOUNT_START=""
PRICE_DISCOUNT_END=""

By overriding these translations you can add your parentheses to the discounts information of prices:
www.hikashop.com/download/languages.html#modify

You can also change the way the discount is displayed (a percentage or the original amount) with the option "Show discounted price" in the Display tab of the config and with the same option in the hikashop options each of your menus/modules that you can access via the menu Display->Content menus/modules

Please Log in or Create an account to join the conversation.

  • Posts: 2
  • Thank you received: 0
13 years 4 months ago #21939

Thank you for your prompt and very helpful response.

I created the following overrides.
PRICE_DISCOUNT_START="(save"
PRICE_DISCOUNT_END=")"

But I can't get rid of the hyphen. It should say (save 20%) but it says (save-20%). It's a small thing that I can live with but I would change it if it could be done. I also tried your suggestion to "display the price before the discount is applied". It worked in the shopping cart module but it didn't impact the product display in the main body. I keep digging in the help files and configuration as I'm certain that I'm missing something simple.

Thanks again for a great product and great support.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
13 years 4 months ago #21941

If you want to remove the - symbol, you can edit the file listing_price of the view product via the menu Display->Views and change the line:
echo -1*$this->row->discount->discount_percent_amount.'%';

to:
echo $this->row->discount->discount_percent_amount.'%';

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 0
12 years 11 months ago #33897

I have followed this thread but it doesn't seem to solve the problem. The suggested modifications produce this
430,00 € (you save -240,00 €) each.
The minus sign is still there when the discounted amount is not a percentage. Getting rid of the minus sign is not a problem but in the single product view you get this
430,00 € (you save 670,00 €) each.
You see that the what is in the bracket is not the discounted amount but the price before the discount.

To avoid any confusions I would be glad if you could guide me to achieve something like the attached image

Attachments:
Last edit: 12 years 11 months ago by vilost.

Please Log in or Create an account to join the conversation.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
12 years 11 months ago #33909

The options won't be enough to display all three prices at the same time.
For that, you'll have to edit the file "listing_price" of the view "product" via the menu Display->Views.

You could use something like that for example:

echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id). ' ' .$this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id). '<br/>You save: ' .$this->currencyHelper->format($price->price_orig_value_without_discount-$price->price_orig_value,$price->price_orig_currency_id);

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 0
12 years 10 months ago #34099

No luck. I tried but did not succeed. I dont know php enough so I dont know which lines to replace in the code or where exactly to place the code. After trying different options in the default Hikashop setting I was able to get something like this
430 € (670 €) each
I am OK with that for the moment.

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum