Plugin does not add “availability” field
-
Hello
Let me begin my congratulating you on creating this very valuable plugin. I have been using it for a while now and it works just as promised.However, after reviewing my Google Search Console (GSC), I noticed the following errors for every product :
Missing field ‘availability’After digging deeper, I discovered that the “availability” field is being excluded by Lines 1197-1219 of file woocommerce-sea.php
if ( $lowest === $highest ) { $markup_offer = array( '@type' => 'Offer', 'price' => wc_format_decimal( $lowest, wc_get_price_decimals() ), 'priceValidUntil' => $price_valid_until, 'priceCurrency' => $shop_currency, ); }
It seems like that is the only clause that is missing the “availability” field.
If I disable the “woocommerce_structured_data_product_offer” filter by commenting out Line 1251 of the woocommerce-sea.php, all is well. i.e. Availability is added to the schema.
I just wanted to bring this bug to your attention. Hope you can fix it in the next iteration.
The page I need help with: [log in to see the link]
- The topic ‘Plugin does not add “availability” field’ is closed to new replies.