change order of configuration options in customer product view

change order of configuration options in customer product view

QuestionsCategory: Magento 2change order of configuration options in customer product view
learnsomemore asked 5 years ago

I have configurable products with many attributes like size and color in v2.2.7.They are listed in the admin area and in Stores > Attributes > Attribute Set > Default. The order currently is “Size”, then “Color”. But on the customers view for the product, attributes are listed as “Color” and then “Size”.
=> https://magento.stackexchange.com/questions/261684/change-order-of-configuration-options-in-customer-product-view

1 Answers
Best Answer
Hidro Le Staff answered 5 years ago

The position of the attributes of Configurable Product stored at catalog_product_super_attribute
Use SQL to update position in PDP

192 = Id attribute Size
193 = Id Attribute Color
update catalog_product_super_attribute set position = 1 where attribute_id = 192 AND product_super_attribute_id <> 0;
update catalog_product_super_attribute set position = 2 where attribute_id = 193 AND product_super_attribute_id <> 0;

Where you can find attribute id => You can look up in the table named eav_attribute

select attribute_id from eav_attribute where attribute_code = '[attribute code]';