Hello,
We apologize for the issue you are facing with the currency settings in your WooCommerce Schema. Thank you for providing detailed information about the problem.
-
Setting the Currency to IRT in Rank Math WooCommerce Schema:
- Currently, Rank Math uses the currency settings configured in WooCommerce. To ensure that the currency is set to IRT, please double-check that you have correctly set it under WooCommerce → Settings → General. Make sure that the currency code is correctly entered as IRT.
- If the currency is still showing as IRR in the Schema after confirming this setting, it may be a limitation within Rank Math’s handling of specific currencies. In this case, we recommend replying to this ticket so a human agent from the Rank Math Support team can assist you further.
-
Fixing the Incorrect Price in Google Search Results:
- The display of the price as "¤45,600,000.00" with two decimals is likely due to the incorrect currency code being used (IRR instead of IRT). Once the currency issue is resolved, this should also correct how the price appears in Google search results.
- Additionally, ensure that you have set the Number of Decimals to 0 in your WooCommerce settings, which you have already mentioned. This should help eliminate any unwanted decimal places.
If these steps do not resolve your issues, please reply to this ticket, and a human agent will take over and provide further assistance.
Thank you for your understanding, and we appreciate your patience as we work to resolve this matter!
Hello,
Thank you for your query and we are so sorry about the trouble this must have caused.
Can you please confirm if you have set the WooCommerce currency long after the Woocommerce product schema is set? If so, can you please remove the Woocommerce Product
schema and add it back to the product page again?
If that doesn’t fix the issue, please try using the filter code below to forcibly set the currency:
add_filter('rank_math/snippet/rich_snippet_product_entity', function ($entity) {
if (!is_product()) {
return $entity;
}
$product = wc_get_product(get_the_ID());
if (!$product->is_type('variable')) {
return $entity;
}
$variations = $product->get_available_variations();
if (!empty($variations)) {
$offers = [];
foreach ($variations as $variation) {
$price_valid_until = get_post_meta($variation['variation_id'], '_sale_price_dates_to', true);
$offers[] = [
'@type' => 'Offer',
'description' => $entity['description'],
'price' => $variation['display_price'],
'priceCurrency' => 'IRT',
'availability' => $variation['is_in_stock'] ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock',
'priceValidUntil' => $price_valid_until ? date_i18n('Y-m-d', $price_valid_until) : '2025-12-31',
'itemCondition' => 'http://schema.org/NewCondition'
];
}
}
$entity['offers'] = $offers;
return $entity;
});
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how that goes. Looking forward to helping you.
Woocommerce currency setting has been set long ago, before adding any product.
I’ve tried:
1- Changing currency to IRR and back again to IRT.
2- Remove the default schema and add it again to products.
3- Add filter code above to forcibly set the currency.
Unfortunately non of this solutions worked.
I’m using rankmath PRO.
The snippet code you provided above work on both rankmath and rank math pro, right?
Hello,
Yes, the filter should also work in Rank Math PRO.
However, you mentioned that you’re using Rank Math PRO but the account you have used to open this ticket is the Rank Math free version.
Can you please search and forward a receipt from FastSpring.com or the email address you used to purchase so we can locate your account and verify it?
Looking forward to helping you.
PRO version is active on my colleague’s account and it’s active but i don’t have access to it.
However, unfortunately the snippet code Jeremy provided above does not work.
Any idea why there is problem in displaying currency in google search results?
There is 2 decimals that shouldn’t be there. and IRR currency displaying as ¤
Hello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.