• I have a large woocommerce store with 10,000+ products and most are variable products with sizes s,m,l,xl etc which are set up as attributes – they are then set as variations for each product and this works fine on woocommerce 2.3.13 but when I upgrade on my test site all the variations are forgotten – they are still in attributes but not selected as variations – so do not display in the front end.

    They are all there in variations as drop downs for each one, and if selected they work again.

    However I am trying to avoid going through 10K products and manually re-selecting 5 or six variation for each.

    Any ideas if this is a woocommerce bug, or is there a fix than can pull them back in. I really cant go through them all and manually reselect them!

    Screen shot of dashboard – https://i.imgsafe.org/f378705.jpg

    Thanks
    P.

Viewing 6 replies - 1 through 6 (of 6 total)
  • We are having the same problem…

    It seems to be the way that the attributes were stored in the database, but are now stored differently:

    wp_postmeta:

    meta_key | meta_value
    attribute_custom-attr-name | custom-attr-value-1 <-- old
    attribute_custom-attr-name | Custom Attr Value 1 <-- new

    The only way we’ve managed to fix this is manually going through remapping the products, but are in the same situation as yourself, having more products than sensible to attempt this.

    Thread Starter psychicfrog

    (@psychicfrog)

    Im staying on the old version of woocommerce on the live site for now!

    However I tried this morning, and if I select “Visible on the product page” tick box, and update the product , the sizes appear again. SO I am going to investigate if its possible to do a simple update in sql to flag all of these , I will let you know if I have any luck!.

    However in the mean time if anyone else has any ideas, please let us know!

    P.

    Looking at the WC GitHub, this seems to be a known and fixed bug that hasn’t been pushed out to the wild yet….

    https://github.com/woothemes/woocommerce/commits/79ee83e0d00919ff10fd312d77bab39eb55047f3/includes/class-wc-product-variation.php

    If you look at the commit log from Jun 11, 2015 onwards, you’ll see a few entries mentioning fixing it.

    “Attempted bw compat by comparing sanitised text to real text”
    “Add version check to prevent pre-2.4 logic kicking in when not needed”

    Any idea why this isn’t in the live version? My class-wc-product-variation.php says @version 2.2.0 at the top….

    Thread Starter psychicfrog

    (@psychicfrog)

    Thanks Brightemo – I shall stick with the old version for a while and see if this fix goes live, otherwise its going to take up far too much time and I will kick myself if I edit 10,000 products manually then it gets fixed!

    Lets hope they release it soon!

    P.

    Okay so scratch my last post, the stuff is there, my files do match the GitHub, variations still broken though.

    Right so I seem to have found whats broken in my install…

    Some _product_attributes are stored as a serialized string of a serialized array.

    e.g.
    s:240:"a:1:{s:22:"vertical-or-horizontal";a:6:{s:4:"name";s:22:"Vertical or Horizontal";s:5:"value";s:45:"Vertical Broadstripe | Horizontal Broadstripe";s:8:"position";s:1:"1";s:10:"is_visible";i:0;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:0;}}";

    Instead of
    a:1:{s:22:"vertical-or-horizontal";a:6:{s:4:"name";s:22:"Vertical or Horizontal";s:5:"value";s:45:"Vertical Broadstripe | Horizontal Broadstripe";s:8:"position";s:1:"1";s:10:"is_visible";i:0;s:12:"is_variation";i:1;s:11:"is_taxonomy";i:0;}};

    I have no idea how this happened, but it breaks the wc_get_product_variation_attributes function completely (as you’d expect).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Woocommerce upgrade to 2.4. forgets variations’ is closed to new replies.