fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Disable dropdown conversion to button for archive/shop pages

Eden Brownlee

Hi support team,

Is there a hook/filter that I can use to specifically disable the button conversion? https://prnt.sc/p5279Kw8GY8q

There is only a per product setting and global setting but I want to disable it on shop/archive pages as I’m creating a custom product loop but want it enabled for single product pages.

Please advise,
Thanks

Hakik Zaman

Hi Eden,

Thanks for reaching out to us. Do you want to display the dropdown on the shop/archive page?

Please try the following snippet:

add_filter('default_woo_variation_swatches_archive_product_dropdown_html', function($bol){
return true;
}, 10, 1);

Thank You

Eden Brownlee

Great! This is exactly what I needed. Thank you @hakik!

Eden Brownlee

Hey Hakik,

Follow up support question, what filter is used in this option?

https://prnt.sc/N302yROHs0bQ

As I want to disable the variation swatches on the shop/archive page when users are not logged-in.

Hakik Zaman

Hi Eden,

Follow up support question, what filter is used in this option?

If you disable this option, swatches will not display on the archive/shop page.

As I want to disable the variation swatches on the shop/archive page when users are not logged-in.

Unfortunately, it is beyond our support. Role base options are not available right now. You can code it yourself or you can send this feature request here: https://storepress.fider.io/

Thank You

Eden Brownlee

I just need the filter/hook triggering this setting – I’ll code the rest. can you help out? 🙂

Hakik Zaman

Hi Eden,

You can use this filter hook to achieve the functionality:

add_filter('disable_woo_variation_swatches_archive_product', function($default, $product){
if( //your condition to disable archive swatches for visitor/not logged in user ){
return true;
}
return $default;
}, 10, 2);

Thank You