Disable payment method dynamically
I'm selling organic group membership with Drupal commerce (thanks to this tutorial http://www.drupalcommerce.org/blog/10809/selling-organic-groups-using-dr...).
The groups are events with a start date and a end date (date module) and are the product display.
I have three payment method enabled.
My question is if it is possible to disable a specific payment method 4 days before the start date of the event.
Comments
I tried but I can't retrieve the field because it is in product display and not in order.
Derio,
Sorry I didn't see your response right away. This is still possible. You will have to create a component (it's a rule that doesn't have an event) that has a given node id and returns a date value. A component is required because it's likely a field that requires "has field" condition and you have to use components to get conditions to work within a set of actions. So to make this happen, you need to pull a list of entities based on a field value (pull all the display nodes that have this product) and limit it to 1 (otherwise you could get back an indefinite number of dates back. Finally, you'll need to remove the "enable the payment gateway" action and create a second component that can have a condition based on a date field and that component will have to have the enable a payment gateway action based around the condition of the date.
Josh
Thanks, but I don't know how to accomplish it...I will try!