@@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
408
408
} elseif (\Magento \ImportExport \Model \Import::BEHAVIOR_APPEND == $ behavior ) {
409
409
$ this ->processCountExistingPrices ($ tierPrices , self ::TABLE_TIER_PRICE )
410
410
->processCountNewPrices ($ tierPrices );
411
+
411
412
$ this ->saveProductPrices ($ tierPrices , self ::TABLE_TIER_PRICE );
412
413
if ($ listSku ) {
413
414
$ this ->setUpdatedAt ($ listSku );
@@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)
562
563
563
564
$ tableName = $ this ->_resourceFactory ->create ()->getTable ($ table );
564
565
$ productEntityLinkField = $ this ->getProductEntityLinkField ();
565
- $ existingPrices = $ this ->_connection ->fetchAssoc (
566
+ $ existingPrices = $ this ->_connection ->fetchAll (
566
567
$ this ->_connection ->select ()->from (
567
568
$ tableName ,
568
- ['value_id ' , $ productEntityLinkField , 'all_groups ' , 'customer_group_id ' ]
569
- )->where ($ productEntityLinkField . ' IN (?) ' , $ existProductIds )
569
+ [$ productEntityLinkField , 'all_groups ' , 'customer_group_id ' , 'qty ' ]
570
+ )->where (
571
+ $ productEntityLinkField . ' IN (?) ' ,
572
+ $ existProductIds
573
+ )
570
574
);
571
575
foreach ($ existingPrices as $ existingPrice ) {
572
576
foreach ($ prices as $ sku => $ skuPrices ) {
@@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
591
595
foreach ($ prices as $ price ) {
592
596
if ($ existingPrice ['all_groups ' ] == $ price ['all_groups ' ]
593
597
&& $ existingPrice ['customer_group_id ' ] == $ price ['customer_group_id ' ]
598
+ && (int ) $ existingPrice ['qty ' ] == (int ) $ price ['qty ' ]
594
599
) {
595
600
$ this ->countItemsUpdated ++;
601
+ continue ;
596
602
}
597
603
}
598
604
}
0 commit comments