There is a filter called “woocommerce_structured_data_product_offer” that might do the trick for you if used in your child theme’s functions.php. It looks like it passes the $markup_offer as an array as well as the $product object. You could add a function to alter $markup_offer and return the changed values.
I haven’t tested this, but I think you’d do something like this if the product ID you wanted to change was 5:
function fix_my_product_offers_schema ($markup_offer, $product) {
if ($product->get_id() == 5) {
// make your changes to the offers markup here
}
return $markup_offer;
}
add_filter('woocommerce_structured_data_product_offer', 'fix_my_product_offers_schema', 10, 2);
You could alter the conditional if you have more than one product to change, or leave it out if you want to change all products.
Thank you very much! This did the trick and I managed to do what I wanted.
Thanks again for the help.
That’s great! I’m glad you got it working.