• Resolved cmht

    (@eightsages)


    Hi,

    We are using WooCommerce with a number of variation products listed. We are having problems with variation listings rejected by Google Merchant Centre because of price mismatches in the structured data.

    Would like to know if Rankmath changes the structured data from the WooCommerce default?

    If it does, how do we restore the structred data back to the WooCommerce original?

    Thanks

    Chris

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter cmht

    (@eightsages)

    Hi all, just a quick update!

    These filters used together ultimately did not result in any improvement in Google Merchant Centre – our variation listings were still rejected after resampling:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return [];
    	}
    	return $entity;
    });
    add_filter( "rank_math/opengraph/facebook/product_price_amount", function( $price ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return false;
    	}
    	return $price;
    });
    add_filter( "rank_math/opengraph/facebook/product_price_currency", function( $currency ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return false;
    	}
    	return $currency;
    });

    As an experiment, I replaced them all with this instead (from Michael Davis here https://support.rankmath.com/ticket/woocommerce-variants-vs-google-shopping/):

    add_filter( 'rank_math/woocommerce/og_price', 'my_custom_og_tags' );
    function my_custom_og_tags(){
      global $product;
      if($product->is_type('variable')){
         return false;
    }
    
    }

    And now our variations are finally being accepted by Google Merchant Centre!

    Just to understand better so we can all learn something, @rankmath could you tell us please what the difference is between these two sets of code?

    Thanks a lot @rankmath for your excellent support ??

    Chris

    Plugin Author Rank Math

    (@rankmath)

    Hello @eightsages

    Please use the following filter:

    add_filter( 'rank_math/woocommerce/og_price', 'my_custom_og_tags' );
    function my_custom_og_tags(){
      global $product;
      if($product->is_type('variable')){
         return false;
    }
      return true;
    }

    This is the only code which you’ll be needing to prevent the Google Merchant Centre from throwing the warning.

    The same shall be included in the upcoming update.

    Hope that helps. Thank you.

    Thread Starter cmht

    (@eightsages)

    Yes this is the code I just told you about.

    As mentioned, I discovered that it solved the GMC problem instead of the previous filters offered on this thread.

    Look forward to it in the next update!

    Thanks again for your support.

    Thread Starter cmht

    (@eightsages)

    Hi @rankmath

    Thanks for the recent RankMath updates!

    I see this issue was addressed in 1.0.48 :
    “Fixed: Variation Products were showing price mismatch warning in the Google Merchant Centre”

    Before installing this update, should we remove the code below first?

    Appreciate the great support!

    Chris

    add_filter( 'rank_math/woocommerce/og_price', 'my_custom_og_tags' );
    function my_custom_og_tags(){
      global $product;
      if($product->is_type('variable')){
         return false;
    }
      return true;
    }
    Plugin Author Rank Math

    (@rankmath)

    Hello @eightsages

    Yes, you can safely remove the old code.

    Hope that helps and appreciate your patience.

    Thank you.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Google Shopping variation price rejections’ is closed to new replies.