Unknown column 'order_subtotal' in 'field list'

  • Posts: 12
  • Thank you received: 0
8 years 7 months ago #213212

-- 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:

$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.

  • Posts: 12
  • Thank you received: 0
8 years 7 months ago #213253

Okay!
I seem to have found a way around like this:

$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.

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
8 years 7 months ago #213254

Hi,

That code is wrong.
What you want to do is this:

$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:
$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.

  • Posts: 12
  • Thank you received: 0
8 years 7 months ago #213341

Ah, so it's like the JDatabase updateObject()?
Anyway. That fixed it. Thanks.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
8 years 7 months ago #213345

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum