Skip to content

Instantly share code, notes, and snippets.

@dziudek
Created August 13, 2013 10:35
Show Gist options
  • Save dziudek/6219958 to your computer and use it in GitHub Desktop.
Save dziudek/6219958 to your computer and use it in GitHub Desktop.
Change ordering of the sale price and original price in WooCommerce
/**
*
* Code used to change the price order in WooCommerce
*
**/
function PREFIX_woocommerce_price_html( $price, $product ){
return preg_replace('@(<del>.*?</del>).*?(<ins>.*?</ins>)@misx', '$2 $1', $price);
}
add_filter( 'woocommerce_get_price_html', 'PREFIX_woocommerce_price_html', 100, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment