- Support forum for the Order Minimum/Maximum Amount Limits for WooCommerce.
- This topic has 7 replies, 2 voices, and was last updated 3 years, 7 months ago by Zohaib.
-
AuthorPosts
-
April 13, 2021 at 12:43 pm #92982LiviuGuest
Hi guys.
I want to prevent users to reach checkout page if cart is empty, but I want users to still be able to see thank you message after a purchase. Enabling the option in the plugging settings disables any custom redirect after order-received event is triggered. It goes automatically to cart page instead on the thank you page.
What can I do in this case?
April 13, 2021 at 1:17 pm #92983LiviuGuest*I want to prevent users to reach checkout page if cart is empty
should have been *I want to prevent users to reach checkout page if cart is below a minimum amount. ( so your exact plugin purpose )
April 14, 2021 at 6:46 am #92984LiviuGuestHi,
I can explain better the functionality now:
Being a user I want to avoid ending up to the checkout page if my order is below a minimum amount and if I have the minimum amount then I want to checkout and see the thank you/order-received page with order details.Business reason: upselling, user is reminded to pay if his order is in waiting status, etc
Enabling the block checkout page from the plugging settings results in this user journey:
User with required cart amount is able to go to checkout. User fills all details and proceeds. Order is received, but user is redirected to the cart page instead of the thank you page ( checkout/order-received page ).I tried to apply a redirect on my own, but my custom page doesn’t have the order details unfortunately, so it is not a possible solution. I used the KEY to signify an order was received. I noticed that this key stayed in the redirected cart page (chrome inspect tools) and i made a condition to redirect if we are on the cart page and a key is identified.
add_action(“template_redirect”, ‘redirection_function’);
function redirection_function(){
global $woocommerce;
if( is_cart() && WC()->cart->cart_contents_count == 0 && !isset($_GET[‘key’])) {
wp_redirect( ‘custom URL’ );
exit;
}
}Another solution is to manually construct the custom URL based on the key and add it to the above function as a redirect when we are on the cart page and a KEY is identified, but I couldn’t figure out how to do it. Maybe you can help.
I can submit a video recording if you need.
April 14, 2021 at 12:36 pm #92985ZohaibParticipantHi Luvi,
Can you please confirm you are using the latest version of the plugin 4.0.2
In this version, we have an option to display messages on the product page, rather than the cart page. It’s located under WooCommerce > Settings > Order Min/Max amount > Messages
You can easily set up notices on the product page. However, I do note that the customer can still reach the checkout page.
If the block checkout page option is enabled under General settings, they will only be able to reach the cart page and not the checkout page.
If the block checkout process option is enabled under the General settings, the customers will be able to reach the checkout page but not be able to complete the checkout.
In your case I would enable both block checkout page and block checkout process.
April 14, 2021 at 12:41 pm #92986LiviuGuestHi Zohaib,
Thanks for the answer, i can confirm that I have 4.0.2 version, both Block checkout process and Block checkout page are enabled.
The issue is that after a checkout is completed, user doesn’t get to the checkout/order-received page. After a order is placed, the cart is emptied and i suspect the plugin redirects user to cart page instead of showing him the checkout/order-recieved page with order details.
April 14, 2021 at 12:46 pm #92987ZohaibParticipantHi,
The user gets redirected to the cart if they have purchased less than the minimum amount or more than the minimum amount?
If they are getting redirected and the amount is less than the minimum amount that is because we have enabled block checkout process.
If they are getting redirected and the amount is more than the minimum amount, we would need to investigate further.
April 14, 2021 at 12:50 pm #92988LiviuGuestHi,
The second scenario happens:
“If they are getting redirected and the amount is more than the minimum amount, we would need to investigate further.”
Scenario:
User adds products and amount is more than the minimum amount.
User clicks on checkout and is allowed to do so.
User adds all details for delivery and submits the order
Confirmation email is sent for order received
User ends up on cart page.
-> User should have ended up on checkout/order-received page
April 14, 2021 at 12:55 pm #92989ZohaibParticipantHi,
Is it possible for you to share your WordPress dashboard access and we can have a look?
You can send the details on [email protected]
-
AuthorPosts
- You must be logged in to reply to this topic.