cancel
Showing results for 
Search instead for 
Did you mean: 

Product Listing page add to cart button validation is not working in magento 2

Product Listing page add to cart button validation is not working in magento 2

Hi guys,

                I have writtern my custom addto cart button in one listing form. When ever i click on drop down configurable add to cart button of particular product it is not redirecting to product view page instead its redirecting to same page. But for the products which are having swatches its redirecting to product view page. Below is my button code. Can anyone help me ?

 

<div class="customAddtocart">
<form data-role="tocart-form" action="http://demo.trayii.com/kakarot.html?options=cart" method="post">
<input name="form_key" type="hidden" value="SOIY7aiVNoU5HE8T"> <div class="btn">
<button type="submit" title="Add to Cart" class="action tocart primary">
<span class="customATC">Add to Cart</span>
</button>
</div>
</form></div>