• Resolved swani

    (@swani)


    TL;DR
    When the client adds a new product that has a size “0” as one of the options for the size attribute, the variation for that attribute saves, but does not associate the variation with size 0.

    Full Explanation
    The website sells clothing. Let’s say they want to add a dress which comes in size 0 and size 1. The client adds the new product through the Add Product screen (not through an import). The product is set as Variable and an Attribute is created for size. Two values are entered: “0” and “1”. Client clicks “Save attributes”.

    When the client goes to the Variations tab, she chooses “Create Variations from all attributes” and two variations are created, one for each size: 0 and 1. She fills out all of the information for each Variation: SKU, stock count, price, weight/dimensions etc. Then she clicks “Save changes”.

    At this point, all of the information is saved properly. But, at some point, the client looks at the new product on the front end, and there is a size missing from the dropdown. When you go into the Edit Product screen, the Variations are listed as “Any size…” and “1”.

    In order to fix the problem, all she has to do is add the add the attribute, she does not have to recreate the variation. So, going to “Attributes” and adding “0” will automatically change the “Any size…” variation to “0”. Somehow, that variation is already associated with the size “0” attribute. She shows this happening in this video.

    https://drive.google.com/file/d/1_HoAukVJFHL2C-c4R9Wj7tA3z8ddeuM7/view

    I guess what I can’t figure out is why this would be. I strongly suspect that it has something to do with the size being “0”. In code, 0 means false. I’m wondering if there is a hiccup in the data validation somewhere. That wouldn’t explain why the issue happens after the initial setup, or why it only happens on some products and not others.

    Any suggestions as to how I solve this would be greatly appreciated.

    Thanks,
    Swani

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    Hey Swani,

    That is a strange error indeed, but one that I was not able to reproduce. I had no problem creating a variation from an attribute which had 0 as the attribute value.

    Examples:

    https://cld.wthms.co/WnGrAD
    https://cld.wthms.co/cBud03

    I noticed in the video that the client had a Visual Composer plugin. I would try to eliminate the possibility that a theme or plugin is causing a problem here.

    See if you can reproduce this error with only WooCommerce enabled and with a default theme.

    Let me know how that goes.

    We haven’t heard back from you in a while, so I’m going to mark this as resolved. If you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Size Attribute of “0” does not save’ is closed to new replies.