Woocommerce ปิดปุ่ม Add to Cart ได้หลายวิธี เช่น Plugin , CSS , PHP
I was able to hide the Add to Cart button by Plugin:
Plugin : WooCommerce Product Archive Customiser
// สามารถปิดปุ่ม Add to Cart ได้เฉพาะที่หน้า Listing Product เท่านั้น
I was able to hide the Add to Cart button by CSS:
1 2 3 4 |
.woocommerce .products .add_to_cart_button { display: none!important; /* Hides the Add to Cart button on the thumbnail pages */ } |
I was able to hide the Add to Cart button with just PHP:
first, put a folder called woocommerce in your theme’s folder
then create a file in this folder wp-content/themes/###your-theme###/functions.php
//ปิดปุ่ม Add to Cart ได้ทั้งหน้า Listing และ Single Page
1 2 3 4 5 |
function remove_loop_button(){ remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); } add_action('init','remove_loop_button'); |
Comments are closed.