Skip to content

Commit e757c78

Browse files
MC-17014: Cannot Save FPT (Fixed Product Tax) On Catalog Product For Specific Website
- Don't set global scope for FPT.
1 parent db9eaf1 commit e757c78

File tree

1 file changed

+26
-5
lines changed
  • app/code/Magento/Weee/Model/Attribute/Backend/Weee

1 file changed

+26
-5
lines changed

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

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Weee\Model\Attribute\Backend\Weee;
89

10+
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
911
use Magento\Framework\Exception\LocalizedException;
1012
use Magento\Catalog\Model\Attribute\ScopeOverriddenValue;
1113

14+
/**
15+
* Class with fixed product taxes.
16+
*/
1217
class Tax extends \Magento\Catalog\Model\Product\Attribute\Backend\Price
1318
{
1419
/**
@@ -62,6 +67,8 @@ public function __construct(
6267
}
6368

6469
/**
70+
* Get backend model name.
71+
*
6572
* @return string
6673
*/
6774
public static function getBackendModelName()
@@ -91,8 +98,10 @@ public function validate($object)
9198
$key1 = implode('-', [$tax['website_id'], $tax['country'], $state]);
9299
if (!empty($dup[$key1])) {
93100
throw new LocalizedException(
94-
__('Set unique country-state combinations within the same fixed product tax. '
95-
. 'Verify the combinations and try again.')
101+
__(
102+
'Set unique country-state combinations within the same fixed product tax. '
103+
. 'Verify the combinations and try again.'
104+
)
96105
);
97106
}
98107
$dup[$key1] = 1;
@@ -130,7 +139,7 @@ public function afterLoad($object)
130139
}
131140

132141
/**
133-
* {@inheritdoc}
142+
* @inheritdoc
134143
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
135144
* @SuppressWarnings(PHPMD.NPathComplexity)
136145
*/
@@ -170,7 +179,7 @@ public function afterSave($object)
170179
}
171180

172181
/**
173-
* {@inheritdoc}
182+
* @inheritdoc
174183
*/
175184
public function afterDelete($object)
176185
{
@@ -179,7 +188,7 @@ public function afterDelete($object)
179188
}
180189

181190
/**
182-
* {@inheritdoc}
191+
* @inheritdoc
183192
*/
184193
public function getTable()
185194
{
@@ -193,4 +202,16 @@ public function getEntityIdField()
193202
{
194203
return $this->_attributeTax->getIdFieldName();
195204
}
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+
}
196217
}

0 commit comments

Comments
 (0)