[Support request] How to disable the Bid now and Add to Cart Buttons on the Wocommerce Shop Page?

Home Forums Support [Support request] How to disable the Bid now and Add to Cart Buttons on the Wocommerce Shop Page?

Home Forums Support How to disable the Bid now and Add to Cart Buttons on the Wocommerce Shop Page?

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #1051171
    bluebit

    On my homepage which also is the woocommerce shop page, how can I remove or disable the bid now and add to cart buttons?

    #1051383
    David
    Staff
    Customer Support

    Hi there,

    you can add this PHP snippet:

    add_action( 'after_setup_theme', function() {
        remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
    } );

    https://docs.generatepress.com/article/adding-php/

    #1051393
    bluebit

    i added the snippet and its not working

    #1051401
    David
    Staff
    Customer Support

    Where did you add the snippet ?

    #1051408
    bluebit

    to a plugin called custom snippets

    #1051415
    David
    Staff
    Customer Support

    Odd – i edited the code above – try that instead.

    #1051428
    bluebit

    hmm doesn’t work either

    #1051431
    David
    Staff
    Customer Support

    Are you using any extra woo plugins ? They may be messing with the add to cart function.

    #1051453
    bluebit

    I’m using an auction plugin, maybe that is doing something, this one: https://ignitewoo.com/woocommerce-extensions-plugins-themes/woocommerce-auctions/

    #1051454
    David
    Staff
    Customer Support

    Well its doing something alright – if you disable that plugin temporarily does the code then work ? Least then we can pin down where the issue is

    #1051555
    bluebit

    yes deactivating the plugin temporarily makes it work, so what do I do now, because i need it to work with the plugin activated

    #1051646
    David
    Staff
    Customer Support

    You would need to ask the plugin author as they provide no documentation and without the plugin i can’t see what function they are calling.

    If they’re unhelpful then you can install the Simply Show Hooks plugin. Visit the archive page and activate it from the Admin Bar you should be able to see the Hook name ( same as above ) and when hovered over the list of functions it calls. With that info we may be able to help

    #1052593
    bluebit

    the plugin author is super slow in responding, i installed the Simple Show Hooks plugin and can see https://imgur.com/a/o6WQKhB

    #1052692
    David
    Staff
    Customer Support

    Not sure but try:

    add_action( 'after_setup_theme', function() {
        remove_action( 'woocommerce_after_shop_loop_item', array( 'IgniteWoo_Auctions', 'loop_add_to_cart'),10);
    } );
    #1052756
    bluebit

    that didnt work, i think maybe its the ignitewoo add to cart loop that you can see in the screenshot, maybe its possible to disable that or to give it less priority?

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.