Is there any way to enable the Product Hover feature globally on all products? I looked at the code that adds that image to the product info on the category template and it seems like it has to be enabled on a product-by-product basis. Is there any way (besides filtering get_post_metadata) to turn this feature on storewide? Ideally it would set the default on the Product Hover metabox to “Yes” and allow users to disable the feature product-by-product.
Thanks!
Hi Kevin!
A post meta needs to be set on a product-by-product basis. However, one thing you could do is use a save_post hook, something like this:
function on_product_save($post_id) {
update_post_meta($post_id, '_product_hover', 'hover_active');
}
add_action('save_post_product', 'on_product_save', 1, 100);
Best regards,
Josue