Merge pull request #14027 from woocommerce/fix/null-product-json-ld

Make sure we have a product before generating JSON
This commit is contained in:
Claudio Sanches 2017-04-06 10:08:55 -03:00 committed by GitHub
commit 7efbb3f52e
1 changed files with 4 additions and 0 deletions

View File

@ -180,6 +180,10 @@ class WC_Structured_Data {
global $product;
}
if ( ! is_a( $product, 'WC_Product' ) ) {
return;
}
$shop_name = get_bloginfo( 'name' );
$shop_url = home_url();
$currency = get_woocommerce_currency();