Devlopr1
Devlopr1

Reputation: 21

Trying to add Shipping weight to schema via functions.php in woocommerce for Google Merchant Center

I'm trying to add the shipping weight via functions.php in woocommerce to the Schema using add_filter('woocommerce_structured_data_product').

I currently have

                if ( $product_weight ) {
                    $markup['additionalProperty'][] = [
                        "@type" => "PropertyValue",
                        "name" => "ShippingWeight",
                        "value" => $product_weight . " " . strtoupper( $weight_unit )
                    ];
                }

But Google Merchant Center still says that product weight/shipping weight is missing. Has anyone had any success adding schema through their website and getting GMC to accept their products?

Upvotes: 1

Views: 63

Answers (0)

Related Questions