Hi. Our website is setup to not allow guest checkout for woocommerce.
The account can be created during checkout or by registration. We do have a problem with it - Customers who do not have an account and click on express checkout (apple/google pay) - but it then asks them to create an account. they register but after registration they are not taken back to the checkout page.
instead customer look for the same product again and this way they purchase duplicate packages/appointments without realising and then we have to issue refunds.
Is there a way to avoid this? Especially for our Intro Offer package - this package can be only purchased once per customer.. Any ideas please?
I am using this code to prevent duplicate Intro Package Purchase which works. But I think this wouldnt work for appointments, because it wouldnt let to book more than one of same service appointment at the same time... unless have it checked by product meta descriptions the time and date for app. just want to see if there is any easier way of doing this?
function prevent_duplicate_amelia_products() { // Define the specific product ID you want to limit to one in the cart $specific_product_id = 19365487; // Your specific product ID
// Initialize a counter for the specific product $product_count = 0;
// Array to store duplicate cart item keys $duplicate_keys = array();
// Iterate through the cart items foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) { // Check if the current item is the specific product if ($cart_item['product_id'] == $specific_product_id) { $product_count++; // If the product count is greater than 1, mark it as a duplicate if ($product_count > 1) { $duplicate_keys[] = $cart_item_key; } } }
// Remove all duplicates foreach ($duplicate_keys as $key) { WC()->cart->remove_cart_item($key); } }
add_action('template_redirect', 'redirect_to_checkout_if_cart', 10); function redirect_to_checkout_if_cart() { if (is_cart() && !WC()->cart->is_empty()) { wp_safe_redirect(wc_get_checkout_url()); exit; } }
hello Uros, this is actually not what I am asking for. I do have the multiple booking option enabled. We do want our customers to be able to book multiple appointments at once and it works, but the problem is that customers are able to add 2 Intro offer packages which can only be purchased once. We do have a set up for the package on purchasing period which is set to 10 years. This still allows new customers to add two intro offer package to the basket.
I did explain how it happens in my previous message. But ill try this again:
1. New unregistered customer visit the site and selects intro offer package then they are taken to the checkout
2. Customer selects to use Express Checkout - apple/google pay, but without the account they cannot and are asked to create an account and are taken to the registration page
3. Once they create the account, they are not being taken back to the checkout but woocommerce my account endpoint.
4. We do not have a cart icon on our web, so they cannot see the package is already there and go to add another intro offer package and entering same details still lets them add it , then 2 packages are shown in the checkout page.
5. Without noticing the price they just click express checkout and pay double the amount, but only one package is issued through amelia which is correct, however we do not want the woocomerce to let add a same package twice because of this we have to issue refunds that cost us.
I have also added the php code which works and deletes a duplicate package if there is one, but that code is blocking access to cart page if they wanted to go back to cart. So this code might need tweaking a bit i have to double check.
i just wanted to know if there are any other easier solutions for this?
Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue.
We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties.
You can write credentials here just check PRIVATE Reply so nobody can see them except us.
Hi Uros, I've just also noticed one thing, that since your reply today all orders placed are not being registered in amelia. So the customer purchases a package, or an appointment, they payment goes through but it doesnt register the appointment on amelia and doesnt issue a package if the package was purchased.
On staging site, everything seems to be working fine. No duplicate intro package or duplicate appointmnents can be added to the baskt, and appointmnets/packages get registered through amelia after payment succesffuly. (paid with coupon)
Okay, so I've figured out what was the issue for amelia not registering purchased appointments and packages, the hidden option for create booking before was disabled - once enabled the bookings and email confirmations work again.
So now the main issue still remains - duplicate appointments and intro offer package.
Hi. Our website is setup to not allow guest checkout for woocommerce.
The account can be created during checkout or by registration. We do have a problem with it - Customers who do not have an account and click on express checkout (apple/google pay) - but it then asks them to create an account. they register but after registration they are not taken back to the checkout page.
instead customer look for the same product again and this way they purchase duplicate packages/appointments without realising and then we have to issue refunds.
Is there a way to avoid this? Especially for our Intro Offer package - this package can be only purchased once per customer.. Any ideas please?
Attached files: Screenshot 2024-06-17 at 10.30.23.png
I am using this code to prevent duplicate Intro Package Purchase which works. But I think this wouldnt work for appointments, because it wouldnt let to book more than one of same service appointment at the same time... unless have it checked by product meta descriptions the time and date for app. just want to see if there is any easier way of doing this?
add_action('woocommerce_check_cart_items', 'prevent_duplicate_amelia_products');
function prevent_duplicate_amelia_products() {
// Define the specific product ID you want to limit to one in the cart
$specific_product_id = 19365487; // Your specific product ID
// Initialize a counter for the specific product
$product_count = 0;
// Array to store duplicate cart item keys
$duplicate_keys = array();
// Iterate through the cart items
foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
// Check if the current item is the specific product
if ($cart_item['product_id'] == $specific_product_id) {
$product_count++;
// If the product count is greater than 1, mark it as a duplicate
if ($product_count > 1) {
$duplicate_keys[] = $cart_item_key;
}
}
}
// Remove all duplicates
foreach ($duplicate_keys as $key) {
WC()->cart->remove_cart_item($key);
}
}
add_action('template_redirect', 'redirect_to_checkout_if_cart', 10);
function redirect_to_checkout_if_cart() {
if (is_cart() && !WC()->cart->is_empty()) {
wp_safe_redirect(wc_get_checkout_url());
exit;
}
}
Hello Andzelika,
Thank you for reaching out to us.
For that purpose, you will need to disable a hidden option that is shown in the following video.
Let me know if that worked for you or not.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
hello Uros, this is actually not what I am asking for. I do have the multiple booking option enabled. We do want our customers to be able to book multiple appointments at once and it works, but the problem is that customers are able to add 2 Intro offer packages which can only be purchased once. We do have a set up for the package on purchasing period which is set to 10 years. This still allows new customers to add two intro offer package to the basket.
I did explain how it happens in my previous message. But ill try this again:
1. New unregistered customer visit the site and selects intro offer package then they are taken to the checkout
2. Customer selects to use Express Checkout - apple/google pay, but without the account they cannot and are asked to create an account and are taken to the registration page
3. Once they create the account, they are not being taken back to the checkout but woocommerce my account endpoint.
4. We do not have a cart icon on our web, so they cannot see the package is already there and go to add another intro offer package and entering same details still lets them add it , then 2 packages are shown in the checkout page.
5. Without noticing the price they just click express checkout and pay double the amount, but only one package is issued through amelia which is correct, however we do not want the woocomerce to let add a same package twice because of this we have to issue refunds that cost us.
I have also added the php code which works and deletes a duplicate package if there is one, but that code is blocking access to cart page if they wanted to go back to cart. So this code might need tweaking a bit i have to double check.
i just wanted to know if there are any other easier solutions for this?
Thank you
Hello Andzelika,
Thank you for clearing that up.
Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue.
We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties.
You can write credentials here just check PRIVATE Reply so nobody can see them except us.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Andzelika,
Thank you for the credentials.
Can you please test it out now and let me know if it works or the staging website?
Looking forward to your reply.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Andzelika,
Thank you for the update on this.
Please test it out now and let me know if it works or not.
Looking forward to your reply.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
hi Uros, just tested out on live site and unfortunately it’s not working, i am still able to add duplicate appointments and packages.
Attached files: IMG_6643.png
Hi Uros, I've just also noticed one thing, that since your reply today all orders placed are not being registered in amelia. So the customer purchases a package, or an appointment, they payment goes through but it doesnt register the appointment on amelia and doesnt issue a package if the package was purchased.
On staging site, everything seems to be working fine. No duplicate intro package or duplicate appointmnents can be added to the baskt, and appointmnets/packages get registered through amelia after payment succesffuly. (paid with coupon)
Okay, so I've figured out what was the issue for amelia not registering purchased appointments and packages, the hidden option for create booking before was disabled - once enabled the bookings and email confirmations work again.
So now the main issue still remains - duplicate appointments and intro offer package.
ThanksHello Andzelika,
My apologies, I have enabled the wrong option and now it should work fine.
Please let me know if it does or doesn't.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello, sorry for a delay in reply. Yes seems to be working now. Thank you.
Hello Andzelika,
Glad to hear that it works fine now.
I will have this ticket closed now.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables