How to show price as £120 - £185

  • Posts: 70
  • Thank you received: 3
3 years 5 months ago #337960

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 3.10.3

Hi, I would like to show the price as the lowest first and then the highest. So if the lowest was £120 and the highest variant was £185, I would like to show:

£120 - £185

I tried in the module to choose 'Which Price' to 'Price Range' but it shows it like this:

£ 230.00 each
£ 325.00 each

Thanks.

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

  • Posts: 83778
  • Thank you received: 13565
  • MODERATOR
3 years 5 months ago #337967

Hi,

It's a good start.
Then, you can remove the text "each" with a translation override:
www.hikashop.com/download/languages.html#modify
And you can add the translation override below to add the dash in between both prices:
PRICE_ENDING_0=" - "
And finally, you can have both prices on the same row with CSS.

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

  • Posts: 70
  • Thank you received: 3
3 years 3 months ago #338895

Hi, I looked for PRICE_ENDING_0 and PRICE_ENDING none of those exist as either a constant or a value. Is it called something else?

I also I looked in the View and the <br><br> tags it adds in between the two prices is not showing in the view code. See below:

Attachments:
Last edit: 3 years 3 months ago by spytech.

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

  • Posts: 83778
  • Thank you received: 13565
  • MODERATOR
3 years 3 months ago #338907

Hi,

The PRICE_ENDING_0 translation key doesn't exist by default.
But the code in HikaShop looks for it. And if it finds it, it uses it.
So you need to add that translation override line in the override file of your language (you can do so by editing your language under the Languages tab of the HikaShop configuration and then adding the line on the right side textarea before saving).

For the br tags, I don't have it on my end too. It might be added in a view override of product / listing_price so you can check that via the menu Display>Views.
However, you can easily disable the br tags there with that CSS:
.hikashop_product_several_prices br { display: none; }

The following user(s) said Thank You: spytech

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

  • Posts: 70
  • Thank you received: 3
3 years 3 months ago #338922

Great, thanks so much for the detailed response, that solved most of my issues.

One last thing I now get the following when I have one price, you will see the hyphen at the end.
Is there a way I can only show the '-' when there is more than one price?

£215 -

Last edit: 3 years 3 months ago by spytech.

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

  • Posts: 83778
  • Thank you received: 13565
  • MODERATOR
3 years 3 months ago #338929

Hi,

Yes.
Instead of :
PRICE_ENDING_0=" - "
add:
PRICE_ENDING_0="<span class='my_separator_class'> - </span>"
as a translation override.
And then the CSS:

.my_separator_class { display: none; }
.hikashop_product_several_prices .my_separator_class { display: inline; }

The following user(s) said Thank You: spytech

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

  • Posts: 70
  • Thank you received: 3
3 years 3 months ago #338993

Thanks so much for such precise answers!! Great support.
All sorted now.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.065 seconds
Powered by Kunena Forum