I needed to customize an order confirmation email using commerce_message and was surprised that the commerce_order_total field token does not have any of its components broken out into separate tokens.

The commerce_order_total components I needed were base-price, shipping, VAT.

I was able to declare the tokens i needed using hook_token_info(). Then to replace the token values implemented hook_tokens().

These should already be available in commerce-order tokens but they are not.

The tokens for the base-price, tax, vat, shipping components should be there as a bare minimum!

Have I missed something?

Comments

inventlogic’s picture

Issue summary: View changes

grammar

Summit’s picture

Hi,
I completely agree with @inventlogic. These tokens are very necessary .
In Europe we need to add VAT most of the time to the shipping. This needs to be correctly shown on the orderform and email through tokens.
With these tokens at the minimum: base-price, tax, vat, shipping this can be handled.

Greetings, Martijn

Summit’s picture

Hi, I build this short term solution: http://www.drupalcommerce.org/questions/9046/add-tokens-commerce-order-t... but can;t get it to work yet...
I know this is not the correct solution, but he, you do what you can...

Greetings, Martijn

Summit’s picture

Issue summary: View changes

layout

Pasqualle’s picture