Code to hide price, stock and add to cart button for a specific product by ID throughout the website

This topic has 10 replies, 3 voices, and was last updated 1 weeks, 1 days ago ago by Luca Rossi

  • Avatar: LVRB Love's Rebel
    LVRB
    Participant
    May 22, 2025 at 21:55

    Hello! I need a code to hide the price, stock and add to cart button throughout the website for certain specific products by ID.

    Please, contact administrator
    for this information.
    9 Answers
    Avatar: Alex Carter
    Alex Carter
    Support staff
    May 23, 2025 at 08:06

    Hello!

    Thank you for reaching out to us.

    To hide the price, stock, and Add to Cart button for specific products by their ID across your website, you can use the following custom CSS code:

    .postid-24732 .et_product-block > .price,
    .postid-24732 .stock,
    .postid-24732 .single-product-builder form.cart {
        display: none;
    }

    Best Regards,
    8Theme’s Team

    Content is visible for topic creator and
    support staff only.
    Avatar: LVRB Love's Rebel
    LVRB
    Participant
    May 23, 2025 at 23:09

    Hello! These codes only hide from single product but do not hide it from the store catalog.

    I need the code to hide all those specific product buttons throughout the site, as I want the only way they can order the product is through a private email.

    In the private area I leave access to the test site where I am testing the idea.

    It will be a specific product category that can only be purchased on demand, so all those buttons must be hidden.

    Content is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    May 25, 2025 at 16:34

    Dear @LVRB,

    We hope this message finds you well.

    Could you please add the following custom CSS code to your site?

    .postid-24732 .product-details .price,
    .postid-24732 .product-details .quantity-wrapper {
        display: none !important;
    }

    Kindly let us know once it has been implemented or if you encounter any issues.

    Best regards,
    The 8Theme Team

    Avatar: LVRB Love's Rebel
    LVRB
    Participant
    May 26, 2025 at 14:13

    Hello!
    The code has already been applied on the test website and does not hide the price, variations and add to cart of the specific product from the catalog.

    Please help me with the problem.

    Attached screenshot in private message.

    Content is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    May 26, 2025 at 16:53

    Dear @LVRB,

    We hope this message finds you well.

    We would like to inform you that the previous custom code contained an error. Our team has corrected the issue and updated the custom CSS on your website with the following code:

    
    .post-2911 .product-details .price,
    .post-2911 .product-details .quantity-wrapper,
    .post-2911 .product-details form.cart {
        display: none !important;
    }
    

    Could you please review the changes at your earliest convenience and let us know if everything is now working as expected?

    Thank you for your attention to this matter.

    Best regards,
    The 8Theme Team

    Avatar: LVRB Love's Rebel
    LVRB
    Participant
    May 26, 2025 at 19:28

    This code does work!

    Can you send me a code to hide the variation swatches in the catalog please?

    Thank you!

    Avatar: Justin
    Luca Rossi
    Support staff
    May 27, 2025 at 06:21

    Hi @LVRB,

    Please update the previous CSS code to this:

    
    .post-2911 .product-details .price,
    .post-2911 .product-details .quantity-wrapper,
    .post-2911 .product-details .st-swatch-in-loop,
    .post-2911 .product-details form.cart {
        display: none !important;
    }
    

    Hope it helps!

    Avatar: LVRB Love's Rebel
    LVRB
    Participant
    May 27, 2025 at 22:54

    THANKS!
    I need a code to hide sales booster item sold fake indicator for specific products please.

    Capture attached.

    🙂

    Content is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    May 28, 2025 at 06:27

    Hi @LVRB,

    The custom CSS code will look like this:

    
    body.postid-2806 p.sales-booster-total-sales {
        display: none !important;
    }
    

    Hope it helps!

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

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

Helpful Topics

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