Hallo
is it possible to select on a bookable unit basis if it can be booked with commerce or with an inquiry to the administrator?
tx
Simone

Comments

cimo75 created an issue. See original summary.

cimo75’s picture

Title: Inquiry on a bookable unit basis » Enquiry/direct booking, on a per unit base
cimo75’s picture

So, I managed ot get this functionality working, it has not been trivial but I'd like to start sharing the results here so other can use it na dprobably improve it.
This has as usually been achieved thanks to extensive use of rules.
Firstly I created an entity with ECK (a content type would do too) with some personal info fields (name, email, telephone, etc.), let's call it Form.
The I created a new order statyus Checkout: enquiry.
With a rule I check if the unit status is on request, if it is then I redirect the user to a Form creation page. After saving the form I use rules ot check if the user exists or not, if necessary I create the user and assign the current order to this user. At the same time I send emails to the administrator with a link to the order and to the user to notify the enquiry.
The admin at this point can either cancel the order (email sent to user) or move the order to a Checkout: checkout status. Rules fire again and notify the user of the disponibility of the unit, I am using here https://www.drupal.org/project/tokenauth to give acces to the user to his order and process it.
This is roughly the idea, there are a lot of rough parts here and there to smooth out but it is basically working.
I plan to post my rules and I am open to questions.
Simone

Finabluma’s picture

Hey Simone! I'm interesting to apply this on my site. I'm little bit confuse.
I have created a new order status thanks to commerce_custom_order_status module. The new order status is enquiry. Once done that i have a created a form with entity form module and now I'm with rules and ... wich event we should fire? unit is viewed? I can not get this work. Could you post your rules, please? Much appreciate!

cimo75’s picture

Sorry for the late reply. You have to use the "After entity is created" event.