Woocommerce: Add Cart in Single Product page does not working

时间:2016-05-13 15:35:02

标签: wordpress woocommerce

I am new to WooCommerce.

Interestingly, Add Cart in single product page does not working (No response at all). However, when I am in Shop page (shows multiple products), that "add to Cart" button works. Can anyone tell me what is wrong with this?

The website is this: http://dev.myhexa.com/shop/hexa-bluesky-lucky/

Best Regards,

1 个答案:

答案 0 :(得分:0)

您的单个​​产品模板存在根本错误。 HTML表单需要提交按钮而不是锚标记。

把这个

<input type="submit" data-quantity="1" data-product_id="<?php echo $product->id; ?>" class="single_add_to_cart_button add_to_cart_button  product_type_simple button alt" value="Add to cart" />

而不是这个

<a data-quantity="1" data-product_id="1162" class="single_add_to_cart_button add_to_cart_button  product_type_simple button alt">Add to cart</a>

您可以在theme-dir/woocommerce/single-product/add-to-cart/simple.php

中找到这些标记