Home Forums WoodMart support forum Add to cart button

Add to cart button

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #703985

    bortstas
    Participant

    Hello!

    1) How to replace the “Add to cart” button in the product catalog with “More details”. that is, replace not only the button, but also the functionality itself, after clicking, the product card should simply open
    2) In the product card itself, remove the add to cart button.

    Thanks for the help!

    #704038

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    In Theme Settings > Shop, you can enable “Catalog Mode”. This will hide all Add to Cart buttons, the cart widget, and cart/checkout pages, allowing you to showcase your products as an online catalog without the ability to make purchases.

    If you want to replace the Add to Cart button with a custom “More Details” button that links to the product page, this would require custom code or a plugin, as it’s not a built-in option in the theme.

    Best Regards,

    #704044

    bortstas
    Participant

    Hello,

    I want to replace the Add to Cart button with a custom “More Details” button that links to the product page.

    Can you give us an example of the user code, please?

    Best Regards.

    #704076

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Try to add the following code in the function.php for this.

    add_filter( 'woocommerce_loop_add_to_cart_link', 'custom_more_details_button', 10, 2 );
    function custom_more_details_button( $button, $product  ) {
        $button_text = __("More Details", "woocommerce");
        return '<a class="button" href="' . $product->get_permalink() . '">' . $button_text . '</a>';
    }

    Best Regards,

    #704105

    bortstas
    Participant

    Thanks, everything is working great!

    #704137

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    You’re Most Welcome!

    Feel free to write back anytime. If you need further assistance, we are always here to help you.

    If you have a minute, we’d truly appreciate your feedback — it helps us improve the product and shape future updates more effectively. We’d love your feedback on our theme: https://tally.so/r/w4l54k

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Add to cart button’ is closed to new replies.