Skip to content

Instantly share code, notes, and snippets.

@raphaelchaib
Created December 12, 2013 16:18
Show Gist options
  • Select an option

  • Save raphaelchaib/7930687 to your computer and use it in GitHub Desktop.

Select an option

Save raphaelchaib/7930687 to your computer and use it in GitHub Desktop.
WooCommerce: Changes how price is displayed
<?php
// Changes how price is displayed
add_filter( 'woocommerce_get_price_html', 'wpa83367_price_html', 100, 2 );
function wpa83367_price_html( $price, $product ){
$return = str_replace( '<ins>', 'Por: <ins>', $price );
$return = str_replace( '<del>', '<small class="price-from">De: <del>', $return );
$return = str_replace( '</del>', '</del></small><br/>', $return );
return $return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment