Skip to content

Commit 6e8867f

Browse files
committed
magento/magento2-page-builder#543: Content Product Attributes Default Sorting Order
- Refactoring
1 parent 374e86f commit 6e8867f

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

app/code/Magento/Catalog/Setup/Patch/Data/UpdateProductDescriptionOrder.php

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,21 @@ public function apply()
4747
{
4848
/** @var CategorySetup $categorySetup */
4949
$categorySetup = $this->categorySetupFactory->create(['setup' => $this->moduleDataSetup]);
50-
$attributeSetId = $categorySetup->getDefaultAttributeSetId(\Magento\Catalog\Model\Product::ENTITY);
50+
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
5151

5252
// Content
53-
$categorySetup->addAttributeGroup(
54-
\Magento\Catalog\Model\Product::ENTITY,
55-
$attributeSetId,
56-
'Content',
57-
15
58-
);
59-
$categorySetup->updateAttributeGroup(
60-
\Magento\Catalog\Model\Product::ENTITY,
61-
$attributeSetId,
62-
'Content',
63-
'tab_group_code',
64-
'basic'
65-
);
66-
$categorySetup->addAttributeToGroup(
67-
\Magento\Catalog\Model\Product::ENTITY,
68-
$attributeSetId,
69-
'Content',
53+
$categorySetup->updateAttribute(
54+
$entityTypeId,
7055
'short_description',
56+
'frontend_label',
57+
'Short Description',
7158
100
7259
);
73-
$categorySetup->addAttributeToGroup(
74-
\Magento\Catalog\Model\Product::ENTITY,
75-
$attributeSetId,
76-
'Content',
60+
$categorySetup->updateAttribute(
61+
$entityTypeId,
7762
'description',
63+
'frontend_label',
64+
'Description',
7865
110
7966
);
8067
}

0 commit comments

Comments
 (0)