-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.0.19
Hello,
First of all thanks to the developers for great e-commerce extension. I am working for a payment plugin & have taken alipay as sample of my work. The plugin is working fine but after getting notification from payment server I tried to use modifyOrder() method to update the order status but it's not working.
I am doing like:
$history = new stdClass();
$price_check = round($dbOrder->order_full_price, (int)$this->currency->currency_locale['int_frac_digits'] );
$history->notified=1;
$history->amount=$price_check;
$history->data = ob_get_clean();
$order_status = $this->payment_params->verified_status;
if($dbOrder->order_status == $order_status) return true;
$this->modifyOrder($order_id,$order_status,$history,false);
But the above code not updating the order's status. I checked that $order_id is OK, $this->payment_params & $this->getOrder($order_id) has the data too. I tried to do update the status of the order manually like this:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$fields = array($db->quoteName('order_status') . ' = ' . $db->quote($order_status));
$conditions = array($db->quoteName('order_id') . ' = ' . $db->quote($order_id));
$query->update($db->quoteName('#__hikashop_order'))->set($fields)->where($conditions);
$db->setQuery($query);
$result = $db->execute();
But I can't understand why modifyOrder() method not working. I can change the status manually but it won't send confirmation emails & will avoid running other important triggers. Any suggestion please?
Thanks