fixed synchronization when removing or adding products in retailCRM

This commit is contained in:
Frosin 2019-07-11 10:56:24 +03:00
parent 74a5d2c642
commit 9e5b1ba2d8

View File

@ -41,15 +41,13 @@ class RetailcrmHistoryHelper {
$orders[$change['order']['id']]['items'][$change['item']['id']] = $change['item'];
}
if (isset($change['oldValue'])
&& empty($change['oldValue'])
if (empty($change['oldValue'])
&& $change['field'] == 'order_product'
) {
$orders[$change['order']['id']]['items'][$change['item']['id']]['create'] = true;
}
if (isset($change['newValue'])
&& empty($change['newValue'])
if (empty($change['newValue'])
&& $change['field'] == 'order_product'
) {
$orders[$change['order']['id']]['items'][$change['item']['id']]['delete'] = true;