I am currently working on creating a Cart control module on Magento 1.9
I am stuck in adding a product to my cart (I have tried many different things) and therefore I am turning to you for help.
My module extends the rest of the magento APIs, and I already managed to update my cart (number of products), but now I want to add a new product through the POST method. Of course, I am registered as a client. I have defined creation rights for this role. (I can do the update without any problems)
Here is my code:
protected function _create(array $data){ $store = $this->_getStore(); Mage::app()->setCurrentStore($store->getId()); $cart = Mage::getModel('checkout/cart'); $cart->init(); $productCollection = Mage::getModel('catalog/product')->load(4);
In this simple example, I am trying to add product identifier 4 in the amount of 1. My problem is that I have no errors in the log and everything seems to be gone. But when I get my cart, there is no product to add ...
In response, I have the code 200 OK
Do you have any suggestions to help me?
Many thanks for your help
considers
source share