Posted by maxchock on June 30, 2011 at 6:45am
Hi,
I'm quite new to D7 and I'm building a groupon-like website using Commerce.
Just like groupon, each product need to reach a minimum number of purchase to unlock the product. So what I want to do is use Rules to compare a Field name field_min_purchase to no_of_purchase, if the no_of_purchase is greater, I want to put a label "The Deal Is ON" on the teaser or content of the product display. I have playing around with Rules2 for few days and doesn't have any luck, hope someone can give me some direction.
Thanks.

Comments
.
If field_min_purchase and no_of_purchase are numeric fields, you can add a rule to do a "Numeric comparison" and use combinations such as GREATER THAN, EQUAL, etc.
For the action, you could use "Populate a field" or a Flag action. I think Flagging a node is more practical because you can use that piece of data in other parts of the site such as Views and Rules.
You can also see Johan's awesome videos on Rules to get some idea(Drupal 6 though)
Combine with Views
If you install Rules Bonus Pack, there is a condition to check the number of results from a view. If you can build a view that lists purchases, then you should be ready to rock.
I hope this can be of some help. (Thanks Ayesh for kind word!)
//Johan Falk, NodeOne
**
Learn Drupal with Nodeone! Drupal 7 introduction | The Views module | Drupal learning curve | Rules for Drupal 6 | Theming Drupal 6
I've never heard about a
I've never heard about a RULES bonus pack!
Views Bonus Pack is awesome and it's really cool to see even more additions to Rules!
So you can create a View to get purchases-count and compare it with a CCK field. I haven't used it yet and I have something to sleep on tonight.
Sorry, I left out my main
Sorry, I left out my main issue which is I can't even find a proper UI to dig the field that i created for the products.. Can the Rules UI can actually dig into Product?? because product is not a content...