This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing issues where WPML creates duplicate bookings for each language when an order is placed using WooCommerce Booking, and these duplicates are then incorrectly synced to Google Calendar, causing multiple notifications and sync errors, we have a solution for you.
Solution:
1. Ensure you back up your site.
2. Navigate to the file at
wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/class-wcml-bookings.php
.
3. Modify the file by replacing the line at 1805 from:
&& in_array( $event->hook, [ 'wc-booking-reminder', 'wc-booking-complete' ], true )
to:
&& in_array( $event->hook, [ 'wc-booking-reminder', 'wc-booking-complete', 'woocommerce_admin_new_booking' ], true )
4. After making this change, try to reproduce the issue to see if it resolves the problem with duplicate emails.
For the Google Calendar issue, it has been escalated to our development team, and we will update you as soon as there is a resolution.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Tagged: Compatibility
This topic contains 23 replies, has 2 voices.
Last updated by Osama Mersal 1 year, 10 months ago.
Assisted by: Osama Mersal.
Author | Posts |
---|---|
November 23, 2022 at 8:00 pm #12522329 | |
markC-59 |
Hello, We have the following plugins setup on our WordPress website: - WPML Multilingual CMS PHP Memory Limit 1024 Mb We have made these configurations to the front end and back end: Front end Neve: Back end: Issues we are facing: Use case: The Front End (FE) has 4 active languages. FE User selects language 3 and places a booking. The booking makes it to the calendar in WooCommerce Booking in language 3 but then errors occur. The admin receives a booking for each of the active languages (in this Use Case, 4 emails arrive) The booking shows in one instance in Bookings - Calendar, but show up in all 4 language instances in the Google Calendar. Then, if admin deletes the booking, the original language booking is removed in Bookings - Calendar but the 3 duplicate languages remain visible in Google Calendar, and must be removed manually. As a workaround: We tried disabling translation for "booking" custom post type from WPML settings, but WPML still creates duplicates. Solution we are expecting: Whatever languages Front End User places the order/booking in, we only want that booking to remain as it is and to show up through the system. Said in a different way; “It is okay that WPML replicates bookings throughout languages on the Front End, but the back end should not inherit these replications.” Can you check and answer following? Let me know if any further details are needed. All the best |
November 27, 2022 at 7:55 am #12540647 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for contacting WPML forums support. I'll be glad to help you today. First of all, sorry for the late reply due to a higher workload. I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP) Your next answer will be private, which means only you and I can access it. ❌ Please backup your database and website ❌ ✙ I would need your permission to de-activate and re-activate the Plugins and the Theme and change configurations on the site. This is also a reason the backup is critical. ✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site. Thanks for your patience and cooperation Best regards, |
November 27, 2022 at 11:30 am #12541101 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi Mark, Thanks for the access details. I'll consult our 2nd tier supporters regarding this issue and update you as soon as I get their reply. Best regards, |
November 29, 2022 at 7:46 pm #12557661 | |
markC-59 |
I see that your team are loading in test bookings. Please note that I see * multiple bookings in Google Cal, same booking at time, just all active languages I don't wish to add to the mystery, I am just reporting what I see. Please see attached screen dump |
November 30, 2022 at 6:07 am #12559831 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for your update. I'll pass the info to our 2nd tier support team. Thanks, |
December 1, 2022 at 2:53 pm #12571611 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, 1) Thanks for your patience. Could you please try the following steps? && in_array( $event->hook, [ 'wc-booking-reminder', 'wc-booking-complete' ], true ) With && in_array( $event->hook, [ 'wc-booking-reminder', 'wc-booking-complete', 'woocommerce_admin_new_booking' ], true ) 4- Try to reproduce the issue Kindly let me know if the above steps fixed the email issue. 2) The Google Calendar issue has been escalated to our Dev team, and I'll update you as soon as I get their reply. Best regards, |
December 1, 2022 at 3:58 pm #12572749 | |
markC-59 |
I have successfully done as you instructed with the code. Thanks! |
December 1, 2022 at 4:02 pm #12572757 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi Mark, Thanks for your confirmation. I'll update you regarding the Google Calendar issue as soon as I get an update from our dev team. Thanks for your cooperation and patience. Best regards, |
December 2, 2022 at 12:25 pm #12578429 | |
markC-59 |
I also see that the "Reminder" emails about a booking placed in DK language sadly come out in EN language to the front end user |
December 2, 2022 at 12:30 pm #12578445 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Please translate the email strings and check if the email will be sent in the correct language. You can find the strings in the string translation. For example, please check this string. (hidden link) Best regards, |
December 2, 2022 at 7:05 pm #12580381 | |
markC-59 |
Hey, Yes your suggestion fixes that specific portion of the mail, however there are many other parts of the mail that still are not translated. Mark |
December 2, 2022 at 7:21 pm #12580517 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi Mark, Please search for the untranslated strings in the String Translation to translate them. The string I shared is an example of how you can translate them. Kindly check the following guides about string translation. 1) https://wpml.org/documentation/getting-started-guide/string-translation Best regards, |
December 2, 2022 at 7:23 pm #12580529 | |
markC-59 |
Yes, I will, but I see little point in doing this until we learn whether any rollbacks have to do be done |
December 2, 2022 at 7:25 pm #12580531 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, So far, you can translate them to send reminders to the site's users in their booking language until our dev team checks the Google calendar issue. Kind regards, |
December 6, 2022 at 1:03 pm #12599261 | |
markC-59 |
This process is taking a VERY long time, in fact, it feels unreasonable. What is the status currently? |