price range below product

  • Posts: 10
  • Thank you received: 1
5 years 6 days ago #306027

-- HikaShop version -- : 4.0.3

Hi,

You've been always very helpful and I've got last two things to change at shop (essential version) which I am struggling with.

1. I would like to display price range below the product. As much as I can change this in option I do not know how to edit "each" text. I would rather see something like From £££ to £££. Although, this change cannot affect product without variations as the one below. I know I can change "each" by modifying language but this change is affecting product with range price and product with single price.

2. I would like to add a sentence on the bottom of invoice. Where can I add it? Nothing special, just a "thank you" note.

Attachments:

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

  • Posts: 81567
  • Thank you received: 13075
  • MODERATOR
5 years 6 days ago #306037

Hi,

1. You'll have to edit the view file product/listing_price.php via the menu Display>Views and add custom code to display the extra text you want.
For example, before the line:
echo JText::_('PRICE_BEGINNING');
you could add:
if(count($this->row->prices) == 2) echo "From ";

2. You can do that via the menu Display>Views. To know which view file to edit for a specific area, you can activate the "Display view files" setting of the HikaShop configuration and refresh the page where you want to do the modification. It will then tell you which view file to edit for which area of HikaShop.

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

  • Posts: 10
  • Thank you received: 1
5 years 5 days ago #306054

Everything is working.
This is very informative. I was able to edit an invoice, add images, signature etc which is more than expected.
Thank you!!!

The following user(s) said Thank You: nicolas

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

  • Posts: 37
  • Thank you received: 1
4 years 10 months ago #307319

Hi

I found this post very helpful as I am also trying adjust the way my product prices are displayed. However, rather than multiple prices per product I actually have multiple variations (e.g. large and small) which have different prices; so the suggested code doesn't exactly work for me!

This code:
if(count($this->row->prices) == 2) echo "From ";
does not get a true value and I think it is because the main product has no price.

So I need code to check the number of variants of a product, but I do not know what value to check. Something like this:
if(count(....product-variants.....) == 2) echo "From ";
What should I enter for product-variants?

Coding is not my strength so if you can help I would really appreciate it!

Many thanks as always.

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

  • Posts: 81567
  • Thank you received: 13075
  • MODERATOR
4 years 10 months ago #307336

Hi,

First, I would recommend to check the settings of your menu item / module. In there, you'll find a "Which price" setting where you can select what prices you want to show for the products of the listing. You should make sure that you have it set to "range" so that you will have exactly two prices for each product. Otherwise, the if condition won't return true.
And you don't have to look for the variants prices. This is already handled automatically. If you have the setting above set to range, the system will do three things:
- load the prices of the main product
- if the main product doesn't have any price, load the prices of its variants instead
- select the minimum and maximum out of all these prices
So if it's configured properly, you should always get 2 prices, and you shouldn't have to use any other code than the code I gave in my first message on this thread.

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

  • Posts: 37
  • Thank you received: 1
4 years 10 months ago #307356

Thanks Nicolas

Excellent explanation for me being non-techie! The text displays when I changed to "Range" as you suggest. Originally I was showing the cheapest price and expecting to only display for example "From €2.75"

However, it does not make exact sense because now it displays "From €2.75 €4.95"

Is there any other code I can use to achieve either:
"From €2.50"
"From €2.50 To €4.95"

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

  • Posts: 37
  • Thank you received: 1
4 years 10 months ago #307369

I found it!

I set an override in the language file for the setting PRICE_SEPARATOR=" to "
and now it displays From €2.75 to €4.95

Thank you for your help; I tried to understand the code better from your previous reply and that led me to the right place!

The following user(s) said Thank You: nicolas

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

Time to create page: 0.075 seconds
Powered by Kunena Forum