Price sorting - taking the lowest price of the variants

  • Posts: 369
  • Thank you received: 14
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Subscription Hikashop Business
1 week 3 days ago #322522

Hi, I would very much like to add price sorting and for variants. Because I use HikaMarket and do not need a main product price but only variants, price filters become useless. I think it is best to do so when the main product has no price is to take the lowest price of the variants.

Last edit: 1 week 3 days ago by neo191987.

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

  • Posts: 70194
  • Thank you received: 10508
  • MODERATOR
1 week 3 days ago #322538

Hi,

To do that, you would need to add custom code before the line:

$element->product_sort_price = hikashop_toFloat($selectedPrice->price_value);
in the file administrator/components/com_hikashop/classes/product.php
There, you have the price objects of the variants in $publicPrices and you need to set the one you want in the $publicPrices variable.
By default, it just uses the first one it finds thanks to the code:
$selectedPrice = reset($publicPrices);

The following user(s) said Thank You: neo191987

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

Time to create page: 0.056 seconds
Powered by Kunena Forum