We are currently on vacation until 13th May 2024, ticket responses maybe be longer than normal during this period, sorry for any inconvenience.

XPath & XML File – Multiple Nodes but of same name

Closed

Import WP Pro Updated 2 weeks ago 8 Replies

Callum asked 4 weeks ago on April 4, 2024 at 6:30 pm

Hi all!

Just got the plugin today and already found myself in a sticky situation. I am using Live XML Feeds to update the stock of my dropshipping store. I’ve managed to implement the ‘[x]’ custom node within here: ‘{/post[1]/Sku}’ so that it fetches the right one, however my understanding that it would automatically fetch each one that is within the XML file; instead it only fetches that specific one/line and leaves out the rest. It will also fetch /stock too to keep track of quantity levels.

I’m not very good at making sense in terms of explanations via text, so I hope the above is understandable.

Any help would be much appreciated, many thanks!

J

James replied Support Agent

4 weeks ago on April 4, 2024 at 6:38 pm

Hi Callum,

If you can send over a copy of the file you are importing, and export and attach your importer settings to this ticket by going to Tools > Import WP > Settings / Tools > Import / Export and select and export your importer as a JSON file.

This way i can replicate your setup locally to understand what you have setup and how to help.

James

CH

Callum replied privately

4 weeks ago on April 4, 2024 at 6:40 pm

J

James replied Support Agent

4 weeks ago on April 4, 2024 at 6:45 pm

is there a feed that has more than 1 product in it so that i can confirm the structure?

CH

Callum replied privately

4 weeks ago on April 4, 2024 at 6:46 pm

J

James replied Support Agent

4 weeks ago on April 4, 2024 at 6:49 pm

Thank you.

Under the second step of the importer: "file settings" tab, can you change the base path from /data to /data/post, you will see that the preview instead of showing all posts, it will show a single record.

Then you need to go into the template fields step and re-select all fields, e.g. {/post[1]/Sku} becomes {/Sku}

CH

Callum replied

4 weeks ago on April 4, 2024 at 8:14 pm

Excellent! Works brilliantly now :) much appreciated.

If I upload their entire product list; how do I go about altering the settings to make sure that the xPaths I've selected from the 'stock feed xml' doesn't delete/create product pages and ONLY update the fields if there's been a change?

Many thanks!

J

James replied Support Agent

4 weeks ago on April 4, 2024 at 8:30 pm

Under the permissions tab, you would uncheck both the create and delete permission, and check the update permission.

The under the update permission you would change the import "all fields" dropdown to only the following fields and select which ones you want it to change.

Finaly on the run update step, enable the "update records only when data has changed" , this option compares the previous data from the import file to the current import file, if they match then the record is not updated.

J

James replied Support Agent

2 weeks ago on April 17, 2024 at 8:49 pm

Hi Callum,

I am closing this ticket since i havent heard back in over two weeks, replying to the ticket will re-open it if required.

Thanks
James