Vote up!
Vote down!

Views price format for Google merchant

How do I get the pricing in the right format for google merchant using views, or should I use something else?

As I see it Google wants a price in the format '250.00 USD'.

The issue I have is I can use Commerce Produce:Price and then select Raw amount and rewrite the result using [commerce_price-amount] [commerce_price-currency_code], giving me '25000 USD', but I can't get it to include the decimal point without switching to Formatted amount which then includes the $ sign at the beginning.

I have seen the Commerce Google Merchant Integration module but take up is really low so I assumed a view was the more popular way.

All help appreciated

Asked by: James A
on September 30, 2012

1 Answer

Vote up!
Vote down!

Take a look at this module, see if it helps.


Josh Miller
Answer by: Josh Miller
Posted: Nov 16, 2012


commerce_extra_price_formatters does NOT work. Drupal Commerce is hard coded to show the currency symbol and there is NO WAY (that I have found) to strip it out without manually coding it. Price formatters weren't thought through very well when it was implemented...

I've managed to strip out the symbol from the xml feed using a views template and the line:

<?php echo substr($output, 1 ); ?>

However I can't get rid if the symbol when trying to use a view to generate the microdata because the views template doesn't seem to work when the field is excluded and used as a replacement pattern in a views area for the header/footer.


If anyone knows how to get rid of the stupid symbol in views, please share. If you know of a GUI based module that would be fantastic, but I'll settle for come custom views template code at this point.

P.S. I don't code, so whatever is shared will have to be posted to copy/paste.

Commerce 1.x is so insanely frustrating...

- philsward on April 11, 2018

It is by pure accident that I've seen your reply on a 6.5 year old post, made in a deprecated part of the site.

If you have a frustration, the issue queue is the place to share it. Otherwise you're just howling into the wind.
"Provide a way to render a price without a currency symbol" sounds like a reasonable feature request.

- Bojan Zivanovic on April 15, 2018