• Resolved Tom

    (@thommen)


    I have file

    <?xml version="1.0" encoding="UTF-8"?>
    <offers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1" store="1" lang="1"><offer id="189817" variant_id="" url="https://b2b.polish-export.eu/p/189817/papier-toaletowy-valletto-3-warstwzapzielona-herb8-rolek-5907354001262" weight="0.41" price_net="4.7064" price_gross="5.79" stock="10000">
     <cats>
      <cat><![CDATA[HIGIENA/Artykuły higieniczne/Papier toaletowy]]></cat>
     </cats>
     <name><![CDATA[PAPIER TOALETOWY VALLETTO 3-WARSTW.ZAP.ZIELONA HERB.8 ROLEK]]></name>
     <attrs>
      <a name="EAN"><![CDATA[5907354001262]]></a>
      <a name="ProduktIndex"><![CDATA[US151578]]></a>
      <a name="Producent"><![CDATA[PR.VALLETTO]]></a>
     </attrs>
     <imgs>
      <main url="https://b2b.polish-export.eu/images/products/3d2a/papier-toaletowy-valletto-3-warstwzapzielona-herb8-rolek_15368_min.jpg"/>
     </imgs>
     <desc><![CDATA[Opakowanie zbiorcze podstawowe: 10 Kpl. <br><br> Jednostka miary: Kpl<br>Waga jednostki: 0.408 kg<br>Ilość opakowań zbiorczych na palecie: 22 szt.<br>Ilość jednostek na palecie: 220 Kpl<br>Waga całej palety: 120.267 kg<br>Kod PKWiU: 17.22.11.0<br>Kod kreskowy podstawowy: 5907354001262<br>Szerokość opakowania: 57.0<br>Wysokość opakowania: 19.2<br>Głębokość opakowania: 83.0<br>Jednostka miary opakowania: cm<br>
    <!-- {uddp{idpd=55}{idpp=151578}{ean=5907354001262}}-->]]></desc>
    </offer>
    <offer id="189818" variant_id="" url="https://b2b.polish-export.eu/p/189818/papier-toaletowy-valletto-celulozowy-bialy-8-rolek-5908296690842" weight="0.41" price_net="3.5404" price_gross="4.35" stock="10000">
     <cats>
      <cat><![CDATA[HIGIENA/Artykuły higieniczne/Papier toaletowy]]></cat>
     </cats>
     <name><![CDATA[PAPIER TOALETOWY VALLETTO CELULOZOWY BIALY 8 ROLEK]]></name>
     <attrs>
      <a name="EAN"><![CDATA[5908296690842]]></a>
      <a name="ProduktIndex"><![CDATA[US74203]]></a>
      <a name="Producent"><![CDATA[PR.VALLETTO]]></a>
     </attrs>
     <imgs>
      <main url="https://b2b.polish-export.eu/images/products/1ade/papier-toaletowy-valletto-celulozowy-bialy-8-rolek_15369_min.jpg"/>
     </imgs>
     <desc><![CDATA[Opakowanie zbiorcze podstawowe: 10 Kpl. <br><br> Jednostka miary: Kpl<br>Waga jednostki: 0.408 kg<br>Ilość opakowań zbiorczych na palecie: 22 szt.<br>Ilość jednostek na palecie: 220 Kpl<br>Waga całej palety: 92.4 kg<br>Kod kreskowy podstawowy: 5908296690842<br>Szerokość opakowania: 36.5<br>Wysokość opakowania: 18.0<br>Głębokość opakowania: 73.5<br>Jednostka miary opakowania: cm<br>
    <!-- {uddp{idpd=55}{idpp=74203}{ean=5908296690842}}-->]]></desc>
    </offer>

    In custom fields, I cannot import values:

    {attrs[1]/a[1]/@name}
    {attrs[1]/a[2]/@name}
    {attrs[1]/a[3]/@name}

    because I have the result:

    EAN (name) – EAN (value)
    Producent (name) – Producent (value)
    Produkt Index (name) – ProduktIndex (value)

    What’s the way to do that?
    This is wrong, it should be like this ↓

    EAN (name) – 5907354001262 (value)
    Producent (name) – US151578 (value)
    Produkt Index (name) – PR.VALLETTO (value)

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

    (@wpallimport)

    Hi @thommen,

    Here are the XPaths you should use instead:

    {attrs/a[@name="EAN"]}
    {attrs/a[@name="ProduktIndex"]}
    {attrs/a[@name="Producent"]}
    Thread Starter Tom

    (@thommen)

    In my case, only this ↓ works

    {attrs[1]/a[1]}
    {attrs[1]/a[2]}
    {attrs[1]/a[3]}
    Plugin Author WP All Import

    (@wpallimport)

    Hi @thommen,

    Strange, the XPaths I mentioned should have worked. Please replicate this issue on a sandbox site at http://www.wpallimport.com/debug/, then open a support request at http://www.wpallimport.com/support/ with the sandbox site URL, and a brief description of the issue, so we can help out.

    danko2

    (@danko2)

    Greeting.
    i want to ask for help, i also have this problem, wp all import.
    in my xml file the product weight is in kg but i should convert it to grams.
    as shown in xml: 0.052 kg
    and I would have to switch to this for every product: 52 g
    would anyone tell me the php function and how do i paste it in place of the weight?
    which I have tried so far but unfortunately did not work:
    php funcions:
    <? php
    function my_get_g ($ kg) {
    $ grams = preg_replace (“/ [^ 0-9] /”, “”, $ grams);
    return $ kg * 1000;
    }
    ?>

    woocommerce add-on:
    shipping:
    Weight (g): [my_get_g ({tmeg [1]})]
    but it doesn’t work, it doesn’t switch.
    thank you very much in advance for your help.
    Stephen

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

The topic ‘Does not import into custom fields’ is closed to new replies.