Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1239065
    RocktheHouse1876
    Participant

    Our website is using the Integrity theme with WooCommerce shopping cart.

    I would like to add a button “Add to Cart” on a page, when user clicks, it will go to shopping cart page with that product added. (The WooCommerce product pages are so limited in design, so we would like to go this route.)

    This is the “Add to Cart” button code I used below (though I don’t know if this is what it should be), but when clicked – nothing happens.

    <button type=”submit” class=”single_add_to_cart_button button alt”>Add to cart</button>

    Would you be able to point me in the right direction?

    Would you be able to help?

    #1239067
    RocktheHouse1876
    Participant
    This reply has been marked as private.
    #1239137
    Thai
    Moderator

    Hi There,

    Please try with this shortcode:

    [add_to_cart class="x-btn" id="56"]

    The 56 number is your product ID.

    Hope it helps 🙂

    #1239759
    RocktheHouse1876
    Participant

    When I add a “Raw Content” block, and insert this code below in it, nothing appears:
    [add_to_cart class=”x-btn” id=”56″]

    I think I must be going about it the wrong way?

    Also, how did you find the product ID #?

    #1240327
    Christopher
    Moderator

    Hi there,

    All your products are private, please publish them, add shortcode and check the result.

    Hope it helps.

    #1241273
    RocktheHouse1876
    Participant

    As mentioned above in the second comment, I would like to add the “add to cart” button to a regular X theme page, not on a Woocommerce product page. The page mentioned above is a public page.

    When I add a “Raw Content” block, and insert this code below in it, nothing appears:
    [add_to_cart class=”x-btn” id=”56″]

    Would someone be able to help? It would be greatly appreciated!

    #1241728
    Rue Nel
    Moderator
    This reply has been marked as private.
    #1242518
    RocktheHouse1876
    Participant

    Thank you so much! I appreciate your help!

    Would there be a way to remove the price altogether from inside the button?

    #1242597
    Rupok
    Member

    Hi there,

    In that case you can add this under Custom > CSS in the Customizer.

    .add_to_cart_inline.x-btn .woocommerce-Price-amount.amount {
      display: none;
    }

    Cheers!

    #1242837
    RocktheHouse1876
    Participant

    Thank you for all your help!

    #1242900
    Joao
    Moderator

    You are welcome,

    Joao

  • <script> jQuery(function($){ $("#no-reply-1239065 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>