• Resolved MarcusFuto

    (@marcusfuto)


    Hello,

    I am trying to import a lot of features and amenities to my wpresidence wordpress site. I use WP All import and this addon. It seems as though I cannot get the following function to work properly on the features and amenities:

    [FOREACH({characteristics[1]/category[name/uk = “Features”]/value)]{uk},[ENDFOREACH]

    Is there something wrong in that one?

    Basically,

    1. the categories are always switching between different category IDs, so I have given them that xpath [name/uk = “Features”] so it finds the right values.

    2. The I need to import the language uk so the path is like this: characteristics/category/value/uk

    3. I need to do the foreach to get all the different values within the “Features” category.

    4.It becomes trickier because I have two different categories to search through so it looks something like this:

    [FOREACH({characteristics[1]/category[name/uk = “Climate Control”]/value)]{uk},[ENDFOREACH] [FOREACH({characteristics[1]/category[name/uk = “Features”]/value)]{uk},[ENDFOREACH]

    Would be great if you could help me out! I have tried with only one of the categories, but that does not seem to work either. I believe it might have something to do with the comma (,) separation.

    Thanks!

    https://www.ads-software.com/plugins/wp-residence-add-on-for-wp-all-import/

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

    (@marcusfuto)

    I solved it like this:

    [FOREACH({characteristics[1]/category[name/uk = “Climate Control”]/value})]{uk}, [ENDFOREACH][FOREACH({characteristics[1]/category[name/uk = “Features”]/value})]{uk}, [ENDFOREACH]

    However I get that last comma in the end all the time which is pretty annoying.

    Is there a way to strip the last comma from an import like the one above?

    Plugin Author WP All Import

    (@wpallimport)

    We’d need to see the data you’re importing in order to help you out with this. If you’re still having issues, please submit a support request: https://www.wpallimport.com/support/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Importing features and amenities with xpath and foreach’ is closed to new replies.