Merge pull request #22852 from woocommerce/fix/22842
Prevent a few structured data warnings on product catalog
This commit is contained in:
commit
504e457c31
|
@ -203,6 +203,11 @@ class WC_Structured_Data {
|
|||
'name' => $product->get_name(),
|
||||
);
|
||||
|
||||
$markup['image'] = wp_get_attachment_url( $product->get_image_id() );
|
||||
$markup['description'] = wp_strip_all_tags( do_shortcode( $product->get_short_description() ? $product->get_short_description() : $product->get_description() ) );
|
||||
$markup['sku'] = $product->get_sku();
|
||||
$markup['brand'] = '';
|
||||
|
||||
if ( apply_filters( 'woocommerce_structured_data_product_limit', is_product_taxonomy() || is_shop() ) ) {
|
||||
$markup['url'] = $permalink;
|
||||
|
||||
|
@ -210,10 +215,6 @@ class WC_Structured_Data {
|
|||
return;
|
||||
}
|
||||
|
||||
$markup['image'] = wp_get_attachment_url( $product->get_image_id() );
|
||||
$markup['description'] = wp_strip_all_tags( do_shortcode( $product->get_short_description() ? $product->get_short_description() : $product->get_description() ) );
|
||||
$markup['sku'] = $product->get_sku();
|
||||
|
||||
if ( '' !== $product->get_price() ) {
|
||||
if ( $product->is_type( 'variable' ) ) {
|
||||
$lowest = $product->get_variation_price( 'min', false );
|
||||
|
|
Loading…
Reference in New Issue