I am getting “Missing field sku” and “No global identifier provided (e.g., gtin, mpn, isbn)” warnings from Google Search Console only when products are Out of Stock. I have the following code from FeedArmy in my product-template.liquid. Can anyone tell me how to edit this code to populate the SKU and GTIN for products that are out of stock? I realize these are “just warnings” from Google and not errors, but I’d like to resolve them. Thanks in advance for any help.
Having reviewed your code, I’m not convinced what you provided is where Google Search Console is reporting the warnings.
The instances where SKU is used will not show when it is blank. I don’t see any other conditions that could affect it.
Use the Structured Data Testing tool or provide one of your pages here so we can see it in the tool. Theme’s can often put schema markup on non-primary product pages through sections like related products, which can produce any error like those you spoke of.