*

morfik

  • ****
  • 169 posts
Missing „priceCurrency” in „offers”
« on: March 04, 2023, 10:21:20 AM »
Google started complaining about the missing „priceCurrency” field in „offers” . It looks like that the warning appears when the ad is free -- it costs 0.  Looking through the code I found the following in oc-includes/osclass/structured-data.php :

Code: [Select]
<?php if(osc_item_price() > 0) { ?>"priceCurrency": "<?php echo osc_esc_html(osc_item_currency()); ?>",<?php echo PHP_EOL; } ?>
So it looks like that the IF should be removed to satisfy google and the currency should always be printed even if the price is 0. Like with the price field -- it's always printed.

I'm guessing the line should look like this:

Code: [Select]
"priceCurrency": "<?php echo osc_esc_html(osc_item_currency()); ?>",

*

MB Themes

Re: Missing „priceCurrency” in „offers”
« Reply #1 on: March 07, 2023, 01:07:31 PM »
@morfik
Yes that sounds good.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots