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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
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.