I want to set all of my Magento 2 categories to 'Use Config Settings' for the 'Default Product Listing Sort By' within the Category Display Settings.
I don't want to do this manually as there are thousands of them.
What SQL command do I need to run to achieve this?
Solved! Go to Solution.
Try this :
SELECT * FROM `catalog_category_entity_varchar` WHERE `attribute_id` = 68;
DELETE FROM `catalog_category_entity_varchar` WHERE `attribute_id` = 68;
Where, 68 is attribute_id of 'default_sort_by' in my case, you can find it using below query:
SELECT `attribute_code`,`attribute_id` FROM `eav_attribute` WHERE `attribute_code` = 'default_sort_by';
Try this :
SELECT * FROM `catalog_category_entity_varchar` WHERE `attribute_id` = 68;
DELETE FROM `catalog_category_entity_varchar` WHERE `attribute_id` = 68;
Where, 68 is attribute_id of 'default_sort_by' in my case, you can find it using below query:
SELECT `attribute_code`,`attribute_id` FROM `eav_attribute` WHERE `attribute_code` = 'default_sort_by';
Excellent. Thanks for that. I would never have found that.