Checkout custom date field validation
Hi,
I installed the Commerce Fieldgroup Panes module and added a custom date field (for pick-up) to my checkout form.
The thing I would need now is to validate the date field against the current time, such that users are only able to enter tomorrow's date until 7 pm today, and otherwise they can only select a date starting the day after tomorrow.
I've been searching for a few days now, but haven't found any module that fits my needs. Does anyone know a module that can do this? Or can I write something for that myself in PHP or so?
Thanks in advance!
Dylan
Comments
Hi,
Maybe you won't need any special module.
Did you try to create your own rule?
You can access your custom fields in rules in this way: http://www.drupalcommerce.org/faq/rules-field-data-selection
Thanks
Hi,
I had a look at this, and I figured out I can write some custom PHP code based on my field which returns a boolean, so that's fine, but I can't find the right trigger for the event. "Completing the checkout process" doesn't seem to make much sense, since I want to prevent users from completing it until the entered date is valid.