woocommerce product showing two “Add to Cart” butt

2019-09-02 20:58发布

I am using woocommerce plugin, It is showing products details on desktop view is correct but when i switch on mobile view or tablet(i.e. responsive) view then it shows two "Add to Cart" button for one product.

2条回答
我欲成王,谁敢阻挡
2楼-- · 2019-09-02 21:40

If someone is struggeling with this, add this code to wordpress > wp-content > plugins > woocommerce.php in function WC() right before return WooCommerce::inherit();

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );

this will remove the button.

查看更多
贼婆χ
3楼-- · 2019-09-02 21:44

Single product is displayed from wp-content\plugins\woocommerce\templates\single-product.php

This file (wp-content\plugins\woocommerce\templates\content-single-product.php) is called from single-product.php for adding content and add-to-cart button on single product page.

查看更多
登录 后发表回答