From b14349e914b9f908590782718d1fbe8855e3b776 Mon Sep 17 00:00:00 2001 From: M2E Pro Date: Wed, 6 Sep 2023 09:02:19 +0000 Subject: [PATCH] 6.45.0 (FINAL RELEASE) --- .../SynchronizeData/AfnQty/Responser.php | 31 ++++++++++--------- app/code/community/Ess/M2ePro/composer.json | 2 +- app/code/community/Ess/M2ePro/etc/config.xml | 2 +- .../sql/Upgrade/v6_44_2__v6_45_0/Config.php | 15 +++++++++ composer.json | 2 +- 5 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 app/code/community/Ess/M2ePro/sql/Upgrade/v6_44_2__v6_45_0/Config.php diff --git a/app/code/community/Ess/M2ePro/Model/Cron/Task/Amazon/Listing/Product/Channel/SynchronizeData/AfnQty/Responser.php b/app/code/community/Ess/M2ePro/Model/Cron/Task/Amazon/Listing/Product/Channel/SynchronizeData/AfnQty/Responser.php index c5b3827e..0e0de667 100644 --- a/app/code/community/Ess/M2ePro/Model/Cron/Task/Amazon/Listing/Product/Channel/SynchronizeData/AfnQty/Responser.php +++ b/app/code/community/Ess/M2ePro/Model/Cron/Task/Amazon/Listing/Product/Channel/SynchronizeData/AfnQty/Responser.php @@ -160,25 +160,28 @@ function ($value) { ) ->where('aa.merchant_id = ? AND is_afn_channel = 1', $merchantId); - /** @var Ess_M2ePro_Model_Listing_Product $item */ - foreach ($m2eproListingProductCollection->getItems() as $item) { - $this->updateItem( - $item, - $receivedItems[$item->getChildObject()->getSku()] - ); - } + $normalizedReceivedItems = array_change_key_case($receivedItems, CASE_LOWER); - /** @var Ess_M2ePro_Model_Listing_Other $item */ - foreach ($unmanagedListingProductCollection->getItems() as $item) { - $this->updateItem( - $item, - $receivedItems[$item->getChildObject()->getSku()] - ); - } + $this->updateItemsFromCollection($m2eproListingProductCollection, $normalizedReceivedItems); + $this->updateItemsFromCollection($unmanagedListingProductCollection, $normalizedReceivedItems); $this->refreshLastUpdate(true); } + private function updateItemsFromCollection($collection, array $normalizedReceivedItems) + { + foreach ($collection->getItems() as $item) { + $sku = strtolower($item->getChildObject()->getSku()); + + if (isset($normalizedReceivedItems[$sku])) { + $this->updateItem( + $item, + $normalizedReceivedItems[$sku] + ); + } + } + } + /** * @param Ess_M2ePro_Model_Listing_Product|Ess_M2ePro_Model_Listing_Other $item * @param int|string $afnQty diff --git a/app/code/community/Ess/M2ePro/composer.json b/app/code/community/Ess/M2ePro/composer.json index ed5c66e6..18ab68cc 100644 --- a/app/code/community/Ess/M2ePro/composer.json +++ b/app/code/community/Ess/M2ePro/composer.json @@ -2,7 +2,7 @@ "name": "m2epro/magento1-extension", "description": "M2E Pro is a Magento trusted (TM), award-winning extension, which allows merchants of all sizes to fully integrate Magento based system(s) into eBay/Amazon/Walmart platforms.", "type": "magento-module", - "version": "6.44.2", + "version": "6.45.0", "license": "proprietary", "keywords": ["ebay", "amazon", "walmart", "magento"], "homepage": "https://www.m2epro.com/", diff --git a/app/code/community/Ess/M2ePro/etc/config.xml b/app/code/community/Ess/M2ePro/etc/config.xml index b09a9f80..e8e8fb8f 100644 --- a/app/code/community/Ess/M2ePro/etc/config.xml +++ b/app/code/community/Ess/M2ePro/etc/config.xml @@ -2,7 +2,7 @@ - 6.44.2 + 6.45.0 diff --git a/app/code/community/Ess/M2ePro/sql/Upgrade/v6_44_2__v6_45_0/Config.php b/app/code/community/Ess/M2ePro/sql/Upgrade/v6_44_2__v6_45_0/Config.php new file mode 100644 index 00000000..4a057b96 --- /dev/null +++ b/app/code/community/Ess/M2ePro/sql/Upgrade/v6_44_2__v6_45_0/Config.php @@ -0,0 +1,15 @@ +