Problem with priceCurrency Schema in Merchant Listings when WooCommerce Currency

#1030309
  • Resolved mohamad sabetnam
    Rank Math free

    Problem with priceCurrency Schema in Merchant Listings when WooCommerce Currency is Toman (Iran)

    Hello Rank Math Support,

    I’m facing a persistent issue with the product schema generated by Rank Math for WooCommerce.

    My store is based in Iran, and the WooCommerce currency is set to Toman (تومان), which is the common currency used for pricing in Iranian online stores. However, Google Merchant Center requires a valid ISO 4217 currency code (like IRR) for structured data.

    Here’s the problem:

    Since Toman is not a valid ISO 4217 code, Google Merchant Center flags my product schema with the following error:

    “Invalid ISO 4217 currency code in priceCurrency”

    If I change the WooCommerce currency to IRR (Rial), the schema becomes valid and the error disappears, but this causes confusion for customers because prices are displayed in the wrong unit (Rial is 10x smaller than Toman).

    I tried using the following code snippet (based on your filters) to force the schema’s priceCurrency value to be ‘IRR’, while keeping the frontend display in Toman:

    php
    Copy
    Edit
    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
    if ( ! is_product() ) {
    return $entity;
    }

    if ( isset( $entity[‘offers’][‘@type’] ) ) {
    $entity[‘offers’][‘priceCurrency’] = ‘IRR’;
    }

    return $entity;
    }, 20 );
    However, this doesn’t resolve the issue. Google still reports the same error even after clearing caches and verifying the rendered JSON-LD markup. I suspect Rank Math may be using internal WooCommerce currency settings that override this filter when rendering the final schema.

    Could you please help us achieve this behavior properly?

    Desired behavior:
    Keep WooCommerce currency display as Toman on the frontend

    Force Rank Math schema to use priceCurrency: “IRR” in the structured data

    Any guidance or fix (maybe a specific hook, filter, or setting) would be very much appreciated.

    Thank you in advance!

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Could you please share a sample product so we can check as well?

    Also, are you using product variation on your site?

    Meanwhile, please try using this filter and let us know if the priceCurrency property is updated:

    add_filter( "rank_math/snippet/rich_snippet_course_entity", function( $entity ) {
        $entity['offers']['priceCurrency'] = 'IRR';
      return $entity;
    });
    

    Looking 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.

Viewing 1 replies (of 1 total)

The ticket ‘Problem with priceCurrency Schema in Merchant Listings when WooCommerce Currency’ is closed to new replies.