danneh.org

Magento Discount Rules – Buy X Get Lowest Priced Item

by on Sep.09, 2010, under Magento

I figured out today that the discount/promotion rules in Magento aren’t exactly obvious, nor straight forward to apply. If you don’t have the logical mind of a programmer, setting up rules for products that only meet certain criteria can be a tricky one. Take this example:

Buy 4 for 3 on any product in [this] category.

Sounds simple, no? Actually, no. Things you have to take into account are:

  • Number of items in the cart
  • Categories of all products in the cart
  • Products that may not be in the specified category in the rule actions
  • Number of these products also

So, bearing in mind all this, and working with the constraints of Magento’s rule condition selections, Here’s how we come with the solution. In these examples, we’re using this extension, with this fix, on Magento 1.4.0.1:

Rule Information

  • Name: Buy 4 for 3 from [example] category
  • Description: Buy 4, get cheapest item free from [example] category.
  • Status: Active
  • Website: [make your selection]
  • Customer Groups: [make your selection - we're using NOT LOGGED IN and General]
  • Coupon code: B4F3
  • Uses per coupon: 0
  • Uses per customer: 0

Conditions

  • If ALL of these conditions are TRUE
    • If total quantity equals or greater than 4 for a sub-selection of items in cart matching ALL of these conditions:
      • Category is 2604

Actions

  • Apply: Buy X get lowest item free (Discount amount is lowest item price)
  • Discount amount: 1
  • Max Qty discount is apply to: 0 (this allows groups of 4 items to be discounted 1 item)
  • Discount Qty Step: 4
  • Free Shipping: No [but as your requirements]
  • Stop processing further rules: No
  • If ALL of these conditions are TRUE:
    • Category is 2604

Labels: As you require

Save the rule and test by adding a various combination of different products from different categories into your cart. It’ll discount 1 of the the cheapest item(s) of any products matching the criteria, 1 product for each multiple of 4 products. If you proceed to add a product into the cart form another category, it will ignore this product. If you subsequently remove one of the matching products from the cart, even though there may still be 4 items in the cart, the 4th item doesn’t match the criteria, therefore the discoule rule no longer takes effect, and is removed.

Magento is very powerful – it’s just not exactly obvious!

:, , , ,

8 Comments for this entry

  • Viral Mehta

    Hi
    I am new to Magento

    Is it possible in magento that I buy total products of $500 products and get 1 product free

    Can I set such rule.

    Viral Mehta

  • Dan

    Yes, you should be able to do that. Under “Conditions”, if you use the “Cart Attribute – Subtotal” “equals or greated than” “500″, then use the “Actions” to specify the conditions for the free item (for example, “Product Attribute – Category” “contains” “[Select Category/ies]“). Then set “Discount Amount” = “Percent of product price”, set “Discount Amount” to 100 (100%), “Max Qty Discount is applied to” = 1, and the other actions and rules to suit.

  • Hepe

    Do you by chance have a patch for Magento 1.6 for the buy x get y lowest price mod?

  • vivek

    this is not working for me.

  • vivek

    its working in the only case of qty 5 or more. so what is the reason.

  • vivek

    i got the answer.

    Discount Qty Step: should be 3 rather than 4

    thanx anyways for the post.

  • Haney

    Its not working in enterprise. Any ideas?

  • dynamic

    Fatal error: Call to undefined method Mage_SalesRule_Model_Mysql4_Rule_Collection::getIsValid()

    error is come in cart page

    Thanks

Leave a Reply

 

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...