2

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?

1 Answer 1

0

You might consider one of two methods:

  1. Define another status/branch in the checkout logic (approved shopping cart -> checkout) wherein Rule 5 would redirect to the approved cart step instead of the standard shopping cart.

or

  1. Implement an "admin approved" flag on the Order that you could set in your actions for Rule 5 and then test in your conditions for Rule 3, redirecting the user only if that flag was false. That flag could be implemented as a new field on the Order entity (assuming Order is an entity).

Method 1 might be somewhat redundant and more work than method 2, but I think it's the better of the two because it extends the current shopping cart/checkout/Rules logic and workflow. I think there's merit in that.

In addition, method 2 would bury a critical aspect of that logic into a field on the Order. I think the state of an Order in a checkout process should be defined separately from the Order itself.

Perhaps there's a third way that uses a little bit of both methods.

Hope this is helpful.

1
  • Could you offer links or instructions on how to do your #1? Commented Nov 28, 2016 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.