Tags/topics: 
1
Answers
Vote up!
0
Vote down!

How to require a certain product to be bought before checkout.

I have a site that sells trees and other items. I require that only 1 tree be bought per transaction. I also require that a tree must be bought every transaction. I don't want the checkout to go through if there is no tree is the shopping cart.

What I tried with rules is this:

EVENTS
Completing the checkout process

Conditions

Order contains a particular product
Parameter: Order: [commerce-order], Product SKU: Six Foot Tree, Operator: =

Actions

Complete checkout for an order
Parameter: Order in checkout: [commerce_order]

Could you let me know what I am doing wrong? It is not working.

Is there a simpler way to do this.

Asked by: nanaofosu
on October 15, 2012

1 Answer

Vote up!
1
Vote down!

Here's a rule export that reacts when a user goes from "shopping" to "checkout" ...

http://pastebin.com/AFpwbUBt

I would create an additional condition to see if they *do not* have a particular product in the Order and then redirect them to a page that describes how to continue checkout or perhaps automatically add a product to the order, etc.

Josh

Josh Miller
Answer by: Josh Miller
Posted: Jan 9, 2013