Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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
Comment #2
cimo75 CreditAttribution: cimo75 commentedComment #3
cimo75 CreditAttribution: cimo75 commentedSo, 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
Comment #4
Finabluma CreditAttribution: Finabluma commentedHey 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!
Comment #5
cimo75 CreditAttribution: cimo75 commentedSorry for the late reply. You have to use the "After entity is created" event.