The standard WooCommerce product schema is missing from Breakdance when using a custom single product template. I am using the Breakdance Zero Theme as well
Using the below function to add the schema back in
add_action('wp_footer', 'add_woocommerce_default_schema', 5);
function add_woocommerce_default_schema() {
if (is_product()) {
global $post;
$product = wc_get_product($post->ID);
$product_structured_data = new WC_Structured_Data();
$structured_data = $product_structured_data->generate_product_data($product);
// Output the structured data as JSON-LD
if (!empty($structured_data)) {
echo '<script type="application/ld+json">' . wp_json_encode($structured_data) . '</script>';
}
}
}
The standard WooCommerce product schema is missing from Breakdance when using a custom single product template. I am using the Breakdance Zero Theme as well
Using the below function to add the schema back in