Created
August 13, 2013 10:35
-
-
Save dziudek/6219958 to your computer and use it in GitHub Desktop.
Change ordering of the sale price and original price in WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* 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