From 9fd51ee175b3d71a4bb202f291d9808bfe59a4a3 Mon Sep 17 00:00:00 2001 From: M2E Pro Date: Tue, 5 Apr 2022 13:57:31 +0000 Subject: [PATCH] 6.21.1 (FINAL RELEASE) --- app/code/community/Ess/M2ePro/CHANGELOG | 11 ++- .../community/Ess/M2ePro/Helper/Magento.php | 5 ++ .../SynchronizeChanges/ItemsProcessor.php | 4 +- .../Listing/Product/Action/Type/Response.php | 2 +- .../Ess/M2ePro/Model/Ebay/Order/Item.php | 2 +- .../M2ePro/Model/Order/Item/OptionsFinder.php | 2 +- .../Model/Resource/Ebay/Listing/Other.php | 69 ++++++++++++++----- .../M2ePro/Model/Servicing/Task/Statistic.php | 28 +++----- app/code/community/Ess/M2ePro/composer.json | 2 +- app/code/community/Ess/M2ePro/etc/config.xml | 2 +- .../Ess/M2ePro/sql/Install/Amazon.php | 4 +- .../community/Ess/M2ePro/sql/Install/Ebay.php | 2 +- .../Ess/M2ePro/sql/Install/Walmart.php | 2 +- .../y22_m03/SetPrecisionInVatRateColumns.php | 51 ++++++++++++++ .../sql/Upgrade/v6_21_0__v6_21_1/Config.php | 21 ++++++ .../controlPanel/inspection/versionInfo.phtml | 2 - composer.json | 2 +- 17 files changed, 158 insertions(+), 53 deletions(-) create mode 100644 app/code/community/Ess/M2ePro/sql/Update/y22_m03/SetPrecisionInVatRateColumns.php create mode 100644 app/code/community/Ess/M2ePro/sql/Upgrade/v6_21_0__v6_21_1/Config.php diff --git a/app/code/community/Ess/M2ePro/CHANGELOG b/app/code/community/Ess/M2ePro/CHANGELOG index b2f78e808..236406825 100644 --- a/app/code/community/Ess/M2ePro/CHANGELOG +++ b/app/code/community/Ess/M2ePro/CHANGELOG @@ -1,8 +1,15 @@ -* 6.21.0 (23/03/2022) +* 6.21.1 (05/04/2022) + +Common [Fixed] Unable to set a decimal value in the "VAT Rate" field in the Selling Policy [#3100] +eBay [Fixed] Incorrect mapping of floating-point variations when creating a Magento Order [#3108] +eBay [Fixed] Repetitive automatic Revise of eBay Parts Compatibility [#3427} +eBay [Fixed] Item ID is displayed as N/A for some products [#2990] + +* 6.21.0 (23/03/2022) Common: [Fixed] A fully shipped combined order is marked as Partially Shipped on the Channel [#3437] Common: [Fixed] "Page not found" is displayed after clicking on some Help Center links [#3439],[#3440] -Amazon: [Added] AWS auth token verification [#3042] +Amazon: [Added] MWS auth token verification [#3042] * 6.20.2 (15/03/2022) diff --git a/app/code/community/Ess/M2ePro/Helper/Magento.php b/app/code/community/Ess/M2ePro/Helper/Magento.php index 5d49d9bcc..bebdf229f 100644 --- a/app/code/community/Ess/M2ePro/Helper/Magento.php +++ b/app/code/community/Ess/M2ePro/Helper/Magento.php @@ -96,6 +96,11 @@ public function isSecretKeyToUrl() return (bool)Mage::getStoreConfigFlag('admin/security/use_form_key'); } + public function getTimeZone() + { + return Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE); + } + public function getCurrentSecretKey() { if (!$this->isSecretKeyToUrl()) { diff --git a/app/code/community/Ess/M2ePro/Model/Cron/Task/Ebay/Channel/SynchronizeChanges/ItemsProcessor.php b/app/code/community/Ess/M2ePro/Model/Cron/Task/Ebay/Channel/SynchronizeChanges/ItemsProcessor.php index e93da53cf..456188985 100644 --- a/app/code/community/Ess/M2ePro/Model/Cron/Task/Ebay/Channel/SynchronizeChanges/ItemsProcessor.php +++ b/app/code/community/Ess/M2ePro/Model/Cron/Task/Ebay/Channel/SynchronizeChanges/ItemsProcessor.php @@ -629,8 +629,8 @@ protected function isVariationEqualWithChange( $haveOption = false; foreach ($changeVariation['specifics'] as $changeVariationOption=>$changeVariationValue) { - if ($variationSnapshotOptionName == trim($changeVariationOption) && - $variationSnapshotOptionValue == trim($changeVariationValue)) + if ($variationSnapshotOptionName === trim($changeVariationOption) && + $variationSnapshotOptionValue === trim($changeVariationValue)) { $haveOption = true; break; diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php index 802597502..27d297461 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Listing/Product/Action/Type/Response.php @@ -598,7 +598,7 @@ protected function appendCategoriesValues($data) protected function appendPartsValues($data) { $requestMetadata = $this->getRequestMetaData(); - if (!isset($requestMetadata['parts_data_hash'])) { + if (!array_key_exists('parts_data_hash', $requestMetadata)) { return $data; } diff --git a/app/code/community/Ess/M2ePro/Model/Ebay/Order/Item.php b/app/code/community/Ess/M2ePro/Model/Ebay/Order/Item.php index 18b2d2476..9fe95efe9 100644 --- a/app/code/community/Ess/M2ePro/Model/Ebay/Order/Item.php +++ b/app/code/community/Ess/M2ePro/Model/Ebay/Order/Item.php @@ -244,7 +244,7 @@ public function getVariationProductOptions() } foreach ($channelItem->getVariations() as $variation) { - if ($variation['channel_options'] != $this->getVariationChannelOptions()) { + if ($variation['channel_options'] !== $this->getVariationChannelOptions()) { continue; } diff --git a/app/code/community/Ess/M2ePro/Model/Order/Item/OptionsFinder.php b/app/code/community/Ess/M2ePro/Model/Order/Item/OptionsFinder.php index aaf4ee795..9de3f2532 100644 --- a/app/code/community/Ess/M2ePro/Model/Order/Item/OptionsFinder.php +++ b/app/code/community/Ess/M2ePro/Model/Order/Item/OptionsFinder.php @@ -317,7 +317,7 @@ protected function getGroupedAssociatedProduct() foreach ($this->_magentoOptions as $option) { // return product if it's name is equal to variation name - if ($variationName === null || trim(strtolower($option->getName())) == trim(strtolower($variationName))) { + if ($variationName === null || trim(strtolower($option->getName())) === trim(strtolower($variationName))) { return $option; } } diff --git a/app/code/community/Ess/M2ePro/Model/Resource/Ebay/Listing/Other.php b/app/code/community/Ess/M2ePro/Model/Resource/Ebay/Listing/Other.php index fa40e8acf..b041a116e 100644 --- a/app/code/community/Ess/M2ePro/Model/Resource/Ebay/Listing/Other.php +++ b/app/code/community/Ess/M2ePro/Model/Resource/Ebay/Listing/Other.php @@ -23,33 +23,68 @@ public function _construct() public function resetEntities() { - $listingOther = Mage::getModel('M2ePro/Listing_Other'); - $ebayListingOther = Mage::getModel('M2ePro/Ebay_Listing_Other'); + $listingOtherTable = Mage::helper('M2ePro/Module_Database_Structure') + ->getTableNameWithPrefix('m2epro_listing_other'); + $ebayItemTable = Mage::helper('M2ePro/Module_Database_Structure') + ->getTableNameWithPrefix('m2epro_ebay_item'); + $ebayListingOtherTable = Mage::helper('M2ePro/Module_Database_Structure') + ->getTableNameWithPrefix('m2epro_ebay_listing_other'); + $ebayListingProductTable = Mage::helper('M2ePro/Module_Database_Structure') + ->getTableNameWithPrefix('m2epro_ebay_listing_product'); - $stmt = Mage::helper('M2ePro/Component_Ebay')->getCollection('Listing_Other')->getSelect()->query(); + $componentName = Ess_M2ePro_Helper_Component_Ebay::NICK; - $itemIds = array(); - foreach ($stmt as $row) { - $listingOther->setData($row); - $ebayListingOther->setData($row); + $ebayItemIdsQuery = <<setChildObject($ebayListingOther); - $ebayListingOther->setParentObject($listingOther); - $itemIds[] = $ebayListingOther->getItemId(); + $listingOtherIdsQuery = <<deleteInstance(); - } + $ebayListingOtherIdsQuery = <<getTableNameWithPrefix('m2epro_ebay_item'); - $writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write'); - foreach(array_chunk($itemIds, 1000) as $chunkItemIds) { - $writeConnection->delete($tableName, array('item_id IN (?)' => $chunkItemIds)); - } + $this->removeRecords($ebayItemIdsQuery, 'item_id', $ebayItemTable); + $this->removeRecords($listingOtherIdsQuery, 'id', $listingOtherTable); + $this->removeRecords($ebayListingOtherIdsQuery, 'listing_other_id', $ebayListingOtherTable); foreach (Mage::helper('M2ePro/Component_Ebay')->getCollection('Account') as $account) { $account->setData('other_listings_last_synchronization', null)->save(); } } + /** + * @param string $sql + * @param string $key + * @param string $table + */ + private function removeRecords($sql, $key, $table) + { + $itemIds = array(); + + $connection = Mage::getSingleton('core/resource')->getConnection('core_write'); + + foreach ($connection->fetchAll($sql) as $row) { + $itemIds[] = $row[$key]; + } + + foreach (array_chunk($itemIds, 1000) as $itemIdsSet) { + $connection->delete($table, array('`' . $key . '` IN (?)' => $itemIdsSet)); + } + } + //######################################## } diff --git a/app/code/community/Ess/M2ePro/Model/Servicing/Task/Statistic.php b/app/code/community/Ess/M2ePro/Model/Servicing/Task/Statistic.php index 93573e81f..2ea301064 100644 --- a/app/code/community/Ess/M2ePro/Model/Servicing/Task/Statistic.php +++ b/app/code/community/Ess/M2ePro/Model/Servicing/Task/Statistic.php @@ -115,10 +115,9 @@ protected function appendServerMysqlInfo(&$data) $data['mysql']['version'] = Mage::helper('M2ePro/Client')->getMysqlVersion(); $data['mysql']['api'] = Mage::helper('M2ePro/Client')->getMysqlApiName(); - $data['mysql']['database_name'] = Mage::helper('M2ePro/Magento')->getDatabaseName(); - $data['mysql']['table_prefix'] = Mage::helper('M2ePro/Magento')->getDatabaseTablesPrefix(); - $data['mysql']['connect_timeout'] = $mySqlSettings['connect_timeout']; - $data['mysql']['wait_timeout'] = $mySqlSettings['wait_timeout']; + $data['mysql']['table_prefix'] = (bool)Mage::helper('M2ePro/Magento')->getDatabaseTablesPrefix(); + $data['mysql']['connect_timeout'] = (int)$mySqlSettings['connect_timeout']; + $data['mysql']['wait_timeout'] = (int)$mySqlSettings['wait_timeout']; } //######################################## @@ -129,7 +128,6 @@ protected function getMagentoRequestPart() $this->fillUpDataByMethod($data, 'appendMagentoSystemInfo'); - $this->fillUpDataByMethod($data, 'appendMagentoModulesInfo'); $this->fillUpDataByMethod($data, 'appendMagentoStoresInfo'); $this->fillUpDataByMethod($data, 'appendMagentoAttributesInfo'); @@ -149,17 +147,7 @@ protected function appendMagentoSystemInfo(&$data) $data['settings']['compilation'] = defined('COMPILER_INCLUDE_PATH'); $data['settings']['cache_backend'] = Mage::helper('M2ePro/Client_Cache')->getBackend(); $data['settings']['secret_key'] = Mage::helper('M2ePro/Magento')->isSecretKeyToUrl(); - } - - protected function appendMagentoModulesInfo(&$data) - { - foreach (Mage::getConfig()->getNode('modules')->asArray() as $module => $moduleData) { - $data['modules'][$module] = array( - 'name' => $module, - 'version' => isset($moduleData['version']) ? $moduleData['version'] : null, - 'status' => (isset($moduleData['active']) && $moduleData['active'] === 'true') - ); - } + $data['settings']['timezone'] = Mage::helper('M2ePro/Magento')->getTimeZone(); } protected function appendMagentoStoresInfo(&$data) @@ -404,13 +392,13 @@ protected function appendExtensionSettingsInfo(&$data) ); foreach ($logsTypes as $logType) { $settings['logs_clearing'][$logType] = array( - 'mode' => $conf->getGroupValue('/logs/clearing/'.$logType.'/', 'mode'), - 'days' => $conf->getGroupValue('/logs/clearing/'.$logType.'/', 'days') + 'mode' => (bool)$conf->getGroupValue('/logs/clearing/'.$logType.'/', 'mode'), + 'days' => (int)$conf->getGroupValue('/logs/clearing/'.$logType.'/', 'days') ); } foreach (Mage::helper('M2ePro/Component')->getComponents() as $component) { - $settings['channels'][$component]['enabled'] = $conf->getGroupValue('/component/'.$component.'/', 'mode'); + $settings['channels'][$component]['enabled'] = (bool)$conf->getGroupValue('/component/'.$component.'/', 'mode'); } $settings['config'] = $conf->getAllConfigData(); @@ -701,7 +689,7 @@ protected function appendExtensionListingsProductsInfo(&$data) } $data['listings_products'][$componentName]['products']['type'][$productType] = array( - 'amount' => Mage::getSingleton('core/resource')->getConnection('core_read')->fetchOne($select) + 'amount' => (int)Mage::getSingleton('core/resource')->getConnection('core_read')->fetchOne($select) ); } } diff --git a/app/code/community/Ess/M2ePro/composer.json b/app/code/community/Ess/M2ePro/composer.json index b868baf43..139d45fc9 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.21.0", + "version": "6.21.1", "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 d361a8252..53a1fc3de 100644 --- a/app/code/community/Ess/M2ePro/etc/config.xml +++ b/app/code/community/Ess/M2ePro/etc/config.xml @@ -2,7 +2,7 @@ - 6.21.0 + 6.21.1 diff --git a/app/code/community/Ess/M2ePro/sql/Install/Amazon.php b/app/code/community/Ess/M2ePro/sql/Install/Amazon.php index f4f7a2821..995a84788 100644 --- a/app/code/community/Ess/M2ePro/sql/Install/Amazon.php +++ b/app/code/community/Ess/M2ePro/sql/Install/Amazon.php @@ -766,12 +766,12 @@ public function execute() `regular_sale_price_end_date_mode` TINYINT(2) UNSIGNED NOT NULL, `regular_sale_price_end_date_value` DATETIME NOT NULL, `regular_sale_price_end_date_custom_attribute` VARCHAR(255) NOT NULL, - `regular_price_vat_percent` FLOAT UNSIGNED DEFAULT NULL, + `regular_price_vat_percent` DECIMAL(10,2) UNSIGNED DEFAULT NULL, `business_price_mode` TINYINT(2) UNSIGNED NOT NULL, `business_price_custom_attribute` VARCHAR(255) NOT NULL, `business_price_coefficient` VARCHAR(255) NOT NULL, `business_price_variation_mode` TINYINT(2) UNSIGNED NOT NULL, - `business_price_vat_percent` FLOAT UNSIGNED DEFAULT NULL, + `business_price_vat_percent` DECIMAL(10,2) UNSIGNED DEFAULT NULL, `business_discounts_mode` TINYINT(2) UNSIGNED NOT NULL, `business_discounts_tier_coefficient` VARCHAR(255) NOT NULL, `business_discounts_tier_customer_group_id` INT(11) UNSIGNED DEFAULT NULL, diff --git a/app/code/community/Ess/M2ePro/sql/Install/Ebay.php b/app/code/community/Ess/M2ePro/sql/Install/Ebay.php index 6581c184f..20e8f6f13 100644 --- a/app/code/community/Ess/M2ePro/sql/Install/Ebay.php +++ b/app/code/community/Ess/M2ePro/sql/Install/Ebay.php @@ -969,7 +969,7 @@ public function execute() `lot_size_custom_value` INT(11) UNSIGNED DEFAULT NULL, `lot_size_attribute` VARCHAR(255) DEFAULT NULL, `vat_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, - `vat_percent` FLOAT UNSIGNED NOT NULL DEFAULT 0, + `vat_percent` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT 0, `tax_table_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `tax_category_mode` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0, `tax_category_value` VARCHAR(255) NOT NULL, diff --git a/app/code/community/Ess/M2ePro/sql/Install/Walmart.php b/app/code/community/Ess/M2ePro/sql/Install/Walmart.php index f799bd739..ac0286ebf 100644 --- a/app/code/community/Ess/M2ePro/sql/Install/Walmart.php +++ b/app/code/community/Ess/M2ePro/sql/Install/Walmart.php @@ -504,7 +504,7 @@ public function execute() `map_price_custom_attribute` VARCHAR(255) NOT NULL, `price_coefficient` VARCHAR(255) NOT NULL, `price_variation_mode` TINYINT(2) UNSIGNED NOT NULL, - `price_vat_percent` FLOAT UNSIGNED DEFAULT NULL, + `price_vat_percent` DECIMAL(10,2) UNSIGNED DEFAULT NULL, `promotions_mode` TINYINT(2) NOT NULL DEFAULT 0, `lag_time_mode` TINYINT(2) UNSIGNED NOT NULL, `lag_time_value` INT(11) UNSIGNED NOT NULL, diff --git a/app/code/community/Ess/M2ePro/sql/Update/y22_m03/SetPrecisionInVatRateColumns.php b/app/code/community/Ess/M2ePro/sql/Update/y22_m03/SetPrecisionInVatRateColumns.php new file mode 100644 index 000000000..cb3f9e873 --- /dev/null +++ b/app/code/community/Ess/M2ePro/sql/Update/y22_m03/SetPrecisionInVatRateColumns.php @@ -0,0 +1,51 @@ +_installer->getTableModifier('ebay_template_selling_format') + ->changeColumn( + 'vat_percent', + 'decimal(10,2) unsigned not null', + '0', + null, + false + ) + ->commit(); + + $this->_installer->getTableModifier('amazon_template_selling_format') + ->changeColumn( + 'regular_price_vat_percent', + 'decimal(10,2) unsigned', + null, + null, + false + ) + ->changeColumn( + 'business_price_vat_percent', + 'decimal(10,2) unsigned', + null, + null, + false + ) + ->commit(); + + $this->_installer->getTableModifier('walmart_template_selling_format') + ->changeColumn( + 'price_vat_percent', + 'decimal(10,2) unsigned', + null, + null, + false + ) + ->commit(); + } + + //######################################## +} diff --git a/app/code/community/Ess/M2ePro/sql/Upgrade/v6_21_0__v6_21_1/Config.php b/app/code/community/Ess/M2ePro/sql/Upgrade/v6_21_0__v6_21_1/Config.php new file mode 100644 index 000000000..7d8faefe8 --- /dev/null +++ b/app/code/community/Ess/M2ePro/sql/Upgrade/v6_21_0__v6_21_1/Config.php @@ -0,0 +1,21 @@ + latestPublicVersion; ?> - latestPublicVersion); ?> " target="_blank">__('[release notes]'); ?> @@ -36,7 +35,6 @@ latestVersion; ?> - latestVersion); ?> " target="_blank">__('[release notes]'); ?> diff --git a/composer.json b/composer.json index b868baf43..139d45fc9 100644 --- a/composer.json +++ b/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.21.0", + "version": "6.21.1", "license": "proprietary", "keywords": ["ebay", "amazon", "walmart", "magento"], "homepage": "https://www.m2epro.com/",