Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Woocommerce remove add to cart message

add_filter( 'wc_add_to_cart_message_html', '__return_null' );
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

WooCommerce Change Add To Cart Button Text

add_filter('woocommerce_product_single_add_to_cart_text', 'exploretech_change_woocommerce_custom_add_to_cart_text', 11, 2);
function exploretech_change_woocommerce_custom_add_to_cart_text($text, $product) {
    return "My Custom Text";
}
Comment

WooCommerce Change Add To Cart Button Text

add_filter('woocommerce_product_add_to_cart_text', 'exploretech_change_woocommerce_custom_add_to_cart_text', 11, 2);
function exploretech_change_woocommerce_custom_add_to_cart_text($text, $product) {
    return "My Custom Text";
}
Comment

WooCommerce Change Add To Cart Button Text

add_filter('woocommerce_product_single_add_to_cart_text', 'exploretech_change_woocommerce_custom_add_to_cart_text', 11, 2);
function exploretech_change_woocommerce_custom_add_to_cart_text($text, $product) {
   if ('31' ==$product->get_id()) {
     return 'Customized Text';
   }
   $product_categories = $product->get_category_ids();
   if (in_array('19', $product_categories)) {
      //if product has category with id=19 (say Tshirts)
      return 'ExploreTech Customized Text';
    }
    return $text;
}
Comment

WooCommerce Change Add To Cart Button Text

add_filter('woocommerce_product_single_add_to_cart_text', 'exploretech_change_woocommerce_custom_add_to_cart_text', 11, 2);
function exploretech_change_woocommerce_custom_add_to_cart_text($text, $product) {
    $extech_product_type = $product->get_type();
    if ('simple' == $extech_product_type) {
       return "Simple Product";
    }

    if ('variable' == $extech_product_type) {
      return 'Variable Product';
    }
    return $text;
   //You can also do this with switch statement
}
Comment

PREVIOUS NEXT
Code Example
Php :: php convert 
Php :: php foreach alternative syntax 
Php :: compare dates datetime php 
Php :: pg_dump with user name password 
Php :: name of today php 
Php :: php pdo error handling 
Php :: Laravel Retrieve All Session Data 
Php :: base url dinamis codeigniter 
Php :: transfer file using file_get_content 
Php :: php count 
Php :: how to add share icon in wordpress 
Php :: type casting in php 
Php :: function () ?type{} in php 
Php :: laravel collection pipe 
Php :: php match 
Php :: cviebrock/eloquent-sluggable 
Php :: thousand seperator php 
Php :: laravel npm run deve error mix 
Php :: if condition in php 
Php :: array intersect 
Php :: php check if string contains url 
Php :: adminlte 3 laravel 
Php :: Array and string offset access syntax with curly braces is deprecated 
Php :: docker : from php alpine 
Php :: root composer.json requires php ^7.3 but your php version (8.0.3) does not satisfy that requirement. 
Php :: php var use in javascript 
Php :: Eloquent models events 
Php :: how to data save usigng request all laravel 
Php :: PHP similar_text — Calculate the similarity between two strings 
Php :: php excel to array 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =