- Posts: 73
- Thank you received: 0
Products order in the Cart and Invoice
10 years 1 month ago #247628
by sokartch
Products order in the Cart and Invoice was created by sokartch
-- 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
-- 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
Please Log in or Create an account to join the conversation.
10 years 1 month ago #247665
by nicolas
Replied by nicolas on topic Products order in the Cart and Invoice
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
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.
10 years 1 month ago #247686
by sokartch
Replied by sokartch on topic Products order in the Cart and Invoice
Hi
It works now. Thank you!
Regards
Petar Ristanovic
It works now. Thank you!
Regards
Petar Ristanovic
Please Log in or Create an account to join the conversation.
Time to create page: 0.154 seconds