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 confirm if you’re using a separate plugin for the discount/sale price on your products?
Our plugin fetches the discounted price for the Schema you have entered in the WooCommerce fields. Also, are you using the WooCommerce Product schema on your site?
Looking forward to helping you.
Thank you.
I’m using the plugin Woo Discount Rules Free. And I’m using the product schema in the product page
Hello,
In this case, Rank Math wasn’t able to read that plugin and apply the discounted price on your product schema.
To address this, you may use our filter to further extend the schema structure of your product and include the discounted price coming from the plugin you mentioned.
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
return $entity;
});
You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Please note that you need to determine first how to extract the data from that plugin and apply it to our schema. The filter needs customization for that.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
I contacted to the developer of the plugin and they send me this link to fix the problem: https://gist.github.com/AshlinRejo/c37a155a42c0e30beafbbad183f0c4e8
can you help me to create the filter please? Thanks
Hello,
You can share the filter shared by my colleague here with the developers of the plugin you are using to add the discounted price as they will be in a better position to help you further with the customization: https://support.rankmath.com/ticket/sale-price-doesnt-show-on-gmc/?view=all#post-527543
Let us know if they need any details from our end for the customization.
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.