Skip to content

Commit

Permalink
1.62.2 (FINAL RELEASE)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2epro committed Jun 21, 2024
1 parent 2021ca1 commit 4a0659f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 13 deletions.
21 changes: 16 additions & 5 deletions Controller/Adminhtml/Amazon/Account/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class Save extends \Ess\M2ePro\Controller\Adminhtml\Amazon\Account
{
/** @var \Ess\M2ePro\Helper\Magento */
private $magentoHelper;
/** @var \Ess\M2ePro\Model\Amazon\Account\Builder */
private $accountBuilder;
/** @var \Ess\M2ePro\Helper\Module\Wizard */
Expand All @@ -20,6 +22,7 @@ class Save extends \Ess\M2ePro\Controller\Adminhtml\Amazon\Account
private $accountMerchantSettingsCreateService;

public function __construct(
\Ess\M2ePro\Helper\Magento $magentoHelper,
\Ess\M2ePro\Model\Amazon\Account\Builder $accountBuilder,
\Ess\M2ePro\Model\Amazon\Account\MerchantSetting\CreateService $accountMerchantSettingsCreateService,
\Ess\M2ePro\Helper\Module\Wizard $helperWizard,
Expand All @@ -31,6 +34,7 @@ public function __construct(
) {
parent::__construct($amazonFactory, $context);

$this->magentoHelper = $magentoHelper;
$this->accountBuilder = $accountBuilder;
$this->helperWizard = $helperWizard;
$this->helperData = $helperData;
Expand Down Expand Up @@ -102,10 +106,17 @@ private function updateAccount(\Ess\M2ePro\Model\Account $account, array $data):
{
$this->accountBuilder->build($account, $data);

$this->accountMerchantSettingsCreateService->update(
$account->getChildObject(),
(bool)$data[FbaInventoryForm::FORM_KEY_FBA_INVENTORY_MODE],
$data[FbaInventoryForm::FORM_KEY_FBA_INVENTORY_SOURCE_NAME] ?? null
);
if ($this->magentoHelper->isMSISupportingVersion()) {
$this->accountMerchantSettingsCreateService->update(
$account->getChildObject(),
(bool)$data[FbaInventoryForm::FORM_KEY_FBA_INVENTORY_MODE],
$data[FbaInventoryForm::FORM_KEY_FBA_INVENTORY_SOURCE_NAME] ?? null
);
} else {
$this->accountMerchantSettingsCreateService->update(
$account->getChildObject(),
false
);
}
}
}
7 changes: 4 additions & 3 deletions Model/Amazon/Account/MerchantSetting/CreateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ public function createDefault(
public function update(
\Ess\M2ePro\Model\Amazon\Account $amazonAccount,
bool $isManageFbaInventory,
?string $inventorySourceName
string $inventorySourceName = null
): \Ess\M2ePro\Model\Amazon\Account\MerchantSetting {
$settings = $this->createDefault($amazonAccount);
if ($isManageFbaInventory) {
$settings->enableManageFbaInventory((string)$inventorySourceName);

if ($isManageFbaInventory && $inventorySourceName !== null) {
$settings->enableManageFbaInventory($inventorySourceName);
} else {
$settings->disableManageFbaInventorySource();
}
Expand Down
1 change: 1 addition & 0 deletions Model/Setup/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class Upgrader
'1.60.0' => ['1.61.0'],
'1.61.0' => ['1.62.0'],
'1.62.0' => ['1.62.1'],
'1.62.1' => ['1.62.2'],
];

//########################################
Expand Down
13 changes: 13 additions & 0 deletions Setup/Upgrade/v1_62_1__v1_62_2/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Ess\M2ePro\Setup\Upgrade\v1_62_1__v1_62_2;

use Ess\M2ePro\Model\Setup\Upgrade\Entity\AbstractConfig;

class Config extends AbstractConfig
{
public function getFeaturesList(): array
{
return [];
}
}
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": "m2e/ebay-amazon-magento2",
"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": "magento2-module",
"version": "1.62.1",
"version": "1.62.2",
"license": "proprietary",
"keywords": ["ebay", "amazon", "walmart", "magento"],
"homepage": "https://m2epro.com/",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">

<module name="Ess_M2ePro" setup_version="1.62.1">
<module name="Ess_M2ePro" setup_version="1.62.2">
<sequence>
<module name="Magento_Backend" />
<module name="Magento_Catalog" />
Expand Down
9 changes: 6 additions & 3 deletions view/adminhtml/web/js/Amazon/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,12 @@ define([
$('magento_orders_status_mapping_mode').observe('change', AmazonAccountObj.magentoOrdersStatusMappingModeChange);

// tab fbaInventory
$('fba_inventory_mode')
.observe('change', AmazonAccountObj.fbaInventoryModeChange)
.simulate('change')
const $fbaInventoryMode = $('fba_inventory_mode');
if ($fbaInventoryMode) {
$fbaInventoryMode
.observe('change', AmazonAccountObj.fbaInventoryModeChange)
.simulate('change')
}
},

// ---------------------------------------
Expand Down

0 comments on commit 4a0659f

Please sign in to comment.