• Resolved mamandis

    (@mamandis)


    Hello,

    Want to import products from XML or CSV, products have IDs, names, descriptions, etc. Products are variables – after importing everything looks good (with options) except do not know how to import quantity and sizes, couse they are in one column named sizes_stock, for ex. M/L:11,XS/S:8 | S:3,M:5,L:6 | one-size-fits-all:5

    Help me, please, to fix the problem, how to import these sizes and quantities, do I need to change something before importing sizes and stock?

    P.S. I prefer use WP all import, but if you know another importer, please, let me know.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @mamandis,

    Help me, please, to fix the problem, how to import these sizes and quantities, do I need to change something before importing sizes and stock?

    The only built-in way to set unique stock values for variations is to have the variations on their own lines in the import file. You can see the various options here: https://www.wpallimport.com/documentation/woocommerce/variable-products/.

    If you must use the data format in your example, then you’d have to write a custom PHP function (see documentation) that changes the data to a pipe-delimited list of the sizes, e.g.:

    M/L|XS|S|M|L|one-size-fits-all

    That way you can use the “Link all variations” option to import them (see documentation).

    Here’s an example function that can output the sizes or the quantities: https://d.pr/n/iAcEqm. Example usage is in the code comments.

    The link all variations option doesn’t currently have a way to import unique images/stock/prices/etc per-variation, so you’d also have to write code that uses our API (see documentation) to update the sizes with their stock quantity. For some inspiration on how to get it done, please see: https://gist.github.com/trey8611/7786c6bdd605a16d9404e97e25056f6f.

    Plugin Author WP All Import

    (@wpallimport)

    Hey @mamandis,

    I’m going to go ahead and mark this as resolved since it’s been a while. You can follow up in this thread if you still have questions.

    Anyone else, please open a new topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with importing sizes & stock from xml or csv’ is closed to new replies.