• This shows the GTIN on the product page but that’s not really what I need. I’m trying to add a unique identifier to each of my products so that they can be pulled from WooCommerce through to Facebook to in turn create Shoppable Instagram products.

    This would be a great plugin if it did that, but alas, it doesn’t.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What an unfair review.

    The plugin does what is says.

    If you asked a question at support maybe someone would helped faster.

    Anyway, this code will add it to schema for simple products.

    add_filter( 'woocommerce_structured_data_product', 'add_gtin', 10, 2 );
    function add_gtin( $markup, $product ) {
    	
    	$gtin = get_post_meta( $product->get_id(), 'hwp_product_gtin', true );
    
    	if ( $gtin ) {
    
    		$markup['mpn'] = $gtin;
    
    	}
    
    	return $markup; 
    }
    

    Notice this does not work for variable products.

    Cheers,
    Gabriel

    I love this plugin. It works as described for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not visible on Schema’ is closed to new replies.