kamransyed
Forum Replies Created
-
Yes 🙂 Here is example code
add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘cart_button_text’ );
function cart_button_text() {
return __( ‘Make an Enquiry’, ‘woocommerce’ );
}It will just change the button text. From here you need to use “woocommerce_add_to_cart_redirect” filter to take user to like “Thank you” page etc when user clicks on ‘Make an Enquiry’ button.
Forum: Plugins
In reply to: [WooCommerce] How to customize password reset work-flow?`
$login = $_POST[‘user_login’];
‘
You can try above line in your function to see the login requested for.Forum: Plugins
In reply to: [WooCommerce] How to customize password reset work-flow?You can use lostpassword_post hook instead of retrieve_password hook. lostpassword_post fires before ! is_user_member_of_blog( $user_data->ID, get_current_blog_id() )
Forum: Plugins
In reply to: [WooCommerce] How to customize password reset work-flow?If you want Woocommerce not to send password reset email and want to do it with your code you can
add_filter('allow_password_reset', 'my_custom_password_reset', 10, 2);return false in my_custom_password_reset function. This will stop woocommerce to reset password.
To do it yourself you need to
add_action('retrieve_password', 'custom_reset_solution');In custom_reset_solution user_login is passed as parameter. You can write you own logic here for password reset and sending email etc.
Thanks,
Kamran1-You need to add this to functions.php file of you active theme or child theme if child theme is currently active. I hope you must have replaced mysite.com with the site you are working on.
2-It will be applied to all products. If you want to change it for a specific product or category of products you need to place a check for particular product or product category inside add_to_cart_redirect() function.
Can you check if shipping is enabled in Woocommerce settings and shipping method is free shipping
Hi Richard,
You can add code to functions.php file of your theme/child theme.
add_filter('add_to_cart_redirect', 'add_to_cart_redirect'); function add_to_cart_redirect() { $myContactUsPage = "//mysite.com/contact_us"; return $myContactUsPage; }You can use add_to_cart_redirect filter
From your function return url of your contact us page or any other page you want to send your user to.
Use woocommerce_product_single_add_to_cart_text filter to change text on add to cart button.
I hope it helps,
Kamran