This topic has 2 replies, 2 voices, and was last updated 7 years, 2 months ago ago by Rose Tyler
Hello Everyone, I’m using Woopress WP Theme, I would like to customize my “Add to Cart” buttons so that when the user clicks, they shall be redirected to a Custom Page like http://www.domain.com/request_quote
I would like to change the “Add to Cart” text to “Request Quote”
I also want to disable products from being added to the Cart, I have done this before with a different theme using this code:
/**
* Redirect users after add to cart.
*/
function my_custom_add_to_cart_redirect( $url ) {
$url = get_permalink( 3378 ); // URL to redirect to (3378 is the page ID here)
return $url;
}
add_filter( ‘woocommerce_add_to_cart_redirect’, ‘my_custom_add_to_cart_redirect’ );
/**
* Making Products not purchasable.
*/
add_filter( ‘woocommerce_is_purchasable’,’__return_false’,10,2);
Kindly assist me to implement this function using Woopress Theme.
Regards.
Hello,
Such questions request additional customization which is beyond our basic support scope. You can contact WPKraken team to get help with additional development.
You may try this way to make redirect: Woocommerce -> settings -> products -> display http://prntscr.com/gmi46n and add this code in functions.php of your child theme:
function et_added_to_cart_redirect() {
return $url = "request_quote"; // for example
};
add_filter('woocommerce_add_to_cart_redirect', 'et_added_to_cart_redirect');
Please read this article https://docs.woocommerce.com/document/change-add-to-cart-button-text/
Also, you may activate Just Catalog options in Theme Options > Shop.
Regards
Tagged: add to cart, custom link, redirect, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up