问题
i simply can't find a solution to my problem! The quantity field worked as it should. After a few months of programming on the whole shop, i wanted to test the quantity field and recognized that it doesn't function.
I only can add one product to the cart although i typed “3” in the quantity field.
I didn’t change anything in product/view.phtml and addtocart.phtml. Don't know where i have to search for this error. Maybe someone can give me a tip...
greets max
回答1:
The quantity field is used in the various product type prepareForCart
functions. Did you override any of your product classes?
回答2:
solved
In my case, the button add to cart had not the original
onclick="productAddToCartForm.submit(this)"
With this method is not only the product submitted, the quantity is beeing submitted, too. In my on click was
onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"
This sent the data via GET and did it always without the quantity. Personaly I do not know, what, why or when the change occured to the view.phtml.
Hope this helps :)
来源:https://stackoverflow.com/questions/2958750/magento-quantity-field-doesnt-work