A simple, powerful and independent e-commerce platform.
Sell anything with ease.

Change text on sale button

Classic Commerce puts a small “Sale” tag on the corner of the item image when a sale price is set for that product. You can change the text on this button with the code below. Note you will probably also need to adjust the css to fix the format if you are using a longer word or phrase.

		/** 
 * Change text on sale button
 */

add_filter('woocommerce_sale_flash', 'cc_custom_sale_text', 10, 3);

function cc_custom_sale_text($text, $post, $_product) {

  return '<span class="onsale">NewText</span>';

}
	
View Raw Code ID: 9971