1
Answers
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
Comments
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.
(https://www.thewichitacomputerguy.com/blog/how-add-ubercart-products-goo...)
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...
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.