Breakfast in Capetown
Snippets

Programatically add multiple products to a cart

After a few days of hunting for a solution, I finally bumped into this snippet and boy did I feel dumb. Anyway, I hope someone will find this useful. 1 2 3 4 5 6 7 8 9 10 try{ $cart = new Mage_Checkout_Model_Cart(); $cart->truncate();//clear existing cart items $cart->init(); $cart->addProductsByIds($productIds); $cart->save(); } catch(Exception $e){ echo [...]

Read full storyComments { 0 }

Magento – Proper use of the ‘GET’ Variable

Once you start doing some Magento coding, you may be faced with loads of errors if you try to use the $_GET['variable'] within functions or some views. So instead try using 1 $this->getRequest()->getParam(’variable’);

Read full storyComments { 0 }