• Resolved romfeo

    (@romfeo)


    Hello,

    I am struggling on how to import product attributes from the xml data as seen below:

    <product>
    <id>4236</id>
    <sku>
    <![CDATA[ 811-18-161039500 ]]>
    </sku>
    <Filters>
    <filter>
    <group id=”6″>Material</group>
    <value id=”37″>Iron</value>
    </filter>
    <filter>
    <group id=”7″>Color</group>
    <value id=”16″>Black</value>
    </filter>
    <filter>
    <group id=”7″>Color</group>
    <value id=”18″>White</value>
    </filter>
    <group id=”8″>Usage</group>
    <value id=”49″>External</value>
    </filter>
    </Filters>
    </product>

    I would be gracefull for any hint…

    Thank you

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

    (@wpallimport)

    Hi @romfeo,

    I am struggling on how to import product attributes from the xml data as seen below:

    You’d need to use a combination of PHP (see documentation) and XPath queries (see documentation) to import these attributes. For example, to get the colors and use a pipe delimiter, you’d use:

    [str_replace(", ","|",{Filters/filter[./group/@id="7"]/value})]

    And, to get the Material:

    {Filters/filter[./group/@id="6"]/value}

    Thread Starter romfeo

    (@romfeo)

    Thank you so much! It worked perfectly. You saved me a ton of time, trying to do it with a less elegant solution, using pmxi_saved_post

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create product attributes’ is closed to new replies.