woocommerce product showing two “Add to Cart” button on responsive mobile/tablet view?

我的未来我决定 提交于 2019-12-11 22:16:06

问题


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.



来源:https://stackoverflow.com/questions/25738937/woocommerce-product-showing-two-add-to-cart-button-on-responsive-mobile-tablet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!