fbpx
Enjoy Year-End Sale: 50% Off All Plugins! Coupon Code: NewYear2025

Flatsome incompatibility

Stefan Badii

No matter what I select for the variation swatches inside the options page while using flatsome child theme it always show bellow the select options / buy button:
I even added this to a custom plugin:
The only thing that this does is to add two swatches bellow the buy button.

add_action('flatsome_product_box_after', function(){
if ( function_exists( 'woo_variation_swatches' ) ){
woo_variation_swatches()->show_archive_page_swatches();
}
});

 

 

 

Stefan Badii

For anyone interested, this is how I managed to solve it:

add_action(‘woo_variation_swatches_pro_archive_page_loaded’, function($wvs_pro){
// Remove the original action
remove_action(‘woocommerce_init’, array($wvs_pro, ‘enable_swatches’), 1);

// Add the Flatsome-specific action
add_action(‘woocommerce_before_shop_loop_item_title’, function() use ($wvs_pro) {
if (function_exists(‘woo_variation_swatches’)) {
woo_variation_swatches()->show_archive_page_swatches();
}
});
}, 10, 1);

 

This shows it right bellow the image. You can change this woocommerce_before_shop_loop_item_title to something else like : woocommerce_shop_loop_item_title, woocommerce_after_shop_loop_item_title or other woocommerce hooks.

Golam Kibria

Hi Stefan,

We apologize for the inconvenience and the delayed response (it was our holiday).

Thanks a lot for sharing the snippet (hopefully, it will be helpful for other users with the same goal).

We get excited & honored when you use our plugin on your site.

If you find our plugin helpful, could you leave your valuable review here: https://wordpress.org/support/plugin/woo-variation-swatches/reviews/?filter=5

Your rating keeps us inspired.

Is there anything else we can do for you?

Thank You