Alan
Alan

Reputation: 93

Drupal Commerce Kickstart v2 Approve Order before payment

I am building a proof of concept ecommerce solution using commerce kickstart v2

I wish to implement a system where a user can submit an order but an admin must approve orders before the customer can pay - I have a feeling I can do this with rules & extra order statuses but I cannot figure out which part of the checkout process to intervene in. Heres what I have so far:

  1. extra order status "Awaiting Admin Approval"
  2. extra order status "Approved by Admin"
  3. Rule that fires when order status changes from 'shopping cart' to 'checkout' and sets order as "Awaiting admin Approval"
  4. Rule that fires when order status is "Awaiting Admin Approval" and path contains 'checkout'. this rule redirects user to a page that says 'your order is awaiting approval'
  5. Rule that should allow user to checkout once admin has changed order status to "Approved by admin"

Rule 5 above (in italics) is giving me problems, no matter what I try - rule # 3 always fires, even after the order has been approved, which results in the user being redirected.

The problem arises because once the order has been set as "Approved by Admin", it must then go back to "shopping cart", then "checkout"... which then fires rule 3, which brings me nicely back around in a circle.

Any tips or suggestions?

Upvotes: 3

Views: 656

Answers (1)

TheodorosPloumis
TheodorosPloumis

Reputation: 2456

For rule 3 add another Condition:Data comparison for the order state "Approved by admin" with a Negate option (checkbox in bottom). So if you change the order state to "Approved by admin" this rule will not trigger anymore because this condition will return FALSE.

Furthermore on rule 5 you can create an action to send an email to Buyer with the checkout link.

Upvotes: 0

Related Questions