tags:

views:

100

answers:

2

My objective is to create a buy xyz get xyz free, where x, y, and z are separate products. When purchasing EITHER x, y, or z, the customer can one of x, y, or z products for free.

I've tried to create this function within Magento's price rules, but I have not had any success whatsoever. I've read pretty much everything on the internet regarding these rules and have gotten nowhere. I'm thinking about creating a page that allows the user to select the products they would like to purchase in sequence, then using that information to add a bundled cart item to the user's cart. There may be a simpler way, though, and I'm wondering if anyone has any insight.

Please note that the items in question are configurable items with two attribute sets, just to make it interesting.

+2  A: 

I'd hook into the Shopping Cart price rules engine for this. The system is designed to apply a set of rules an alter the price of a cart. I'd

  1. Figure out where the pricing rules are applied

  2. Override that method using the config override system built into Magento

  3. Have the override method first call its parent, so that all original pricing rules are applied

  4. Once that's done, include you custom logic at the end

Next, and related to #4, create new model objects that keep track of which products are buy one/get one, and (optionally) create a UI in the admin to manage these relationships. These are the models you'd be looking at in #4 to apply your rules.

Good luck.

Alan Storm
Hey Alan, thanks for the response, I actually emailed you about this earlier. I found the method but I'm a little apprehensive about being able to execute this. I do think, however, that this is the only way to go.
melee
A: 

So since I was unable to acquire the time resource to implement Alan's answer, I got a workaround going for this by adding custom options to the configurable products, which were dropdowns of the different "bogo" products. This is flawed in that it does NOT account for stock, but in my situation, it worked in the time being.

melee