• Resolved Nadek67

    (@nadek67)


    Hello!
    First of all, thank you for the awesome plugin! It’s great pleasure to work with it.
    I need some help with price import. My supplier has 5 stocks in different cities. E.g. DMD-rozn, SK2-rozn, SK3-rozn etc. One product may be in several places or in one place, all with the same price. Here are examples of my xml:

    <cae>212924</cae>
    <price_sk2_rozn>4562</price_sk2_rozn>
    <price_dmd_rozn>4562</price_dmd_rozn>
    <name>225/65R17 106H XL SUV Summer TL</name>
    <brand>Kormoran</brand>
    <cae>0357175</cae>
    <price_sk3_rozn>15480</price_sk3_rozn>
    <price_sk2_rozn>15480</price_sk2_rozn>
    <name>245/35ZR19 93(Y) XL SportContact 6 FR</name>
    <brand>Continental</brand>

    I need to import the available price into my Regular price field. If I choose {price_dmd_rozn} as a Regular price, I get prices only for those products, which are in stock in DMD, others are imported with empty prices. How do I get prices right? I tried some things. First, I tried to put this in my Regular price field:

    [IF({price[.='']})]{price_dmd_rozn}[ELSE]{price}[ENDIF]
    [IF({price_dmd_rozn[.='']})]{price_sk2_rozn}[ELSE]{price_dmd_rozn}[ENDIF]
    [IF({price_sk2_rozn[.='']})]{price_sk3_rozn}[ELSE]{price_sk2_rozn}[ENDIF]
    [IF({price_sk3_rozn[.='']})]{price_sk4_rozn}[ELSE]{price_sk3_rozn}[ENDIF]

    As an example result, I got Regular price: 31003100, as the item is in stock in 2 cities with price 3100.

    Next time I tried ELSEIF:
    [IF({price[.='']})]{price_dmd_rozn}[ELSEIF({price_dmd_rozn[.='']})]{price_sk2_rozn}[ELSEIF({price_sk2_rozn[.='']})]{price_sk3_rozn}[ELSEIF({price_sk3_rozn[.='']})]{price_sk4_rozn}[ELSE]{price}[ENDIF]
    As the result, I again got prices not for all products.
    I am really upset and have no idea what I do wrong 🙁
    Will be grateful for your help and support!

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

    (@wpallimport)

    Hi @nadek67

    You should be able to accomplish this by using the following XPath in the price field:

    {*[starts-with(name(),"price") and normalize-space()][1]}

    If that doesn’t work, please open a ticket regarding this issue at http://www.wpallimport.com/support/ so that we can see all of the data and advise further.

    Thread Starter Nadek67

    (@nadek67)

    Thanks for the answer!
    Oh, I see, that works! One little detail. I have got several fields beginning with “price”.

    <cae>WHS114961</cae>
    <price>10471</price>
    <price_sk3>9540</price_sk3>
    <price_sk3_rozn>10471</price_sk3_rozn>

    There is a field <price_sk3> with purchase (supplier’s) price, that gets imported when i use your XPath. But the values I need to be shown as regular price are from fields:
    <price>
    <price_sk2_rozn>
    <price_sk3_rozn>
    <price_sk4_rozn>
    <price_dmd_rozn>

    I tried
    {*[contains(name(),"rozn") and normalize-space()][1]}
    But then <price> is skipped.
    Hope you’ll help me again..

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

    (@wpallimport)

    Hi @nadek67

    This should work for you:

    {*[(name() = "price" and normalize-space()) or (contains(name(),"price") and contains(name(),"rozn") and normalize-space())][1]}

    Thread Starter Nadek67

    (@nadek67)

    IT WORKS!
    Awesome! Many-many thanks to you! 🙂 🙂 🙂

    Thread Starter Nadek67

    (@nadek67)

    The problem is resolved.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Choose prices to import’ is closed to new replies.