Change ‘Add to cart’ text to custom on button – WooCommerce


add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );


function custom_woocommerce_product_add_to_cart_text() {


global $product;


$product_type = $product->product_type;
switch ( $product_type )

{
case 'external':
return __( 'More', 'woocommerce' );
break;
case 'grouped':
return __( 'More', 'woocommerce' );
break;
case 'simple':
return __( 'More', 'woocommerce' );
break;
case 'variable':
return __( 'More', 'woocommerce' );
break;
default:
return __( 'More', 'woocommerce' ); }
}

Change ‘Add to cart’ text to custom on button – WooCommerce

Change text for dropdown of variable products to choose – WooCommerce

Edit red coloured for your situation and add this code to functions.php

function my_dropdown_variation_attribute_options_html($html, $args){
$html = str_replace('Choose an option', 'Size options', $html);
return $html;
}
add_filter('woocommerce_dropdown_variation_attribute_options_html', 'my_dropdown_variation_attribute_options_html', 10, 2);

Change text for dropdown of variable products to choose – WooCommerce

Add custom jQuery script to WordPress theme

How to add custom jQuery script to WordPress theme ?

Code for functions.php to add jQuery script from file to theme directory and js folder:

function add_js_for_theme() {
wp_enqueue_script( 'js-custom', get_stylesheet_directory_uri() . '/js/js-custom.js');
}

add_action( 'wp_enqueue_scripts', 'add_js_for_theme', 10 );

And jQuery script “js-custom.js” when website is loaded:

File location: “YourTheme/js/js-custom.js”

jQuery(document).ready(function(){

});

When jQuery is used for WordPress script must use jQuery instead of $ sign.

Add custom jQuery script to WordPress theme