File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
app/code/Magento/ConfigurableProduct/Setup/Patch/Data Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,26 @@ public function apply()
50
50
{
51
51
/** @var EavSetup $eavSetup */
52
52
$ eavSetup = $ this ->eavSetupFactory ->create (['setup ' => $ this ->moduleDataSetup ]);
53
- $ relatedProductTypes = explode (
54
- ', ' ,
55
- $ eavSetup ->getAttribute (\Magento \Catalog \Model \Product::ENTITY , 'manufacturer ' , 'apply_to ' )
56
- );
57
53
58
- if (!in_array (Configurable::TYPE_CODE , $ relatedProductTypes )) {
59
- $ relatedProductTypes [] = Configurable::TYPE_CODE ;
60
- $ eavSetup ->updateAttribute (
61
- \Magento \Catalog \Model \Product::ENTITY ,
62
- 'manufacturer ' ,
63
- 'apply_to ' ,
64
- implode (', ' , $ relatedProductTypes )
54
+ if ($ manufacturer = $ eavSetup ->getAttribute (
55
+ \Magento \Catalog \Model \Product::ENTITY ,
56
+ 'manufacturer ' ,
57
+ 'apply_to '
58
+ )) {
59
+ $ relatedProductTypes = explode (
60
+ ', ' ,
61
+ $ manufacturer
65
62
);
63
+
64
+ if (!in_array (Configurable::TYPE_CODE , $ relatedProductTypes )) {
65
+ $ relatedProductTypes [] = Configurable::TYPE_CODE ;
66
+ $ eavSetup ->updateAttribute (
67
+ \Magento \Catalog \Model \Product::ENTITY ,
68
+ 'manufacturer ' ,
69
+ 'apply_to ' ,
70
+ implode (', ' , $ relatedProductTypes )
71
+ );
72
+ }
66
73
}
67
74
}
68
75
You can’t perform that action at this time.
0 commit comments