Selection changes the purchasable variant
The product identifies the item family; the variant determines this option’s price, SKU and availability. Read selected_or_first_available_variant and submit variant.id rather than product.id, ensuring the cart receives the displayed specification.
Begin with ?variant= URLs and a server refresh, aligning media, price, currency and form ID. An unavailable variant can remain viewable while its purchase action reflects availability, distinguishing sold-out status from a broken page.
Update the facts together when removing refreshes
This example is an unenhanced baseline for a small variant set. For asynchronous selection, integrate existing variant or product-info components and Section Rendering so the displayed facts and add-to-cart ID change together.
Use actual option relationships rather than guessing available colour and size combinations in the browser. High-variant products need the project’s appropriate on-demand approach; a small loop is not a complete variant architecture.