Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1291937

    contegi66
    Participant

    Hi Support,

    I found in previous thread the code you gave to remove “add to cart” button from all product pages

    .single-product .single_add_to_cart_button {
    display: none !important;
    }

    Now, could you tell me how to remove the button on specific product page? I suppose I have to add page ID #, right?

    Thank you in advance,

    Gianni

    #1292246

    Prasant Rai
    Moderator

    Hello Gianni,

    Thanks for writing in!

    You need to prefix page in above code. For example:

    .page-id-5002 .single-product .single_add_to_cart_button {
    display: none !important;
    }

    Please replace 5002 with the page id on which you don’t want to display add to cart button.

    Thanks.

    #1292941

    contegi66
    Participant

    Thanks a lot !

    #1292972

    Prasant Rai
    Moderator

    You are most welcome. 🙂

    #1293317

    contegi66
    Participant
    This reply has been marked as private.
    #1293693

    Rad
    Moderator

    Hi there,

    Please change the CSS to this

    .postid-12875.single-product .woocommerce .cart {
    
    display: none !important;
    
    } 

    Hope this helps.

    #1294723

    contegi66
    Participant

    Sorry Support but this is not working either.

    Cart is still in the product page.

    any other clue?

    Gianni

    #1294865

    Jade
    Moderator

    Hi Gianni,

    Please try this:

    .postid-12875.single-product.woocommerce .cart {
    
       display: none !important;
    
    } 

    Hope this helps.

    #1294954

    contegi66
    Participant

    Hi Jade, Support

    Nope it doesn’t work either. Add to cart button is still there

    to be sure that there is no issue related to this particular product, i tried other IDs # but add to cart still remain.

    Sounds weird but problematic…hope you will find a hook.

    Gianni

    #1295186

    Lely
    Moderator

    Hi Gianni,

    Please use this CSS instead:

    .postid-12875.woocommerce div.product form.cart .button {
        display: none;
    }
    .postid-12875.woocommerce div.product .product_meta {
        top: -27px !important;
    }

    See this implementation:http://screencast-o-matic.com/watch/cDlDn9QZfw

    Hope this helps.

    #1295937

    contegi66
    Participant

    Hi Lely, Support,

    I’ve added the code in custom css, then, followed your screencast but I do not have the same developer’s panel view than you.

    When I select <button type=”submit” class=”single_add_to_cart_button button alt”>Acquista</button> I do not have same code on the right panel that what is on screencast (see attachment 1&2)

    The only way I have to hide the button is to right-click on <button type=”submit” class=”single_add_to_cart_button button alt”>Acquista</button> and select “Hide element” but no way to save it (or at least I do not know how)

    Could you tell me how to fix this please?

    Cheers
    Gianni

    #1296023

    contegi66
    Participant

    Support,

    In fine I took out price for this product and obviously the add to cart disappeared but it will not be possible to do so in other similar products.

    I will need anyway a fix for future identical cases.

    Best,

    G

    #1296081

    Jade
    Moderator

    HI G,

    There must be some CSS conflict in the CSS code that is currently in the customizer that’s why the CSS provided to you weren’t working.

    Kindly provide your admin details so we can check.

    #1297720

    contegi66
    Participant
    This reply has been marked as private.
    #1297738

    Rue Nel
    Moderator
    This reply has been marked as private.