简体   繁体   中英

How to add products to cart from category page

On the form in the product page ( found in /template/catalog/product/view.phtml ) there is action="<?php echo $this->getSubmitUrl($_product) ?>" , which creates a url to add a product to the cart with the specified quantity.

However, when trying to use this to add products to the cart from the category page, the function does not return anything. What is the Mage path to use the function? For example, Mage::getModel('catalog/product')->load($relatedProductId); . What is the correct way to call getSubmitUrl() from outside the product page?

read this post, it could be helpfull

http://www.magentocommerce.com/boards/viewthread/222020/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM