Shopify / hydrogen-v1

React-based framework for building dynamic, Shopify-powered custom storefronts.

Home Page:https://shopify.github.io/hydrogen-v1/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Availability status of the product variant is not displayed correctly on product page

Golchenko opened this issue · comments

When changing the availability of a product variant to "in stock", the product page displays "out of stock"

Steps to reproduce:

  • install Hydrogen by npm init @shopify/hydrogen
  • Choose a template: demo store
  • Choose a language: TypeScript
  • Create env file and connect store
  • create a product with multiple variants, all variants are out of stock
  • check product in Hydrogen
  • set one of the variant option "Continue selling when out of stock" to true or change quantity
  • update this product's page in Hydrogen

Expected result:
For a product variant with positive availability, an "add to cart" button will be displayed

Actual result:
After refreshing the page, the correct information is displayed at first, but then the status of the variant changes to "out of stock".

Video demonstration of the bug:
https://www.loom.com/share/05f0d32b17c8437b888ce3f8ddc49ac0

Additional context:
Apparently, the ProductForm component is mounted twice, and the second time it displays the state of the first variant, despite the fact that another varianr is selected. https://i.imgur.com/9InrT4a.png

  • Hydrogen version: 1.6.4
  • Node version: 18.12.1
  • Device details: the problem is observed on different devices