Display of lowest price for products with several variants

  • Posts: 51
  • Thank you received: 4
4 years 4 months ago #313113

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.13
-- PHP version -- : 7.2.24

Is there at way to have the lowest price displayed on the "mother product" of a product with several variants and several prices? Something like "Prices from xxx" where xxx should be replaced with the lowest price.

Best Regards,
Anders

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 4 months ago #313125

Hi,

You're talking about the product listings on the frontend?

Yes, in the settings under the "products options" tab of your menu item, you have a setting "Which price" that you can set to "cheapest". That way, if the main product has several prices, it will display the cheapest on the listing, and if the main product has no price but its variants have prices, it will display the cheapest of the variants prices on the listing.

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

  • Posts: 51
  • Thank you received: 4
4 years 4 months ago #313143

Thanks, this is OK .... I am not a programmer, but is it not not possible to in this case ("main product" with no price and variants with different prices) put some words before the price shown on the main product - some like "Prices from " and then the lowest price?

Best Regards,
Anders

Last edit: 4 years 4 months ago by anders.drejer.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 4 months ago #313146

Hi,

You will have to do some code modification:
www.hikashop.com/forum/product-category-...ice-from.html#275671
But if the solution proposed there is ok with you, then it's a simple copy/paste.

The following user(s) said Thank You: anders.drejer

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

  • Posts: 51
  • Thank you received: 4
4 years 4 months ago #313174

I assume, that the line from www.hikashop.com/forum/product-category-...ice-from.html#275671 should be added to this:



But where in the file should the line <?php if($this->row->has_options) echo 'Price from '; ?> be added?

And is it possible to make translations in a multilingual site?

Best Regards,
Anders

Attachments:
Last edit: 4 years 4 months ago by anders.drejer.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 4 months ago #313197

Hi,

That's the cart / listing_price.php view file in your screenshot, but you need to add your code in product / listing_price.php

You can add the code at the top of the file after the first <?php tag

You can use translations like this:
<?php if($this->row->has_options) echo JText::_('MY_TRANSLATION'); ?>

And then you can add such line as a translation override:
MY_TRANSLATION="Price from "

The following user(s) said Thank You: anders.drejer

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

Time to create page: 0.075 seconds
Powered by Kunena Forum