Skip to content

Commit 62ffdd3

Browse files
committed
Merge branch 'MC-17014' of git.epam.com:magn-m23/magn-m23 into MC-17014
2 parents 07dcbc3 + b788491 commit 62ffdd3

File tree

2 files changed

+16
-14
lines changed
  • app/code/Magento/Weee
    • Model/Attribute/Backend/Weee
    • Ui/DataProvider/Product/Form/Modifier/Manager

2 files changed

+16
-14
lines changed

app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace Magento\Weee\Model\Attribute\Backend\Weee;
99

10-
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
1110
use Magento\Framework\Exception\LocalizedException;
1211
use Magento\Catalog\Model\Attribute\ScopeOverriddenValue;
1312

@@ -70,9 +69,11 @@ public function __construct(
7069
* Get backend model name.
7170
*
7271
* @return string
72+
* phpcs:disable Magento2.Functions.StaticFunction
7373
*/
7474
public static function getBackendModelName()
7575
{
76+
// phpcs:enable Magento2.Functions.StaticFunction
7677
return \Magento\Weee\Model\Attribute\Backend\Weee\Tax::class;
7778
}
7879

@@ -202,16 +203,4 @@ public function getEntityIdField()
202203
{
203204
return $this->_attributeTax->getIdFieldName();
204205
}
205-
206-
/**
207-
* Don't need to change scope for tax.
208-
*
209-
* @param Attribute $attribute
210-
* @return $this
211-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
212-
*/
213-
public function setScope($attribute)
214-
{
215-
return $this;
216-
}
217206
}

app/code/Magento/Weee/Ui/DataProvider/Product/Form/Modifier/Manager/Website.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Weee\Ui\DataProvider\Product\Form\Modifier\Manager;
79

810
use Magento\Catalog\Api\Data\ProductInterface;
@@ -12,6 +14,8 @@
1214
use Magento\Directory\Model\Currency;
1315
use Magento\Store\Api\Data\WebsiteInterface;
1416
use Magento\Store\Model\StoreManagerInterface;
17+
use Magento\Catalog\Helper\Data;
18+
use Magento\Framework\App\ObjectManager;
1519

1620
/**
1721
* Class Website
@@ -23,19 +27,27 @@ class Website
2327
*/
2428
private $websites;
2529

30+
/**
31+
* @var Data
32+
*/
33+
private $catalogHelper;
34+
2635
/**
2736
* @param LocatorInterface $locator
2837
* @param StoreManagerInterface $storeManager
2938
* @param DirectoryHelper $directoryHelper
39+
* @param Data|null $catalogHelper
3040
*/
3141
public function __construct(
3242
LocatorInterface $locator,
3343
StoreManagerInterface $storeManager,
34-
DirectoryHelper $directoryHelper
44+
DirectoryHelper $directoryHelper,
45+
Data $catalogHelper = null
3546
) {
3647
$this->locator = $locator;
3748
$this->storeManager = $storeManager;
3849
$this->directoryHelper = $directoryHelper;
50+
$this->catalogHelper = $catalogHelper ?: ObjectManager::getInstance()->get(Data::class);
3951
}
4052

4153
/**
@@ -60,6 +72,7 @@ public function getWebsites(ProductInterface $product, EavAttribute $eavAttribut
6072

6173
if ($this->storeManager->hasSingleStore()
6274
|| ($eavAttribute->getEntityAttribute() && $eavAttribute->getEntityAttribute()->isScopeGlobal()
75+
|| $this->catalogHelper->isPriceGlobal()
6376
)
6477
) {
6578
return $this->websites = $websites;

0 commit comments

Comments
 (0)