fbpx

WOOCOMMERCE : Change add to cart button text

Add this on your functions.php

/**
 * Change the add to cart text on single product pages
 */
function woo_custom_cart_button_text() {
	return __('My Button Text', 'woocommerce');
}
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');


/**
 * Change the add to cart text on product archives
 */
function woo_archive_custom_cart_button_text() {
	return __( 'My Button Text', 'woocommerce' );
}
add_filter( 'add_to_cart_text', 'woo_archive_custom_cart_button_text' );

WOOCOMMERCE : Add a custom currency / symbol

Add this on your functions.php

add_filter( 'woocommerce_currencies', 'add_my_currency' );
 
function add_my_currency( $currencies ) {
     $currencies['ABC'] = __( 'Currency name', 'woocommerce' );
     return $currencies;
}
 
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
 
function add_my_currency_symbol( $currency_symbol, $currency ) {
     switch( $currency ) {
          case 'ABC': $currency_symbol = '$'; break;
     }
     return $currency_symbol;
}

WOOCOMMERCE : Change a widget title

Add this on your functions.php

add_filter( 'widget_title', 'woo_widget_title', 10, 3);

function woo_widget_title( $title, $instance, $id_base ) {
	
	if( 'onsale' == $id_base) {
		return "My new title";
	}
}