Skip to content

Commit

Permalink
6.43.5 (FINAL RELEASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2epro committed Aug 3, 2023
1 parent ee07916 commit 985f760
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,13 @@ protected function validateVariationsOptions()
/** @var Ess_M2ePro_Model_Resource_Listing_Product_Variation_Collection $collection */
$collection = $listingProduct->getResourceCollection();
$collection->getSelect()->reset(\Zend_Db_Select::COLUMNS);
$collection->getSelect()->columns(array(
'count_deleted' => new \Zend_Db_Expr('SUM(IF(second_table.`delete`, 1, 0))'),
));
$collection->getSelect()->joinLeft(
array('vo' => $variationOptionResource->getMainTable()),
'vo.listing_product_variation_id = main_table.id',
array(
'attribute_name' => 'vo.attribute',
'count_options' => new \Zend_Db_Expr('COUNT(DISTINCT IF(second_table.`delete`, NULL, vo.`option`))')
'count_variation_options'
=> new \Zend_Db_Expr('COUNT(DISTINCT IF(second_table.`delete`, NULL, vo.`option`))')
)
);
$collection->getSelect()->group('vo.attribute');
Expand All @@ -377,14 +375,33 @@ protected function validateVariationsOptions()
return false;
}

$totalVariationsCount = 1;
$totalDeletedVariationsCount = 0;
// All options deleted
$totalVariationOptions = 0;
foreach ($data as $item) {
$totalVariationsCount *= $item['count_options'];
$totalDeletedVariationsCount += $item['count_deleted'];
$totalVariationOptions += $item['count_variation_options'];
}

if ($totalVariationOptions === 0) {
$this->addMessage(
'This Product was listed to eBay as Variational Item.
Changing of the Item type from Variational to Non-Variational during Revise/Relist
actions is restricted by eBay.
At the moment this Product is considered as Simple without any Variations,
that does not allow updating eBay Variational Item.'
);
return false;
}

$totalOptionsCount = 1;
foreach ($data as $item) {
if ((int)$item['count_variation_options'] === 0) {
continue;
}

$totalOptionsCount *= $item['count_variation_options'];
// Maximum 60 options by one attribute:
// Color: Red, Blue, Green, ...
if ($item['count_options'] > 60) {
if ($item['count_variation_options'] > 60) {
$this->addMessage(
'Variations of this Magento Product are out of the eBay Variational Item limits.
Its number of Options for some Variational Attribute(s) is more than 60.
Expand All @@ -394,8 +411,8 @@ protected function validateVariationsOptions()
return false;
}

// Not more that 250 possible variations
if ($totalVariationsCount > 250) {
// Not more than 250 possible variations
if ($totalOptionsCount > 250) {
$this->addMessage(
'Variations of this Magento Product are out of the eBay Variational Item limits.
The Number of Variations is more than 250. That is why, this Product cannot be updated on eBay.
Expand All @@ -405,17 +422,6 @@ protected function validateVariationsOptions()
}
}

if ($totalVariationsCount == $totalDeletedVariationsCount) {
$this->addMessage(
'This Product was listed to eBay as Variational Item.
Changing of the Item type from Variational to Non-Variational during Revise/Relist
actions is restricted by eBay.
At the moment this Product is considered as Simple without any Variations,
that does not allow updating eBay Variational Item.'
);
return false;
}

return true;
}

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.43.4",
"version": "6.43.5",
"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.43.4</version>
<version>6.43.5</version>
</Ess_M2ePro>
</modules>
<default>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

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

class Ess_M2ePro_Sql_Upgrade_v6_43_4__v6_43_5_Config extends Ess_M2ePro_Model_Upgrade_Feature_AbstractConfig
{
public function getFeaturesList()
{
return array();
}
}
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.43.4",
"version": "6.43.5",
"license": "proprietary",
"keywords": ["ebay", "amazon", "walmart", "magento"],
"homepage": "https://www.m2epro.com/",
Expand Down

0 comments on commit 985f760

Please sign in to comment.