Skip to content

Commit 5481fac

Browse files
committed
Merge pull request #406 from magento-tango/MAGETWO-49914
[Tango] Bug fixes #2
2 parents b7dbda1 + 1c14dea commit 5481fac

File tree

25 files changed

+113
-670
lines changed

25 files changed

+113
-670
lines changed

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleSkuTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Bundle\Test\Unit\Ui\DataProvider\Product\Form\Modifier;
77

88
use Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundleSku;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
9+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
1010

1111
/**
1212
* Class BundleSkuTest
@@ -31,7 +31,7 @@ public function testModifyMeta()
3131
$sourceMeta = [
3232
'testGroup' => [
3333
'children' => [
34-
AttributeConstantsInterface::CODE_SKU => [
34+
ProductAttributeInterface::CODE_SKU => [
3535
'componentType' => 'testComponent',
3636
],
3737
]

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleAdvancedPricing.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface as Constants;
1010

1111
/**
1212
* Customize Advanced Pricing modal panel
@@ -32,13 +32,15 @@ public function modifyMeta(array $meta)
3232
unset($parentNode['container_' . self::CODE_MSRP]);
3333
unset($parentNode['container_' . self::CODE_MSRP_DISPLAY_ACTUAL_PRICE_TYPE]);
3434
}
35-
if (isset($parentNode['container_' . Constants::CODE_SPECIAL_PRICE])) {
36-
$currentNode = &$parentNode['container_' . Constants::CODE_SPECIAL_PRICE]['children'];
37-
$currentNode[Constants::CODE_SPECIAL_PRICE]['arguments']['data']['config']['addbefore'] = "%";
35+
if (isset($parentNode['container_' . ProductAttributeInterface::CODE_SPECIAL_PRICE])) {
36+
$currentNode = &$parentNode['container_' . ProductAttributeInterface::CODE_SPECIAL_PRICE]['children'];
37+
$currentNode[ProductAttributeInterface::CODE_SPECIAL_PRICE]['arguments']['data']['config']['addbefore']
38+
= "%";
3839
}
39-
$parentNodeChildren = &$parentNode[Constants::CODE_TIER_PRICE]['children'];
40-
if (isset( $parentNodeChildren[self::CODE_RECORD]['children'][Constants::CODE_PRICE])) {
41-
$currentNode = &$parentNodeChildren[self::CODE_RECORD]['children'][Constants::CODE_PRICE];
40+
$parentNodeChildren = &$parentNode[ProductAttributeInterface::CODE_TIER_PRICE]['children'];
41+
if (isset($parentNodeChildren[self::CODE_RECORD]['children'][ProductAttributeInterface::CODE_PRICE])) {
42+
$currentNode =
43+
&$parentNodeChildren[self::CODE_RECORD]['children'][ProductAttributeInterface::CODE_PRICE];
4244
$currentNode['arguments']['data']['config']['label'] = __('Percent Discount');
4345
}
4446
}

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
1010
use Magento\Ui\Component\Form;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212
use Magento\Catalog\Model\Locator\LocatorInterface;
@@ -49,11 +49,11 @@ public function __construct(
4949
*/
5050
public function modifyMeta(array $meta)
5151
{
52-
if ($groupCode = $this->getGroupCodeByField($meta, AttributeConstantsInterface::CODE_PRICE)
52+
if ($groupCode = $this->getGroupCodeByField($meta, ProductAttributeInterface::CODE_PRICE)
5353
?: $this->getGroupCodeByField($meta, self::CODE_GROUP_PRICE)
5454
) {
5555
$isNewProduct = ($this->locator->getProduct()->getId()) ? false : true;
56-
$pricePath = $this->getElementArrayPath($meta, AttributeConstantsInterface::CODE_PRICE)
56+
$pricePath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_PRICE)
5757
?: $this->getElementArrayPath($meta, self::CODE_GROUP_PRICE);
5858

5959
$meta[$groupCode]['children'][self::CODE_PRICE_TYPE] = [
@@ -91,7 +91,7 @@ public function modifyMeta(array $meta)
9191
$meta[$groupCode]['children'][self::CODE_GROUP_PRICE],
9292
[
9393
'children' => [
94-
AttributeConstantsInterface::CODE_PRICE => [
94+
ProductAttributeInterface::CODE_PRICE => [
9595
'arguments' => [
9696
'data' => [
9797
'config' => [

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleSku.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
1010
use Magento\Ui\Component\Form;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212

@@ -36,15 +36,15 @@ public function __construct(ArrayManager $arrayManager)
3636
*/
3737
public function modifyMeta(array $meta)
3838
{
39-
if ($groupCode = $this->getGroupCodeByField($meta, AttributeConstantsInterface::CODE_SKU)) {
40-
$skuPath = $this->getElementArrayPath($meta, AttributeConstantsInterface::CODE_SKU);
39+
if ($groupCode = $this->getGroupCodeByField($meta, ProductAttributeInterface::CODE_SKU)) {
40+
$skuPath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_SKU);
4141
$meta[$groupCode]['children'][self::CODE_SKU_TYPE] = [
4242
'arguments' => [
4343
'data' => [
4444
'config' => [
4545
'sortOrder' => $this->getNextAttributeSortOrder(
4646
$meta,
47-
[AttributeConstantsInterface::CODE_SKU],
47+
[ProductAttributeInterface::CODE_SKU],
4848
self::SORT_ORDER
4949
),
5050
'formElement' => Form\Element\Checkbox::NAME,

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleWeight.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
1010
use Magento\Ui\Component\Form;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212

@@ -37,10 +37,10 @@ public function __construct(ArrayManager $arrayManager)
3737
*/
3838
public function modifyMeta(array $meta)
3939
{
40-
if (($groupCode = $this->getGroupCodeByField($meta, AttributeConstantsInterface::CODE_WEIGHT)
40+
if (($groupCode = $this->getGroupCodeByField($meta, ProductAttributeInterface::CODE_WEIGHT)
4141
?: $this->getGroupCodeByField($meta, self::CODE_CONTAINER_WEIGHT))
4242
) {
43-
$weightPath = $this->getElementArrayPath($meta, AttributeConstantsInterface::CODE_WEIGHT)
43+
$weightPath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_WEIGHT)
4444
?: $this->getElementArrayPath($meta, self::CODE_CONTAINER_WEIGHT);
4545
$meta[$groupCode]['children'][self::CODE_WEIGHT_TYPE] = [
4646
'arguments' => [
@@ -76,7 +76,7 @@ public function modifyMeta(array $meta)
7676
$meta[$groupCode]['children'][self::CODE_CONTAINER_WEIGHT],
7777
[
7878
'children' => [
79-
AttributeConstantsInterface::CODE_HAS_WEIGHT => [
79+
ProductAttributeInterface::CODE_HAS_WEIGHT => [
8080
'arguments' => [
8181
'data' => [
8282
'config' => [
@@ -93,7 +93,7 @@ public function modifyMeta(array $meta)
9393
$meta[$groupCode]['children'][self::CODE_CONTAINER_WEIGHT],
9494
[
9595
'children' => [
96-
AttributeConstantsInterface::CODE_WEIGHT => [
96+
ProductAttributeInterface::CODE_WEIGHT => [
9797
'arguments' => [
9898
'data' => [
9999
'config' => [

app/code/Magento/Catalog/Api/Data/ProductAttributeInterface.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,21 @@
1212
interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
1313
{
1414
const ENTITY_TYPE_CODE = 'catalog_product';
15+
const CODE_TIER_PRICE_FIELD_PRICE = 'price';
16+
const CODE_HAS_WEIGHT = 'product_has_weight';
17+
const CODE_SPECIAL_PRICE = 'special_price';
18+
const CODE_PRICE = 'price';
19+
const CODE_TIER_PRICE_FIELD_PRICE_QTY = 'price_qty';
20+
const CODE_SHORT_DESCRIPTION = 'short_description';
21+
const CODE_SEO_FIELD_META_TITLE = 'meta_title';
22+
const CODE_STATUS = 'status';
23+
const CODE_NAME = 'name';
24+
const CODE_SKU = 'sku';
25+
const CODE_SEO_FIELD_META_KEYWORD = 'meta_keyword';
26+
const CODE_DESCRIPTION = 'description';
27+
const CODE_COST = 'cost';
28+
const CODE_SEO_FIELD_URL_KEY = 'url_key';
29+
const CODE_TIER_PRICE = 'tier_price';
30+
const CODE_SEO_FIELD_META_DESCRIPTION = 'meta_description';
31+
const CODE_WEIGHT = 'weight';
1532
}

app/code/Magento/Catalog/Model/AttributeConstantsInterface.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)