I have written a buy one get one free module for Magento which works perfectly in Magento 1.3.x.
It extends "Mage_Checkout_CartController
" to add the free (simple) product to the cart when the qualifying logic is met. I have modified the "indexAction()
" function in the extended "CartController.php
" and added the extra code and logic to add the free item which is basically added using
$cart->addProduct($FREPRODUCTID, 1);
$cart->save();
$this->_getSession()->setCartWasUpdated(true);
This works fine in Magento 1.3.x (CE) however in 1.4 and 1.5 what I am seeing is that the free item is added to the cart but the cart total does not update to include the product added by my code, and at checkout the product is not seen. Although the product is free, has a zero price configured, I also notice that when I give the product a price, i.e. $1 the product still shows up with a zero price in the cart as though its simply not recognized. The free product is correctly configured and is saleable, in stock etc.
Any suggestions as to why my product is being added to the cart but somehow is not being correctly seen by the system in Magento 1.4/1.5?
Thanks
PAJ