GTIN is now Showing

#249307
  • Resolved schemaerror
    Rank Math free

    I have tried to implement GTIN on the products, I have added value but it is not being picked up by Google or any other structured data testing tool. I have added GTIN on product page, but it’s not working. Please check the sensitive data for more information

Viewing 6 replies - 16 through 21 (of 21 total)
  • Hello,

    Yes, the plugin will also work for the product variations. I have checked on my end and it is working fine with the variations.

    Hope this helps. Let us know if you need any further assistance.

    Thanks.

    Also Do I have to provide GTIN for product variations only?
    or Do I have to provide under inventory as well? https://prnt.sc/1qxquzl

    Ankit
    Rank Math business

    Hello,

    Yes, Please kindly update the GTIN number on your variations product and you should able to see the GTIN values.

    Do let us know how it goes.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hi, I have activated RankMath pro. please have a look now.

    Hello,

    As mentioned before we don’t offer support for queries related to the PRO subscription if you can’t provide proof of buying the plugin.

    In this case, you’ll need to resort to the plugin mentioned before that is free and the following filter:

    
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        $product = new WC_Product( get_the_ID() );
        if( $product->is_type( 'simple' ) ){
             $gtin_value = get_post_meta($product->get_id(),'_wpm_gtin_code', true);
             $entity['gtin13'] = $gtin_value;
             return $entity;
        }elseif($product->is_type( 'variable' )){
             $variation = new WC_Product_Variation(get_the_ID());
             $gtin_value = get_post_meta($variation->get_id(),'_wpm_gtin_code', true);
             $entity['gtin13'] = $gtin_value;
             return $entity;
        }else{
             return $entity;
        }
        
    });
    

    Please note that you might need to modify this filter to suit your needs.

    Don’t hesitate to get in touch if you have any other questions.

    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.

Viewing 6 replies - 16 through 21 (of 21 total)

The ticket ‘GTIN is now Showing’ is closed to new replies.