Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
if 2 users add the same room to the cart, and one of them pay the reservation?
What happens to the other user? Could he continuing the reservation and pay of the same room?
Thank you in advance
Comments
Comment #1
larowlanThere is an implementation of hook_order that does a final check before the order is saved and returns an error if someone else has beaten them to it.
There will always be a race condition but that's down to Drupal 6 using Myisam as the db engine instead of innodb.
Lee
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks for your answer, I thought that, but wasn't sure.
Comment #3
ayalsule CreditAttribution: ayalsule commentedHi
first I want to thank @larowlan to the great support he provide in uc_hotel
second , I though there is a problem with overbooking
I booked a room and check it out ,but the days I booked still available in availability calendar , with 1 room available , I tried to rebook the same room with same period It`s still available , I think It must disabled in availability calendar first with red days and checked in checking out too , I see hook_order but It`s seems to b there is no availability update
please check and advice
Comment #4
ayalsule CreditAttribution: ayalsule commentedComment #5
larowlanHi
The availability update occurs via conditional actions which by default are setup to fire when
a) an order payment is entered and
b) the order status is not 'payment received' and
c) the order balance (after payment) is zero
So if you're using a manual payment method (eg other, COD, cheque etc) the CA won't fire.
You can create a new CA to fire on 'checkout complete' by editing/copying the default one.
There are a few posts in the issue queue regarding how to do this.
I've seen default conditional actions that just won't fire before, something to do with module weights - if this is the case you can edit the default one and add another action like 'Display a message to the user' and that moves the CA from code (defaults ca's provided by a module are in code) to the database (manual ca's are saved in the database) and then they fire every time.
Lee