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

How to add an icon next to menu item in navigation ?

Firstly, turn on view for CSS classes: “Screen options – CSS classes”.

Next, add CSS class to menu item by Editing menu items in Customiser.

And add custom CSS by defining your icon source and position. Probably the best way is to make original size icon for menu. You can also make transparent icon and make it’s custom position right on image, by this way you do not need to position icon image with CSS.

.menuicon {

background-image: url(‘http://www.example.com/wp-content/uploads/2017/07/home.png’);

background-repeat: no-repeat;
padding-left: 5px
background-position: left;

}

How to add an icon next to menu item in navigation ?

Translation with CSS

A way to translate a part of HTML document with CSS, although you have all translations in one place hidden so it is not recommended for SEO, this way also overwrite the same CSS rule, but sometimes it may be useful. CSS defines language from HTML header document information, for example for English it would be “lang=en”.

span #textblock_en {display: none;}
span #textblock_fr {display: none;} 
span #textblock_ru {display: none;}

:lang(en) #textblock_en {display: block;}
:lang(fr) #textblock_fr {display: block;}
:lang(ru) #textblock_ru {display: block;}

Translation with CSS

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