Override woocommerce/product-image image class
-
We have
function add_custom_class__product_collection_images($block_content) { if (is_front_page() && strpos($block_content, 'wc-block-grid__product-image') !== false) { // Simple string replacement $block_content = str_replace('wc-block-grid__product-image', 'wc-block-grid__product-image hover:grow hover:shadow-lg', $block_content); } // Returns altered $block_content to be rendered return $block_content; } // Add filter to 'woocommerce/product-image' block add_filter('woocommerce/product-image', 'add_custom_class__product_collection_images');
to override Woo Product Collections block images , but it is not working. Any ideas what we are missing?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Override woocommerce/product-image image class’ is closed to new replies.