Malin 5072a967ca fix: zero-stock products left unmanaged with default "in stock" status
get_stock_quantity() on a never-managed product returns 0, which equaled
BC's inventory for out-of-stock items, so the "did the value change?"
guard treated it as no-op and never called set_manage_stock(true). The
product was left at WooCommerce's default stock_status of "instock" with
no quantity tracked - looked fine for in-stock items (real quantity forced
the block to run) but silently wrong for anything actually out of stock.
Now also runs whenever stock isn't managed yet, regardless of whether the
value looks unchanged. Also enables manage_stock at product creation time
so newly created products never sit in that ambiguous state to begin with.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 15:02:54 +02:00
Description
No description provided
288 KiB
Languages
PHP 92.8%
JavaScript 5.4%
CSS 1.8%