I needed to reorder the default output of the Commerce Price Savings Formatter. Instead of the List Price, Sale Price, then Discount/Savings order I needed List Price, Discount/Savings, then Sale Price. It was suggested that I implement via preprocess and reorder. So, this is what I came up with and it works for me.

Thanks to recrit for the help!

function YOURTHEMENAME_preprocess_commerce_price_savings_formatter_formatter(&$variables) {
	$temp['list'] = $variables['prices']['list'];
	$temp['savings'] = $variables['prices']['savings'];
	$temp['price'] = $variables['prices']['price'];
	$variables['prices'] = $temp;
}

Result:
list, savings, price
The result also shows some label overrides.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benschaaf’s picture

Issue summary: View changes

The result image also shows some label overrides.

romstach’s picture

Issue summary: View changes

Hi

i applied this function in my template.php but nothing happen...

i have 7.x-1.4 version.

Thank's for your help