On product page the product form has given action = <?php echo $this->getSubmitUrl($_product) ?>.
I want to get this submit url on category page for each product but on category page it returns different URL for Configurable Product. how to get the same Submit url on category page for Configurable Product.
Add a comment
|
2 Answers
use following code
<?php echo $this->helper('checkout/cart')->getAddUrl($_product) ?>
instead of
<?php echo $this->getSubmitUrl($_product) ?>
for the configurable products.
The reason that the configurable product urls are different is that they need to be configured before they can be added to the cart. Unlike simple, virtual and downloadable products that can be added to the cart without any configuration.
-
I have added the Configurable product option to the list page as well and is working very fine. and now i want to add to cart that products directly from the category page that's why i am trying to get the url's.– PiyushCommented May 19, 2015 at 7:48
-
-
Suppose one knows all ids/options: how would we generate the addtocarturl that adds the configurable product and associatedoption in 1 click?– snh_nlCommented Nov 8, 2018 at 13:09