dhobo Posted January 10, 2012 Share Posted January 10, 2012 Is it possible to add products to the cart without the use of ajax/javascript ? I am creating a module that replaces the 'add to cart' button on the product flypage with an auction button; so persons should bid on a product and the highest bid will be added to the cart. so that means that not always the product should be added. i have created all the logic and now reached the point that i need to add a product to the cart, but i can't figure out how to do it. I am in PHP code already after processing a form, i thus want to add the product to the cart in PHP also. in the standard installation everything happens in ajax/javascript, and I have very less experience with that. i can't see how to add products to the cart in just PHP. can anyone help me with this? Link to comment Share on other sites More sharing options...
A-Z Hosting Posted January 10, 2012 Share Posted January 10, 2012 Don't know what all you've accounted for in your scripting, but if you've used init.php and $cart is available try adding it with this: $cart->updateQty('1', $id_product, '', '', ''); That's all I'm doing in the controller I'm currently writing and it works great. Add it before forking over to smarty and it will show in your shopping cart just fine. Link to comment Share on other sites More sharing options...
dhobo Posted January 12, 2012 Author Share Posted January 12, 2012 thanks, that seems to work Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now