Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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
}
Source by exploretech.dev #
 
PREVIOUS NEXT
Tagged: #WooCommerce #Change #Add #To #Cart #Button #Text
ADD COMMENT
Topic
Name
8+1 =