• Resolved Alexanne

    (@alexannee)


    Hello,

    Is there a way to bulk generate variations for variable products with attributes?

    Let me explain. We imported our products via CSV (from another e-commerce website). Everything went fine, except for the variable products. We can’t import the products with ?Used for variation? checkbox already checked. So all our variable products don’t have variations. We have thousands of products, so creating them manually by clicking on each products, then click the ?Used for variations checkbox?, then ?Create variations from attributes? is impossible, it would take years.

    Can I auto-generate the variations for each variable product?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Fernando a11n

    (@fhaps)

    Automattic Happiness Engineer

    What tool did you use to export the CSV file and then import it on the new site?

    Using the built-in importer/exporter tool would create the variations correctly.

    Here’s an example of what a file with the correct data to import products (including variations) looks like: https://github.com/woocommerce/woocommerce/blob/master/sample-data/sample_products.csv

    You can use that as a base to format your CSV file correctly and re-import the products.

    Thread Starter Alexanne

    (@alexannee)

    Hello,

    Thank you very much for the quick answer! I used indeed the built-in importer. The variations in my CSV are not created like the demo, but I would like to have them automatically created instead of creating thousand new lines by hand ..

    Thanks!

    • This reply was modified 4 years, 11 months ago by Alexanne. Reason: Wrong answer, sorry!
    Plugin Support Fernando a11n

    (@fhaps)

    Automattic Happiness Engineer

    Sounds like a plan! Please let us know here if that resolved the issues – as it might help other users who experience similar errors in the future.

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @alexannee,

    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.

    I’m still working on auto generating the variations without going into each product – but you need to go in to upload images anyway – right?

    I solved the unchecked “used for variations” issue by running the following update in mysql/phpmyadmin

    UPDATE wp_postmeta 
    SET meta_value = REPLACE( 
      meta_value, 
    'is_variation";s:1:"0',
    'is_variation";s:1:"1'
    );

    I made a plugin so my client can do this easily each season.

    I also added a feature to globally apply parent prices to all child variations with one click. This was not straight forward because when variations are generated the original price is deleted. So I added a new meta value for parent price when globally checking the “used for variations” boxes.

    plugin screenshot

    Hi, please can you share that plugin? Or help me on the script ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Auto-create variations for variable products’ is closed to new replies.