Hide add to cart / buy now buttons for specific products

This topic has 7 replies, 2 voices, and was last updated 1 weeks, 4 days ago ago by Luca Rossi

  • Avatar: HUSSTLE
    HUSSTLE
    Participant
    April 16, 2024 at 17:12

    is there CSS or PHP snippet that be shared to hide (remove) the add to cart and buy now buttons but keep the “Add To Quote” from specific product pages?

    Content is visible for topic creator and
    support staff only.
    6 Answers
    Avatar: HUSSTLE
    HUSSTLE
    Participant
    April 16, 2024 at 17:15

    update

    Content is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    April 17, 2024 at 05:04

    Dear HUSSTLE,

    We hope this message finds you well.

    We would like to provide you with a solution to selectively hide the “Add to Cart” and “Buy Now” buttons for certain products on your website. Please implement the following custom CSS code to achieve the desired effect:

    
    .single-product.postid-2299 form.cart .woocommerce-variation-add-to-cart,
    .single-product.postid-2299 form.cart table.variations {
        display: none !important;
    }
    

    This code should be inserted into your site’s custom CSS section. If you require any further assistance or have additional questions, please do not hesitate to reach out.

    Warm regards,
    The 8Theme Team

    Avatar: HUSSTLE
    HUSSTLE
    Participant
    April 17, 2024 at 14:08

    update #2

    Content is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    April 17, 2024 at 15:38

    Hi @HUSSTLE,

    In this case, pleaase delete the previous CSS code and add this custom CSS code instead:

    
    div#wc-stripe-payment-request-wrapper,
    .single-product.postid-2299 form.cart table.variations,
    .single-product.postid-2299 form.cart .woocommerce-variation-add-to-cart .single_add_to_cart_button {
        display: none !important;
    }
    

    https://prnt.sc/j–fWthDyEVb

    Let us know how it goes!

    Avatar: HUSSTLE
    HUSSTLE
    Participant
    April 17, 2024 at 16:06

    ability to remove add to cart and buy now, while keeping add to quote worked perfectly. THANKS!

    Avatar: Justin
    Luca Rossi
    Support staff
    April 18, 2024 at 04:47

    Dear @HUSSTLE,

    We are pleased to confirm our assistance.

    Best regards,
    The 8Theme Team

  • Viewing 7 results - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.