Buy X Get Y Free
Hi - I am trying to implement Buy X Get Y Free functionality in my database driven eCart.
In my ecart there are products and then individual items for each product in inventory. The individual items are of a unique weight. So if the user wants to buy 2 of the same product, they would choose the weight from inventory from a drop down and have 2 different line items in their cart. The items in the cart have the same product ID but different inventory IDs.
To implement Buy X Get Y Free, I need to have that sale in the database by product ID and then add the freebies to the shopping cart when the condition is met. My initial thought is to implement/hand code this logic on the shopping cart page based on recordsets of what is in the cart, what is already free in the cart and what sales are going on that pertain to items in the cart.
Any thoughts or simpler solutions to this? Thanks much in advance!