Administrator - Order prices in products page

  • Posts: 61
  • Thank you received: 4
  • Hikashop Business
1 day 3 hours ago #367780

-- url of the page with the problem -- : www.fh1881.ch
-- HikaShop version -- : 6.0.0
-- Joomla version -- : 5.2.1
-- PHP version -- : 8.3
-- Browser(s) name and version -- : All

Hi,
when I'm in the back-end in the products page, many products has two or more prices, assigned to different groups. I need that the prices for the single product are ordered from lowest to highest.
Now I can't understand the ordering.
I've tried to delete the prices and add new prices in the correct order but it doesn't work.
Thank you.

I attach a screenshot of the administrator page and the database table for the same products



Attachments:
Last edit: 14 hours 48 minutes ago by nico1979.

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

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
14 hours 34 minutes ago #367781

Hi,

Change the line:

$query = 'SELECT * FROM '.hikashop_table('price').' WHERE price_product_id IN ('.implode(',',$ids).')';
to:
$query = 'SELECT * FROM '.hikashop_table('price').' WHERE price_product_id IN ('.implode(',',$ids).') ORDER BY price_value ASC';
in the file administrator/components/com_hikashop/views/product/view.html.php and it should do it.
Please confirm that it works as expected. That way, we can include the change on our end for the next version of HikaShop.

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

  • Posts: 61
  • Thank you received: 4
  • Hikashop Business
10 hours 47 minutes ago #367787

Hi, it works perfectly. I've found two times the same line and I've changed both (line 501 and line 818).
But can I work with Display > Views overriding the file and not modifing the core?
Thank you

Last edit: 10 hours 38 minutes ago by nico1979.

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

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
6 hours 56 minutes ago #367789

Hi,

No, the Display>Views menu only supports views and emails overrides, not overrides of other things.
It is possible to make an override of that file as explained in our developer documentation.
However, this is not necessary.
The change will be added on our end. So you don't need to worry about it. Next version will have the change so you won't have to do anything.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum