You’re going to want to use hooks and filters to change that. I would look at the woocommerce_get_price_html
and/or woocommerce_variable_price_html
filters.
EDIT:
here is the core WC code you need to alter:
/**
* Format a sale price for display.
*
* @since 3.0.0
* @param string $regular_price Regular price.
* @param string $sale_price Sale price.
* @return string
*/
function wc_format_sale_price( $regular_price, $sale_price ) {
$price="<del>" . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . '</del> <ins>' . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . '</ins>';
return apply_filters( 'woocommerce_format_sale_price', $price, $regular_price, $sale_price );
}
as you can see, there’s a filter on the returned value. what you want ot do is hook into that filter and return the prices how you want. something like this:
add_filter('woocommerce_format_sale_price', 'wc_override_sale_price_format', 10, 2);
function wc_override_sale_price_format( $regular_price, $sale_price ) {
$price="<ins>" . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . '</ins> <del>' . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . '</del>';
return $price;
}