Remove link on product if shortcode is used
-
Hey Everybody
I just would like to remove links/thumbnails if a certain category/tag is used.Thumbnails removed: success
Links removed: partly
It seems that the FIRST product has a css called ‘first’ and hence this function does not work:
add_action( ‘woocommerce_before_shop_loop_item’, ‘link_single_tag_slug’ );
function link_single_tag_slug() {
if ( has_term( ‘stc’, ‘product_tag’ ) ) {
remove_action( ‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’, 10 );
remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_product_link_close’, 5 );
}
}Anyone any idea?
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Remove link on product if shortcode is used’ is closed to new replies.