• Resolved pothound

    (@pothound)


    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)
  • Plugin Support mouli a11n

    (@mouli)

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thread Starter pothound

    (@pothound)

    Hey @mouli thanks for leaving it open! It really is strange that it works perfect with the exception of the ‘first’ product used in the short code.
    Tried removing the CSS ‘first’ but that did not do the trick either.

    Plugin Support Thu P. a11n

    (@thup90)

    Hi there,

    As suggested, please try to post to one of the pages we mentioned in the previous reply to get further help with custom code.

    I’m going to mark this as resolved for now – if you have any further questions, you can start a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove link on product if shortcode is used’ is closed to new replies.