• Resolved RistoK

    (@ristokaalma)


    Dear WP ALL IMPORT team,

    I have a specific XML output from an API but I’m not able to import variable products from it. Not sure if I’m doing something wrong or the XML is not suitable.

    I removed alot of unrelated fields and added an example of the XML file I’m using:

    <?xml version="1.0" encoding="UTF-8"?>
    <root>
      <products>
        <records>
          <productID>661</productID>
          <name>Villased Sussid</name>
          <code>MWO003</code>
          <productVariations>662</productVariations>
          <productVariations>663</productVariations>
          <type>variable</type>
        </records>
        <records>
          <productID>662</productID>
          <name>Villased Sussid 0-6</name>
          <code>MWO0030-6</code>
          <variationDescription>
            <name>Suurus</name>
            <value>0-6</value>
            <order>58</order>
            <dimensionID>8</dimensionID>
            <variationID>98</variationID>
          </variationDescription>
          <parentProductID>661</parentProductID>
          <type>simple</type>
        </records>
        <records>
          <productID>663</productID>
          <name>Villased Sussid 6-12</name>
          <code>MWO0036-12</code>
          <variationDescription>
            <name>Suurus</name>
            <value>6-12</value>
            <order>59</order>
            <dimensionID>8</dimensionID>
            <variationID>99</variationID>
          </variationDescription>
          <parentProductID>661</parentProductID>
          <type>simple</type>
        </records>
        <records>
          <productID>621</productID>
          <name>Laste Papud Emu</name>
          <code>MN007</code>
          <productVariations>622</productVariations>
          <productVariations>623</productVariations>
          <productVariations>624</productVariations>
          <productVariations>625</productVariations>
          <productVariations>626</productVariations>
          <productVariations>627</productVariations>
          <productVariations>628</productVariations>
          <productVariations>629</productVariations>
          <type>variable</type>
        </records>
        <records>
          <productID>622</productID>
          <name>Laste Papud Emu Helepruun 19</name>
          <code>MN00701519</code>
          <variationDescription>
            <name>Värv</name>
            <value>Helepruun</value>
            <order>15</order>
            <dimensionID>1</dimensionID>
            <variationID>59</variationID>
          </variationDescription>
          <variationDescription>
            <name>Suurus</name>
            <value>19</value>
            <order>43</order>
            <dimensionID>8</dimensionID>
            <variationID>75</variationID>
          </variationDescription>
          <parentProductID>621</parentProductID>
          <type>simple</type>
        </records>
        <records>
          <productID>623</productID>
          <name>Laste Papud Emu Helepruun 21</name>
          <code>MN00701521</code>
          <variationDescription>
            <name>Värv</name>
            <value>Helepruun</value>
            <order>15</order>
            <dimensionID>1</dimensionID>
            <variationID>59</variationID>
          </variationDescription>
          <variationDescription>
            <name>Suurus</name>
            <value>21</value>
            <order>44</order>
            <dimensionID>8</dimensionID>
            <variationID>76</variationID>
          </variationDescription>
          <parentProductID>621</parentProductID>
          <type>simple</type>
        </records>
        <records>
          <productID>624</productID>
          <name>Laste Papud Emu Helepruun 23</name>
          <code>MN00701523</code>
          <variationDescription>
            <name>Värv</name>
            <value>Helepruun</value>
            <order>15</order>
            <dimensionID>1</dimensionID>
            <variationID>59</variationID>
          </variationDescription>
          <variationDescription>
            <name>Suurus</name>
            <value>23</value>
            <order>45</order>
            <dimensionID>8</dimensionID>
            <variationID>77</variationID>
          </variationDescription>
          <parentProductID>621</parentProductID>
          <type>simple</type>
        </records>
        <records>
          <productID>625</productID>
          <name>Laste Papud Emu Helepruun 25</name>
          <code>MN00701525</code>
          <variationDescription>
            <name>Värv</name>
            <value>Helepruun</value>
            <order>15</order>
            <dimensionID>1</dimensionID>
            <variationID>59</variationID>
          </variationDescription>
          <variationDescription>
            <name>Suurus</name>
            <value>25</value>
            <order>46</order>
            <dimensionID>8</dimensionID>
            <variationID>78</variationID>
          </variationDescription>
          <parentProductID>621</parentProductID>
          <type>simple</type>
        </records>
        <records>
          <productID>626</productID>
          <name>Laste Papud Emu Tumepruun  19</name>
          <code>MN00701619</code>
          <variationDescription>
            <name>Värv</name>
            <value>Tumepruun </value>
            <order>16</order>
            <dimensionID>1</dimensionID>
            <variationID>60</variationID>
          </variationDescription>
          <variationDescription>
            <name>Suurus</name>
            <value>19</value>
            <order>43</order>
            <dimensionID>8</dimensionID>
            <variationID>75</variationID>
          </variationDescription>
          <parentProductID>621</parentProductID>
          <type>simple</type>
        </records>
      </products>
    </root>

    That’s how I set up the import’s WooCommerve Add-on fields:

    Generel tab
    SKU => {productID[1]}
    Attributes tab
    Name => {variationDescription[1]/name[1]}
    Values => {variationDescription[1]/value[1]}
    Variations tab
    “All my variable products have SKUs or some other unique identifier. Each variation is linked to its parent with its parent’s SKU or other unique identifier.” – checked
    SKU element for parent => {productID[1]}
    Parent SKU element for variation => {parentProductID[1]}

    Please help.

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

    (@wpallimport)

    Hi @ristokaalma

    Your settings are correct for this data structure, but there are a couple of issues:

    • The parent products have the same ID and some of the children products share the same IDs/SKUs. You should make these unique for every product.
    • You should add another variation attribute with {variationDescription[2]/name[1]} and {variationDescription[2]/value[1]}.

    If this doesn’t help, please replicate the import at http://www.wpallimport.com/debug/ and open a ticket at http://www.wpallimport.com/support/ with the details.

    • This reply was modified 6 years, 5 months ago by WP All Import.
    Thread Starter RistoK

    (@ristokaalma)

    Thank’s alot for the reply.

    Could you please specify the following: “The parent products have the same ID and some of the children products share the same IDs/SKUs. You should make these unique for every product.”?

    To me it seems that every <records> has a unique <productID> and every variation (<records> that has a <parentProductID>) has a <parentProductID> set that reffers to a parent product.

    • This reply was modified 6 years, 5 months ago by RistoK.
    Plugin Author WP All Import

    (@wpallimport)

    Hi @ristokaalma

    To me it seems that every <records> has a unique <productID> and every variation (<records> that has a <parentProductID>) has a <parentProductID> set that reffers to a parent product.

    You’re right, the data looks fine now. Very strange. Sorry about that!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Variable products from XML’ is closed to new replies.