Merge pull request #5 from VitalyArt/abandoned-order

fix abandoned order
This commit is contained in:
Alex Lushpai 2016-03-14 22:35:43 +03:00
commit 2111c99690

View File

@ -5,20 +5,26 @@
<vqmver required="true">2.3.x</vqmver> <vqmver required="true">2.3.x</vqmver>
<author>retailcrm.ru</author> <author>retailcrm.ru</author>
<file path="catalog/model/checkout/" name="order.php"> <file path="catalog/controller/checkout/" name="success.php">
<operation error="skip"> <operation error="skip">
<search position="before" ><![CDATA[return $order_id]]></search> <search position="before" ><![CDATA[$this->cart->clear()]]></search>
<add><![CDATA[ <add><![CDATA[
$this->load->model('account/order');
$this->load->model('checkout/order');
$this->load->model('retailcrm/order'); $this->load->model('retailcrm/order');
$this->model_retailcrm_order->sendToCrm($data, $order_id);
$order = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$order['products'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);
$this->model_retailcrm_order->sendToCrm($order, $this->session->data['order_id']);
]]></add> ]]></add>
</operation> </operation>
</file> </file>
<file path="admin/model/sale/" name="order.php"> <file path="admin/model/sale/" name="order.php">
<operation error="skip"> <operation error="skip">
<search position="after" ><![CDATA[$this->db->query("UPDATE `" . DB_PREFIX . "order` SET total = '" . (float)$total . "', affiliate_id = '" . (int)$affiliate_id . "', commission = '" . (float)$commission . "' WHERE order_id = '" . (int)$order_id . "'");]]></search> <search position="after" ><![CDATA[$this->db->query("UPDATE `" . DB_PREFIX . "order` SET total = '" . (float)$total . "', affiliate_id = '" . (int)$affiliate_id . "', commission = '" . (float)$commission . "' WHERE order_id = '" . (int)$order_id . "'");]]></search>
<add><![CDATA[ <add><![CDATA[
if (!isset($data['fromApi'])) { if (!isset($data['fromApi'])) {
$this->load->model('setting/setting'); $this->load->model('setting/setting');
$status = $this->model_setting_setting->getSetting('retailcrm'); $status = $this->model_setting_setting->getSetting('retailcrm');
@ -35,7 +41,6 @@
} }
} }
]]></add> ]]></add>
</operation> </operation>
</file> </file>
</modification> </modification>