Skip to content

Commit

Permalink
6.21.1 (FINAL RELEASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2epro committed Apr 5, 2022
1 parent 7c3b442 commit 9fd51ee
Show file tree
Hide file tree
Showing 17 changed files with 158 additions and 53 deletions.
11 changes: 9 additions & 2 deletions app/code/community/Ess/M2ePro/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
5 changes: 5 additions & 0 deletions app/code/community/Ess/M2ePro/Helper/Magento.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/Model/Ebay/Order/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
69 changes: 52 additions & 17 deletions app/code/community/Ess/M2ePro/Model/Resource/Ebay/Listing/Other.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <<<SQL
SELECT `ei`.`item_id`
FROM `{$ebayItemTable}` AS `ei`
INNER JOIN `{$ebayListingOtherTable}` AS `elo`
ON `ei`.`item_id` = `elo`.`item_id`
WHERE `ei`.`id` NOT IN (
SELECT `elp`.`ebay_item_id`
FROM `{$ebayListingProductTable}` AS `elp`
WHERE `elp`.`ebay_item_id` IS NOT NULL
)
SQL;

$listingOther->setChildObject($ebayListingOther);
$ebayListingOther->setParentObject($listingOther);
$itemIds[] = $ebayListingOther->getItemId();
$listingOtherIdsQuery = <<<SQL
SELECT `id`
FROM `{$listingOtherTable}`
WHERE `component_mode` = '{$componentName}'
SQL;

$listingOther->deleteInstance();
}
$ebayListingOtherIdsQuery = <<<SQL
SELECT `listing_other_id`
FROM `{$ebayListingOtherTable}`
SQL;

$tableName = Mage::helper('M2ePro/Module_Database_Structure')->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));
}
}

//########################################
}
28 changes: 8 additions & 20 deletions app/code/community/Ess/M2ePro/Model/Servicing/Task/Statistic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

//########################################
Expand All @@ -129,7 +128,6 @@ protected function getMagentoRequestPart()

$this->fillUpDataByMethod($data, 'appendMagentoSystemInfo');

$this->fillUpDataByMethod($data, 'appendMagentoModulesInfo');
$this->fillUpDataByMethod($data, 'appendMagentoStoresInfo');

$this->fillUpDataByMethod($data, 'appendMagentoAttributesInfo');
Expand All @@ -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)
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Ess_M2ePro>
<version>6.21.0</version>
<version>6.21.1</version>
</Ess_M2ePro>
</modules>
<default>
Expand Down
4 changes: 2 additions & 2 deletions app/code/community/Ess/M2ePro/sql/Install/Amazon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/sql/Install/Ebay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ess/M2ePro/sql/Install/Walmart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

// @codingStandardsIgnoreFile

class Ess_M2ePro_Sql_Update_y22_m03_SetPrecisionInVatRateColumns extends
Ess_M2ePro_Model_Upgrade_Feature_AbstractFeature
{
//########################################

public function execute()
{
$this->_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();
}

//########################################
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* @author M2E Pro Developers Team
* @copyright M2E LTD
* @license Commercial use is forbidden
*/

class Ess_M2ePro_Sql_Upgrade_v6_21_0__v6_21_1_Config extends Ess_M2ePro_Model_Upgrade_Feature_AbstractConfig
{
//########################################

public function getFeaturesList()
{
return array(
'@y22_m03/SetPrecisionInVatRateColumns'
);
}

//########################################
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<td class="value">
<label style="padding-right: 10px;"><?php echo Mage::helper('M2ePro')->__('Latest Public Version'); ?>: </label>
<?php echo $this->latestPublicVersion; ?>
<?php $versionForUrl = str_replace('.', '-', $this->latestPublicVersion); ?>
<a href="<?php echo Mage::helper('M2ePro/Module_Support')->getDocumentationUrl(null, "x/rNsVAg"); ?>" target="_blank"><?php echo Mage::helper('M2ePro')->__('[release notes]'); ?></a>
</td>
<?php endif; ?>
Expand All @@ -36,7 +35,6 @@
</td>
<td class="value">
<?php echo $this->latestVersion; ?>
<?php $versionForUrl = str_replace('.', '-', $this->latestVersion); ?>
<a href="<?php echo Mage::helper('M2ePro/Module_Support')->getDocumentationUrl(null, "x/rNsVAg"); ?>" target="_blank"><?php echo Mage::helper('M2ePro')->__('[release notes]'); ?></a>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down

0 comments on commit 9fd51ee

Please sign in to comment.