mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-04-11 12:50:55 +00:00
Fixed duplicating items on history sync
This commit is contained in:
parent
25002a634f
commit
effc4759c4
1 changed files with 8 additions and 2 deletions
|
@ -1137,10 +1137,10 @@ class RetailcrmHistory
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool Returns if stock of all items is enough
|
||||
*
|
||||
* @throws PrestaShopDatabaseException
|
||||
* @throws PrestaShopException
|
||||
*
|
||||
* @return bool Returns if stock of all items is enough
|
||||
*/
|
||||
private static function createOrderDetails($crmOrder, $prestashopOrder, $isCreating = false)
|
||||
{
|
||||
|
@ -1604,6 +1604,12 @@ class RetailcrmHistory
|
|||
{
|
||||
$isStockEnough = true;
|
||||
|
||||
if (empty($crmOrder['items'])) {
|
||||
RetailcrmLogger::writeDebug(__METHOD__, 'Empty order items');
|
||||
|
||||
return $isStockEnough;
|
||||
}
|
||||
|
||||
foreach ($prestashopOrder->getProductsDetail() as $orderItem) {
|
||||
foreach ($crmOrder['items'] as $key => $crmItem) {
|
||||
if (RetailcrmOrderBuilder::isGiftItem($crmItem)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue