Files
TowyTowyandClaude 5e9a8583e2 Restock detection - fix inverted condition that skipped the OpenGraph availability fallback (#4262)
* Restock detection - fix inverted condition that skipped the OpenGraph availability fallback

get_itemprop_availability() only dug through OpenGraph properties when
price was missing OR when availability was ALREADY found - so on pages
that expose price via JSON-LD but stock state only via the OpenGraph
commerce tags (<meta property="product:availability">), the availability
(and currency) was silently dropped.

The inner loop already guards each field with 'if not value.get(...)',
so the outer gate now matches that intent: dig OpenGraph when any of
price/availability/currency is still missing.

Co-Authored-By: Claude <noreply@anthropic.com>

* Normalise availability after the OpenGraph fallback, not before

An availability found via OpenGraph was left raw, so the Facebook
commerce spelling 'in stock' never matched the 'instock' test and the
product read as out of stock.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-26 10:59:29 +02:00
..