• Resolved xdelios

    (@xdelios)


    Hello,

    I am interested in getting the woocommerce addon.
    I’ve been reading a bit on your site guides and I have a question.

    I have some xml files from my supplier that have the attributes as child xml elements.

    Would it able to import these?

    I did not find anything similar to your website.
    Just to clarify these are not variable products.

    For example the xml looks like this

    <AttrList>
    <element Name="Article" Value="BX80684I78086KSRCX5"/>
    <element Name="Manufacturer" Value="INTEL"/>
    <element Name="Product Type" Value="CPU Desktop"/>
    <element Name="CPU" Value="INTEL Core i7-8086K"/>
    <element Name="Clock Rate" Value="4.00 GHz"/>
    <element Name="Turbo Clock Rate" Value="5.00 GHz"/>
    <element Name="Core Quantity" Value="6"/>
    <element Name="System Bus" Value="8 GT/s"/>
    <element Name="Core Name" Value="Coffee Lake-S"/>
    <element Name="Socket" Value="1151"/>
    <element Name="L2 Cache Size" Value="1.5 MB"/>
    <element Name="L3 Cache Size" Value="12 MB"/>
    </AttrList>
    

    and that is not the whole part of it of course just the attributes part.

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter xdelios

    (@xdelios)

    Also to let you know I already know that I can just drag the “Name” and “Value” and xpath will create the code.

    My correct question is if something like a foreach command would work here or not.

    regards

    Plugin Author WP All Import

    (@wpallimport)

    Hi @xdelios

    Unfortunately, a “foreach” is not possible when it comes to importing attribute names. You will need to find the record in your import file that contains *all* possible attributes and map those, then the rest of the records should import fine.

    Also, if the order of the attributes vary per record, you’ll need to use XPath queries to access the correct values for each attribute. For example, to get the value for “Core Quantity”, you can use an XPath like this:

    {AttrList/element[./@Name = "Core Quantity"]/@Value}

    Example screenshot: https://d.pr/0nTZ74.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Attributes as child xml elements’ is closed to new replies.