문제

I have many categories and instead of applying new settings to all categories one by one, i would like to know if this is possible to apply new settings to all categories at once?

Thanks!

도움이 되었습니까?

해결책

There is no way of doing this from the UI.
The way I usually do it, is to update the values in the database. It's not the recommended approach but it works.
Let's say you want to update the is_anchor attribute to '1' for all categories.

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

The query above should give you the is_anchor attribute. I the record that results I see that the attribute id is 51 (could be different for you). and the backend_type is int. This means that the values for the attribute are in the table catalog_category_entity_int.

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51 and parent_id <> 0;

This query will set the value 1 for the attribute is_anchor (id 51), for all the categories except the 'root of all roots', the category with parent = 0.
After I run the query, I reindex the flat categories and that's it.

다른 팁

I am not sure which settings you are changing in your category, but if it is on the list of options on this page, then using the Magento REST API is probably your best option.

First identify the attribute id of the is_anchor attribute:

SELECT * FROM eav_attribute where attribute_code = 'is_anchor';

we Get attribute id 51 in my database. Now run the following query

UPDATE catalog_category_entity_int set value = 1 where attribute_id = 51;

replace 51 with your own attribute id. And just rebuild these indexes

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top