Hello,
Thank you for contacting Rank Math today.
You can use the following code snippet to customize the product snippet data and assign a new offer price to your products:
/**
* 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_{$schema_type}", function( $entity ) {
return $entity;
});
Please take a look at this page for more info on this:
Rank Math Filters for developers
Looking forward to helping you. Thank you.
Hi there
Thanks for reply, though i dont want a custom snippet, only want to show the price inclusive vat instead of ex. vat in the rich snippets. All prices on the pages is incl. vat. According to European law prices has to be stated with incl. vat. You will get warnings from Google and they wont accept offerprices in the merchant importe when there are such a huge difference from the snippet price and the price stated on the website. Your plugin shows the price ex. vat. I have deactived the price in the snippet for now but it is a problem.
Hello,
Thank you for the response.
I have submitted this feedback to our developers and we will get back to you in a short while.
We appreciate your patience. Thank you.
Hello Michael
Thanks, have a great day.
Hello,
To show price inc VAT in the schema data, please add below filter code in your theme’s functions.php file:
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
global $product;
$entity['offers']['price'] = wc_get_price_including_tax( $product );
return $entity;
});
Hope that helps. Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
The schema data on the product page which you added in the Sensitive Data Section is showing 45DKK price, isn’t it right? That’s what I see on your page.
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.