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.

5

use following code

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

instead of

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

for the configurable products.

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.

  • 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 May 19 '15 at 7:48
  • Is there any other way to do this? – Piyush May 19 '15 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 Nov 8 '18 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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