Vote up!
Vote down!

Minimum cart total if field has value


I ran into this problem with Ubercart too back when I was going to stick with D6 and UC for my store but since I upgraded to D7 and Commerce, I am again having a tough time with this.

What I want to do is this. For my store, I need to set a minimum order total if the user select Delivery from the Pickup or Delivery field which is located in the Billing Profile fields. By default its set to Pickup, but if they choose Delivery, there is a $10 minimum so it should flag a message that their cart total isn't enough (if it isn't).

I know Rules should be able to do this but I can't figure out how, plus I still have the hardest time using Rules in D7, so much easier to understand and use in D6 that I just get lost part way through trying to add conditions.

But the scenario should be:

- While in checkout screen
- User keeps Pickup selected
- Allow user to proceed with checkout and payment with no issue

- if user selects Delivery
- check order/cart total to see if its <= $9.99
- If it is, display system message to user that they need to add more to their cart
- They should not be able to proceed past checkout until order total is >$10


Asked by: Travis
on June 4, 2013

2 Answers

Vote up!
Vote down!

Using Rules, you can easily prevent the appearance of a flat rate shipping service on the checkout form based on the order total. We supply a condition in the Commerce Price group called Price comparison that makes it simply to check the total of an order. Simply add that condition to the rules component governing the availability of your delivery flat rate service, choose the order total using the commerce-line-item:order:commerce-order-total token, and then configure the remaining parameters to ensure the price is the right amount. (In your case I'd check to make sure the price is >= $10.00, since these components govern availability, not restrict it.)

What this will do is actually prevent the illegitimate option from appearing in the first place. Generally speaking, it's better customer experience to not show an option that cannot actually be selected. In the middle of the checkout process, you don't want a customer leaving the form for any reason at all - even if you think it's an upsell opportunity.

Much better to inform them of the delivery policy ahead of time and only make it available on the checkout form if they have passed the order total threshold. If I were to do anything, I'd add a message to the top of the shopping cart page or maybe the first checkout page stating that orders of $10 or more can be delivered with some sort of tasteful hint about other related products.

Free shipping is always a great upsell opportunity, but I wouldn't want to make my customer feel like they're missing out right when they're about to give me money. They're more likely to run off and buy from somewhere else.

Ryan Szrama
Answer by: Ryan Szrama
Posted: Jun 4, 2013


Awesome! So I managed to set up a "Delivery" flat rate option, and configured its rule with the condition you mentioned. Though the only thing that kinda sucks though is it still shows the Shipping Address form, which should not be present (as well as the shipping method fieldset) if there is no shipping method available.

- Travis on June 4, 2013
Vote up!
Vote down!

Hello Ryan,

Thanks a lot for your help! I haven't though of using the Flat Rate shipping integration and tying it in that way.

Also good point on not including the delivery as an option at all times, though it should be optional and not required when the order total is above $10.

I will play around with this tonight and see if I can get it to work.

Thanks again!

Answer by: Travis
Posted: Jun 4, 2013