I run the WooCommerce store behind a small online clothing shop. Most of the orders are made to order and ship from print partners in several countries, so the delivery promise differs by destination. Google's merchant listings can show that promise, and the return window, right in search results, but only if the product markup says so. WooCommerce's built-in Product schema does not.
This post walks through adding hasMerchantReturnPolicy and shippingDetails to the offer that WooCommerce already prints, without a plugin.
What WooCommerce outputs by default
WooCommerce prints JSON-LD for each product through the WC_Structured_Data class. The offer part comes from generate_product_data() , and before it is added to the markup it passes through a filter:
apply_filters ( 'woocommerce_structured_data_product_offer' , $markup_offer , $product );
Enter fullscreen mode
Exit fullscreen mode
That filter is the cleanest place to hook in.…