Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Creating custom rules
 
ablock
Jr. Member
 
Total Posts:  2
Joined:  2008-04-11
 

Would I be able to create my own custom shopping cart rules such as “If the subtotal is X from category Y”? Looking through the codebase, this logic for rules seems to be spread apart through different components (an published API would sure be useful, and i’m sure that’s been echoed thousands of times, but I just discovered this product).
Perhaps something like this would be better suited by adding a custom event handler with a custom module.
Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Your example can be specified this way:

If ALL  of these conditions are TRUE :
|  
Subtotal  equals or greater than  100  
|  If an item is FOUND  in the cart with ALL  of these conditions true
|  |  
Category  is  3
 
Magento Community Magento Community
Magento Community
Magento Community
 
radders
Sr. Member
 
Total Posts:  162
Joined:  2008-03-23
 

Sorry if I have this wrong Moshe but that’s not quite the same thing though is it (just trying to sort out the brackets in my mind)? I think you could just add an item from the required category to satisfy the rule without it making the total from that category reach the threshold.
I’m not sure that the shopping cart rules are working yet. I have tried different ideas including giving free shipping for a type of product but most of the rules I set up had no effect so I reported that one as a bug (sorry issue grin ).

 
Magento Community Magento Community
Magento Community
Magento Community
 
ablock
Jr. Member
 
Total Posts:  2
Joined:  2008-04-11
 

Let me be more specific about my problem. Lets say I have two categories, 1 and 2. In category 1, I would like a rule such as “if you purchase 50 or more of that category , you get 15 dollars off. If you purchase 50 more of category 2 you get 20 dollars off. In the example you gave, I would have to specify two rules such as those.

If ALL  of these conditions are TRUE :
|  
Subtotal  equals or greater than  50  
|  If an item is FOUND  in the cart with ALL  of these conditions true
|  |  
Category  is  1

If ALL  of these conditions are TRUE :
|  
Subtotal  equals or greater than  50  
|  If an item is FOUND  in the cart with ALL  of these conditions true
|  |  
Category  is  2

Then if I had two items, one from each category, each worth $30, both of these conditions would ring true...this is not what I want.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top