Engine23

Magento error: The stock item for Product is not valid.

This can have many causes as your search through the internet has obviously found. My problem with this particular issue was I had my products setup properly, so it was not the fact that it was out of stock. This site almost had me excited but only to find out my product creation script already took care of it: http://zaclee.net/magento/errors-magento/stock-item-for-product-is-not-valid So, after some hard core searching, I found that I was not using the proper product object. The only way I could get my auto add to cart working was to use this $product = Mage::getModel('catalog/product')->load($product_id); I had a different product object, ( loading by the sku ) and apparently you can not use that type of object to add items to the cart. 5 hours of my life lost, hopefully to spare yours.

Share: