Search
 
SCRIPT & CODE EXAMPLE
 

PHP

woocommerce remove add to cart

// functions.php
add_filter( 'woocommerce_loop_add_to_cart_link', '__return_false' );
Comment

remove add to cart woocommerce button

function chiefthemes_remove_addcart() {
   $product = get_product();
   if ( has_term ( 'category-name', 'product_cat') ) {
       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 );
       remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
       remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 );
       remove_action( 'woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30 );
       remove_action( 'woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30 );
   }
}
add_action( 'wp', 'chiefthemes_remove_addcart' );
Comment

Woocommerce remove add to cart message

add_filter( 'wc_add_to_cart_message_html', '__return_null' );
Comment

remove add to cart woocommerce button

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');
Comment

Woocommerce change add to cart message

add_filter( 'wc_add_to_cart_message_html', 'exploretech_custom_add_to_cart_message_html' );
function exploretech_custom_add_to_cart_message_html() {
  $ext_custom_message = "You have successfully added the product, thanks for shopping with us";
  return $ext_custom_message;
}
Comment

PREVIOUS NEXT
Code Example
Php :: hello world in php 
Php :: next year php string 
Php :: php artisan orderByDesc 
Php :: php conditionally remove element from array 
Php :: how to completely delete php 
Php :: laravel search query 
Php :: Command for single migration in larvel 
Php :: wp get_posts return ids 
Php :: php even odd program 
Php :: Convert String containing commas to array 
Php :: send OTP php 
Php :: artisan make migration with model 
Php :: php get all in object as array 
Php :: update php version in laravel 
Php :: laravel mutators 
Php :: laravel bootstrap-auth setup 
Php :: php day of week full name 
Php :: laravel pluck relationship 
Php :: define site url wordpress 
Php :: html special characters php 
Php :: this page isn t working http error 500 laravel on server 
Php :: laravel where multiple values 
Php :: make project in laravel 7 
Php :: laravel without global scopes 
Php :: check for headers laravel 
Php :: Day of Week Using carbon library 
Php :: wordpress get user data from email 
Php :: array helper array_push laravel 
Php :: php ical 
Php :: laravel npm run dev mix error FIX 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =