<commit_before><?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Send order to RetailCRM when it created</id>
	<version>1.5.x</version>
	<vqmver required="true">2.3.x</vqmver>
	<author><EMAIL></author>

	<file path="catalog/controller/checkout/" name="success.php">
		<operation error="skip">
			<search position="before" ><![CDATA[$this->cart->clear()]]></search>
			<add><![CDATA[
			$this->load->model('account/order');
			$this->load->model('checkout/order');
			$this->load->model('retailcrm/order');

			$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>
		</operation>
	</file>

	<file path="admin/model/sale/" name="order.php">
		<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>
			<add><![CDATA[
			if (!isset($data['fromApi'])) {
                $this->load->model('setting/setting');
                $status = $this->model_setting_setting->getSetting('retailcrm');

                if (!empty($data['order_status_id'])) {<commit_msg>Update retailcrm_create_order.xml<commit_after><?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id>Send order to RetailCRM when it created</id>
	<version>1.5.x</version>
	<vqmver required="true">2.3.x</vqmver>
	<author>retailcrm.ru</author>

	<file path="catalog/controller/checkout/" name="success.php">
		<operation error="skip">
			<search position="before" ><![CDATA[$this->cart->clear()]]></search>
			<add><![CDATA[
			$this->load->model('account/order');
			$this->load->model('checkout/order');
			$this->load->model('retailcrm/order');

			$order = $this->model_checkout_order->getOrder($this->session->data['order_id']);
			$order['products'] = $this->model_account_order->getOrderProducts($this->session->data['order_id']);
			$order['order_total'] = $this->model_account_order->getOrderTotals($this->session->data['order_id']);

			$this->model_retailcrm_order->sendToCrm($order, $this->session->data['order_id']);
			]]></add>
		</operation>
	</file>

	<file path="admin/model/sale/" name="order.php">
		<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>
			<add><![CDATA[
			if (!isset($data['fromApi'])) {
                $this->load->model('setting/setting');
                $status = $this->model_setting_setting->getSetting('retailcrm');

                if (!empty($data['order_status_id'])) {
{'fraction_non_alphanumeric': 0.23331108144192256, 'fraction_numerical': 0.004672897196261682, 'mean_word_length': 4.697718631178708, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 2, '>': 112, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '393637', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1013, 'n_words': 133}