Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.3
Component:
Price
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Dec 2012 at 21:46 UTC
Updated:
20 May 2013 at 23:46 UTC
I'm trying to change the weight of tax rates because I want a certain rate to always be on top of the second one (TPS & QST for Quebec, Canada) in the invoice and the cart. I made it work for shipping rates but I still can't with tax rates. I searched and tried several things.
Here's my module's code at this point:
function MYTHEME_commerce_price_formatted_components_alter(&$components, $price, $entity) {
if (isset($components['commerce_tax_rate_tps'])) {
$components['commerce_tax_rate_tps']['weight'] = 1;
}
if (isset($components['commerce_tax_rate_quebec'])) {
$components['commerce_tax_rate_quebec']['weight'] = 2;
}
}
Can someone help please? :-)
Comments
Comment #1
rszrama commentedYou'd actually need to adjust the weight of the price component types themselves using hook_commerce_price_component_type_info_alter().