Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $id = '100'; // Replace id with your product id
- $qty = '2'; // Replace qty with your qty
- $_product = Mage::getModel('catalog/product')->load($id);
- $cart = Mage::getModel('checkout/cart');
- $cart->init();
- $cart->addProduct($_product, array('qty' => $qty));
- $cart->save();
- Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement