Hello,
Thank you for your reply.
The error is related to the missing Product ID in the schema. The product ID is not added to the schema data yet, but we have in our plan to add it in the future.
Luckily, we have an API, so if you know about coding or have some dev, you could add the missing IDs, for now, to extend the JSON-LD data using this filter: https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data
Following the requirements told by Facebook here: https://developers.facebook.com/docs/marketing-api/catalog/guides/microdata-tags#json-ld
Here is a code to give you you direction on how to apply this:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if ( isset( $data['Product'] ) ) {
$data['product']['additionalProperty'] = ['@type' => 'PropertyValue',
'propertyID'=> 'item_group_id',
'value'=> 'fb_tshirts'];
}
return $data;
}, 99, 2 );
I hope this helps.
Thanks.
Ok, as my technical skills are not that high I would like to ask:
1. Is this code pasted into my functions.php
2. If I want the product ID to change dynamically depending on the SKU or product number that wordpress gave each product, how do I achieve this.
3. What about the price range issue?
Hello,
Thank you for your reply,
1. Is this code pasted into my functions.php
Yes, you need to put the code inside your theme’s function.php
2. If I want the product ID to change dynamically depending on the SKU or product number that WordPress gave each product, how do I achieve this.
to get the current page product ID, you can use code like this :
global $product;
$id = $product->get_id();
However, there are multiple ways to get a product ID.
3. What about the price range issue?
You can refer to this Facebook Microdata Tag page to know more about their schema:
https://developers.facebook.com/docs/marketing-api/catalog/guides/microdata-tags#json-ld
I would recommend you hire a developer to make things easier for yourself.
I hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
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.