Variable products rejected by Google Merchant Center due to price discrepancies

#388464
  • Resolved An-khanh
    Rank Math free

    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

Viewing 3 replies - 16 through 18 (of 18 total)
  • Hello,

    Can you please confirm if your issue has been resolved or do you still need our assistance with this or anything else?

    Looking forward to hearing back from you.

    hello,

    well resolved. Thanks a lot

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 3 replies - 16 through 18 (of 18 total)

The ticket ‘Variable products rejected by Google Merchant Center due to price discrepancies’ is closed to new replies.