This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing an issue where the resource count in your inventory drops twice as much as expected when booking an activity with a resource using WooCommerce Booking, this might be due to a known issue. Solution: We recommend checking if your issue matches the known problem described here: WooCommerce Bookings Max Bookings Per Block Not Working Correctly. If this matches, please update WooCommerce Multilingual & Multicurrency to the latest version (5.5.1 or higher), as this issue has been resolved in these updates.
If the solution provided here is outdated or does not apply to your 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 you still need assistance, please open a new support ticket at WPML support forum.
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.
Background of the issue:
I am trying to book an activity with a resource using WooCommerce Booking. The issue can be seen on this page: hidden link. I expected the resource count in the inventory to decrease correctly.
Symptoms:
The count of the resource in the inventory drops twice as much as expected, leading to incorrect resource booking.
Questions:
Why is the resource count in the inventory dropping twice?
How can I ensure the correct amount of resource is deducted from the inventory?
I understand you are seeing multiple duplicate bookings for the same booking on your site.
This duplication is occurring because it appears that WPML is handling the bookings differently than expected, resulting in duplication.
We have seen similar reports from other merchants and have advised contacting WPML, as the duplication is occurring from that plugin. WPML seems to duplicate the bookings into different languages which causes this issue. You can review the similar reports that are available on the WPML forum here:
Right now, as a workaround, I am running that query every minute :
DELETE wp_posts
FROM wp_posts
JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id
WHERE wp_posts.post_type = 'wc_booking'
AND wp_postmeta.meta_key = '_booking_duplicate_of'
We have a known issue with the WooCommerce Booking plugin and its “Max bookings per block” feature. Please check it at the following link and see if it is the same issue you are experiencing.
It is quite possible that the issue is related, but the problem is poorly described from a technical standpoint. It would be important to confirm whether the bookings are no longer available because WPML creates a duplicate, which has the effect of doubling the actual number of bookings. They can use the following query to check for duplicates:
SELECT wp_posts.ID
FROM wp_posts
JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id
WHERE wp_posts.post_type = 'wc_booking'
AND wp_postmeta.meta_key = '_booking_duplicate_of';
Our developers have fixed this issue, and the fix will be included in the next version of WooCommerce Multilingual & Multicurrency. We will update you here once this version is out.