Schema not updating – when switching currency

#241765
  • Resolved Jim C
    Rank Math free

    Hi there,

    We have a site in GBP currency, when the currency switcher changes to EU or USD, the schema stays in the base currency of woocommerce – GBP.

    How can we improve this, as right now – USA customers are seeing prices in GBP and not USD in search results / schema markup.

    Please advise,

    J

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    If you are using the WooCommerce Product Schema from our plugin, this takes the currency and values directly from WooCommerce settings and outputs them in the Schema markup.

    This type of Schema uses the variable %wc_price% to output the correct values, but if the dynamic change of currency is not being passed along to WooCommerce the Schema can’t also detect these changes.

    ​​​​​​​Hope this helps clarify your doubts.

    Don’t hesitate to get in touch if you have any other questions.

    Jim C
    Rank Math free

    Thanks Miguel!

    This is the issue – “if the dynamic change of currency is not being passed along to WooCommerce the Schema can’t also detect these changes”.

    How would we update the rank math schema to match the currency that is being shown on the front end – currency switcher?

    Thank you,

    J

    Hello,

    Our variable used in the WooCommerce Product Schema gets the active price for the product and passes that in the Schema markup. If any plugin that you use sets the active product price then the variable will fetch the values accordingly.

    To make sure that the currency switcher plugin sets the active price and doesn’t mask it only to show to the user we recommend that you get in touch with the plugin developers and ask that specifically.

    Hope this helps solve your issue.

    Don’t hesitate to get in touch if you have any other questions.

    Jim C
    Rank Math free

    Hi there,

    thanks for your reply.

    could you advise where to hide the woocommerce product price from being shown in OG data? using rank math.

    thank you,

    J

    Tammy
    Rank Math business

    Hello,

    It is possible to remove certain properties from the rich snippet. You can add the following code to your theme’s functions.php file to remove the price:

    /**
     * Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
     * Replace $schmea_type with schema name like article, review, etc.
     * @param array $entity Snippet Data
     * @return array
     */
    add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
     unset($entity['offers']['price']);
     return $entity;
    });

    Looking forward to helping you. Thank you.

    Jim C
    Rank Math free

    thanks

    Tammy
    Rank Math business

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this ticket.