2

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.

2 Answers 2

5

use following code

<?php echo $this->helper('checkout/cart')->getAddUrl($_product) ?>

instead of

<?php echo $this->getSubmitUrl($_product) ?>

for the configurable products.

0
4

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.

3
  • 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.
    – Piyush
    Commented May 19, 2015 at 7:48
  • Is there any other way to do this?
    – Piyush
    Commented May 19, 2015 at 9:36
  • Suppose one knows all ids/options: how would we generate the addtocarturl that adds the configurable product and associatedoption in 1 click?
    – snh_nl
    Commented Nov 8, 2018 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.