Product price display

  • Posts: 9
  • Thank you received: 0
6 years 2 weeks ago #291235

-- url of the page with the problem -- : myco.foxwellboxoffice.co.uk
-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.1
-- Browser(s) name and version -- : Safari 11.0.3

Sorry to be a pain but struggling with this one. In the product listing display, it generally says the price of each item - eg. "£12.00 each" (as in the attachment below). However, I have products with variants which differ in price and would prefer it to say "From £12.00". I can achieve this across the board by modifying the PRICE_BEGINNING and PER_UNIT strings but I only want this for some items (the ones with variable prices). Is there an easy way of achieving this? I was looking at modifying product/listing_price.php but am having trouble determining what product I am displaying.

Any help would be much appreciated.

Many thanks!
Jonathan

Attachments:

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

  • Posts: 4519
  • Thank you received: 612
  • MODERATOR
6 years 2 weeks ago #291246

Hello,

By default in HikaShop you haven't option that can condition the way to display price from variants or different prices items.
You have to use an override view in order to custom php code.
That's not that much difficult but of course that require good html & php knowledge, in order to add this kind condition :
- Go to Main HikaShop Configuration => Display dropdown => Views
- Use the 3 dropdown filter with Product/YourTemplate/Front End
- And edit the "listing_price" view
- Use this data : $this->row->has_options as a check to determine product with option or without.
=> Around button display code use this kind of code :

if ($this->row->has_options == false) {
    // Display classic price code
}
else {
    // Custom price display
    echo "price start with : " . $price
}
Be aware that this code above is pseudo code, you have to analyze the context in order to have a good result, no error AND a price that will fit your backend display price options.

Hope this will help you.
Regards

Last edit: 6 years 2 weeks ago by Philip.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum