Default All Product Custom Options to Store 0

Updated . Posted . Visible to the public.

If the custom options of a product are the same across stores, but somehow there are not defaulted to store 0, the method below will default all custom options to store 0:

admin > product page > Custom Options > Change to other store > F12 to bring up the dev tools > in console > run

$$('.product-option-scope-checkbox').each(function(e){e.checked=true;})

Or

$$('input[type="checkbox"]').each(function(e) {	e.checked = true; });

Then save. Repeat for other store views.

In DB, the entries in the product option tables should reduced.

Delete in DB

Warning: delete at your own risk!

This will delete all options in all stores except the default store 0.

DELETE FROM `catalog_product_option_title` WHERE store_id > 0;
DELETE FROM `catalog_product_option_price` WHERE store_id > 0;
DELETE FROM `catalog_product_option_type_title` WHERE store_id > 0;
DELETE FROM `catalog_product_option_type_price` WHERE store_id > 0;
kiatng
Last edit
kiatng
Posted by kiatng to OpenMage (2018-04-13 10:40)