Home › Forums › WoodMart support forum › Change add to cart with view product
Change add to cart with view product
- This topic has 7 replies, 3 voices, and was last updated 4 years, 6 months ago by Elise Noromit.
-
AuthorPosts
-
March 9, 2020 at 3:16 pm #178836
netart.grParticipantHello there.
Is it possible to disable add to cart button on product category page?
I want user to go into product page, choose some product options and then and only then to press the “add to cart” button.Also, it would be great if instead of “add to cart” there was a “view product” button.
https://imgur.com/SN95VEpMarch 9, 2020 at 8:45 pm #178870
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Global:
.product-grid-item .woodmart-add-btn{ display:none; }
Best Regards
March 10, 2020 at 7:45 am #178931
netart.grParticipantOk, any way to replace “add to cart” button on category page with “view product” button?
I think this is a MUST and very useful feature for all us that want user to visit product page and only then be able to add to cart…
March 10, 2020 at 8:03 am #178943
Elise NoromitMemberHello,
You can rewrite all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you rewrite your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
Best Regards
March 10, 2020 at 8:08 am #178948
netart.grParticipantOK, but I don’t want only text replacement. I want to change button’s url and functionality.
ON CLICK -> GO TO PRODUCT
NOT
ON CLICK -> ADD TO CARTMarch 10, 2020 at 9:18 am #178966
Elise NoromitMemberHello,
Woocommerce does not provide such an option. You will have to customize Woocommerce. Woocommerce customization is not covered by our support.
Best Regards
April 26, 2020 at 10:34 am #190039
WebKonstParticipantCode goes in function.php file of your active child theme (or theme).
// Replace add to cart button by a linked button to the product in Shop and archives pages add_filter( 'woocommerce_loop_add_to_cart_link', 'replace_loop_add_to_cart_button', 10, 2 ); function replace_loop_add_to_cart_button( $button, $product ) { // Not needed for variable products if( $product->is_type( 'variable' ) ) return $button; // Button text here $button_text = __( "View product", "woocommerce" ); return '<a class="button" href="' . $product->get_permalink() . '">' . $button_text . '</a>'; }
April 26, 2020 at 6:18 pm #190082
Elise NoromitMemberHello,
You can try the code suggested. Please note: we have not tested and do not guarantee this code is correct. If you decide to apply, add the code to the functions.php of the child theme as it would be deleted in the nearest update of the theme if you add into functions.php of the parent theme.
Best Regards
-
AuthorPosts
Tagged: add to cart button
- You must be logged in to create new topics. Login / Register