Hi there
I will add a new filter in next version of the plugin, that will allow you to selectively hide Add to Wishlist button
The filter will be named yith_wcwl_show_add_to_wishlist
and you should be able to use it as follows:
if( ! function_exists( 'yith_wcwl_selectively_hide_add_to_wishlist' ) ) {
function yith_wcwl_selectively_hide_add_to_wishlist( $show ) {
/**
* @var $product \WC_Product
*/
global $product;
if ( $product instanceof WC_Product && has_term( 'tshirts-clothing', 'product_cat', $product->get_id() ) ) {
$show = false;
}
return $show;
}
add_filter( 'yith_wcwl_show_add_to_wishlist', 'yith_wcwl_selectively_hide_add_to_wishlist' );
}
In this example, I’m removing Add to Wishlist button from any product that has tshirts-clothing
category
Plese, note that this will properly work only when Add to Wishlist buttons are added by our plugin
If you want to test this change right now, download this file and upload it on your server under wp-content/plugins/yith-woocommerce-wishlist/includes, overwriting previous version
Plese, make sure to perform this test on a staging environment, to avoid causing any issue to your production site
-
This reply was modified 4 years, 9 months ago by YITHEMES.