Skip to content

Skip the availability component for out-of-stock products - #33

Merged
jeanmarcos-dev merged 3 commits into
dist-2.4.8from
integrate/2.4.8-oos-guard
Jul 21, 2026
Merged

Skip the availability component for out-of-stock products#33
jeanmarcos-dev merged 3 commits into
dist-2.4.8from
integrate/2.4.8-oos-guard

Conversation

@jeanmarcos-dev

Copy link
Copy Markdown
Owner

Why

The storefront availability panel had no out-of-stock guard. On an out-of-stock product it still
offered a "Check availability" call to action (on demand) or fired the fragment request on page
load (instant), even though the server had already resolved the status to zero.

What changed

Block\Product\StockVisualizer::getComponentKind() now returns KIND_NONE when the
server-resolved status level is Level::OUT. Without a component there is no mount payload, so
neither mode offers a call to action or requests a fragment; the status pill still renders
server-side. In the template every strategy flag now derives from the resolved kind, so an
out-of-stock product leaves no orphan knockout bindings behind.

Magento_InventoryCache is now declared in etc/module.xml and composer.json: the panel relies
on it to invalidate cat_p_<id> on a salability flip, and that dependency was never stated. The
CacheTag docblock now describes the actual per-mode purge behaviour.

Ported from the 2.4.9 line (PR #32), where the change was validated end to end in a browser.

Line-specific notes

The module stays identical to the 2.4.9 version except the three known baseline files. Here only
composer.json differs from the 2.4.9 change, keeping this line's magento/module-inventory-indexer
constraint; magento/module-inventory-cache: 1.2.* matches the 1.2.6 shipped on 2.4.8.

Verification

Unit 89/89 on a real 2.4.8 install, local dist QA gate (php-lint + phpcs + phpmd) PASS.

@jeanmarcos-dev
jeanmarcos-dev merged commit 89155cb into dist-2.4.8 Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant