-
hello,
We use variable products here :
https://lesjuspaf.bio/produit/les-cures/cure-detox/And price is displayed through the snippets configured by rankmath, I’m looking for a solution to disable them. I tried this:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
if ( ! is_product() ) {
return $entity;
}$product = wc_get_product( get_the_ID() );
if ( ! $product->is_type( 'variable' ) ) {
return $entity;
}$variations = $product->get_available_variations();
if ( ! empty( $variations ) ) {
$offers = [];
foreach ( $variations as $variation ) {
$price_valid_until = get_post_meta( $variation['variation_id'], '_sale_price_dates_to', true );
$offers[] = [
'price' => $variation['display_price'],
];
}
}$entity['offers'] = $offers;
return $entity;
} );But it seemingly does not help, as my variations product are still rejected.
Do you have any idea ?
Thanks a lot for your help
The ticket ‘Variable products rejected by Google Merchant Center due to price discrepancies’ is closed to new replies.