This causes formatted token replacement in rules to fail for commerce_price fields. Coincidentally, formatted tokens do work with the default field called commerce_price, but only because the field name is the same as the instance and tokens are keyed off of field name.

To reproduce, create a new instance of commerce_price field and try to use the formatted token in a system message or mail action.

I believe this can be easily fixed by adding "commerce_price_formatted_amount" as the default token formatter in the field info of the commerce_price field. See attached.

Comments

helior’s picture

Status: Active » Needs review
helior’s picture

StatusFileSize
new1.87 KB

Coolio. I went ahead and also added a default_token_formatter for Commerce product reference field.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patches and review -> committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

foopang’s picture

Not sure if it is relevant, I just wonder if it is possible to use a different price formatter other than default with dynamic tokens.