Make sure we have a product before generating JSON
This commit is contained in:
parent
baaaf493d3
commit
36e9b73ef3
|
@ -180,6 +180,10 @@ class WC_Structured_Data {
|
||||||
global $product;
|
global $product;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! is_a( $product, 'WC_Product' ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$shop_name = get_bloginfo( 'name' );
|
$shop_name = get_bloginfo( 'name' );
|
||||||
$shop_url = home_url();
|
$shop_url = home_url();
|
||||||
$currency = get_woocommerce_currency();
|
$currency = get_woocommerce_currency();
|
||||||
|
|
Loading…
Reference in New Issue