Products order in the Cart and Invoice

  • Posts: 73
  • Thank you received: 0
9 years 1 week ago #247628

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6.24
-- Browser(s) name and version -- : Fire

Hello

I have Plugin that automatically add products to card depending on customer added products...

public function onAfterCartUpdate(&$cartClass,&$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force) {
... $
...
cartClass->updateEntry('1',$cartContent,self::PROD_DIENSL_ONHE_PROD,'1',false,'product',$force);
...
---
It works fine and automatically added products are on the end of Cart.

When the order is confirmed the product order in email is wrong (automatically added product are top).

Regards
Petar Ristanovic

Attachments:

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 6 days ago #247665

Hi,

I'm not sure why that would do that.
Try changing the line:
$query = 'SELECT a.* FROM '.hikashop_table('order_product').' AS a WHERE a.order_id = '.(int)$order->order_id;
to:
$query = 'SELECT a.* FROM '.hikashop_table('order_product').' AS a WHERE a.order_id = '.(int)$order->order_id.' ORDER BY a.order_product_id ASC';
in the file administrator/components/com_hikashop/classes/order.php

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

  • Posts: 73
  • Thank you received: 0
9 years 6 days ago #247686

Hi

It works now. Thank you!

Regards
Petar Ristanovic

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

Time to create page: 0.055 seconds
Powered by Kunena Forum