In Shopify, it is common to implement a notification when a product is back in stock, but here is a way to set it up so that it can also be notified on the product details screen. By adding a unique tag to the restocked variant, the tag can be recognized and a restock message displayed.
Example of setting up Shopify Flow's "Product variant back in stock" to display restocked variants on the product detail page

[Setup method ①] Create a Flow that assigns product tags in the format "bs_[variant id]" when the "Product variant back in stock" trigger is activated.

[Setup Method 2] Add a custom Liquid section to the product template in the theme editor and insert the code

[Additional Information] How messages are displayed for products with multiple variants, a single variant, and products with no variants

