Out of stock Product Variation can be added to cart

Description:

If a variation of a product is out of stock it can be added to the cart anyway.

Also it is not possible to display some sort of “Out of stock” information because the visibility condition Stock Status === outofstock seems to only work on Simple Products (without any variation).

Step-by-step reproduction instructions:

  1. Create variable Product with at least 2 variations.
  2. make sure that one variation is out of stock
  3. set the out of stock variation as the default variation that is pre selected when visiting the product page
  4. Go to the Product Template and set the Visibility Condition of your Out Of Stock label to Stock Status === outofstock
  5. Visit the product page

You will see:

  1. The Out of Stock label does not show up
  2. You can add the pre selected but out of stock variation to the cart

Screenshots, screen recording, code snippet

Insert Images, Videos or GIFs

Environment info

  • WordPress version: latest
  • Cwicly Plugin version: latest