Skip to main content

Unknown column 'order_subtotal' in 'field list'

More
11 years 1 month ago #213212 by cgonline
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : All
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : $orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id, false, false);
$orderClass->save($order);

Returns:
Unknown column 'order_subtotal' in 'field list' SQL=UPDATE `oklpt_hikashop_order` SET ...

Hi

Im trying to update an order from a system plugin, but it fails with an SQL error:
Unknown column 'order_subtotal' in 'field list' SQL=UPDATE `oklpt_hikashop_order` SET ...

Newest Hikashop is installed, but no luck.
Im using this:
Code:
$orderClass = hikashop_get('class.order'); $order = $orderClass->loadFullOrder($order_id, false, false); $orderClass->save($order);

How can I update (cancel or confirm) an existing order from a system plugin + send the email notification to the customer codewise?

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

More
11 years 1 month ago #213253 by cgonline
Okay!
I seem to have found a way around like this:
Code:
$order = $orderClass->loadFullOrder($orderID, false, false); // Avoid Hikashop save bug! unset($order->order_subtotal); unset($order->order_subtotal_no_vat); $orderClass->save($order);

But how can I manully trigger a notification to the customer?

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

More
11 years 1 month ago #213254 by nicolas
Hi,

That code is wrong.
What you want to do is this:
Code:
$orderClass = hikashop_get('class.order'); $order = new stdClass(); $order->order_id = $order_id; $order->order_status = "confirmed"; $orderClass->save($order);
And if you want a notification, you can add such code before the save:
Code:
$order->history = new stdClass(); $order->history->history_notified = 1;
The following user(s) said Thank You: cgonline, dzseti

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

More
11 years 1 month ago #213341 by cgonline
Ah, so it's like the JDatabase updateObject()?
Anyway. That fixed it. Thanks.

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

More
11 years 1 month ago #213345 by Jerome
Hi,

Yes ; it's the same kind, but we are not using JTable objects (it is not available in Joomla 1.5).

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

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

Time to create page: 0.195 seconds
Powered by Kunena Forum