• Resolved ak2447

    (@ak2447)


    Hi I have a feed from ICECat. I have 3 options of getting this data. In each option I am stuck.

    Option 1 my preference:
    ICEcat provides an index XML. In that file, for each product, there is a URL pointer to the XML file of each product. For example prod_id:6548799, path(en):https://data.icecat.biz/export/freexml/EN/73379765.xml

    I have tried a bunch of different syntax approaches using XPath to have All Import look at the XML but unsuccessfully so far.

    >This is my preferred option so would appreciate if you could advise if (and how) this can be done.

    Option 2:
    I manually download the full catalogue file as a csv with “feature names as headers”. This relates to the attribute names and values. There are approximately 2000 columns in the file. The header is the attribute name and the rows contain the attribute data.
    >Can I use the column header as the attribute name on the import settings and if so how?
    >Is there such a way that we can loop through all of the columns to avoid the need to reference each column individually?

    Option 3:
    I manually download the full catalogue file as a csv without “feature names as headers”. In this format are approximately 200 columns in the file. The header is labelled feature-nn. The attribute name and attribute data are contained in the row and separated by : .
    >How can I use XPath or any other option to place the value on the left of : to the attribute name and the value on the right of : to attribute value?

    Now I know this looks like 3 questions but really it isn’t. I’d like to use option 1, but if that isn’t possible then either of option 2 or 3 remains.

    Thanks.
    Andrew

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

    (@wpallimport)

    Hi @ak2447,

    ICEcat provides an index XML. In that file, for each product, there is a URL pointer to the XML file of each product. For example prod_id:6548799, path(en):https://data.icecat.biz/export/freexml/EN/73379765.xml

    Unfortunately, WP All Import doesn’t have any built-in options to retrieve product data from an XML link inside the file being imported. But, you could use custom code and our API to do it: http://www.wpallimport.com/documentation/developers/action-reference/.

    Can I use the column header as the attribute name on the import settings and if so how?

    You’d have to type in the header name as a static attribute name value.

    Is there such a way that we can loop through all of the columns to avoid the need to reference each column individually?

    I’m afraid that would require custom code and our API as well.

    How can I use XPath or any other option to place the value on the left of : to the attribute name and the value on the right of : to attribute value?

    You can use a custom PHP function to do that: https://www.wpallimport.com/documentation/developers/custom-code/inline-php/. For example:

    function my_get_attribute( $data, $type ) {
    	$data = explode( ':', $data );
    	
    	switch ( $type ) {
    		case 'name':
    			return reset( $data );
    			
    		case 'value':
    			return array_pop( $data );
    			
    		default:
    			return reset( $data );
    	}
    }

    Example usage:

    [my_get_attribute({attribute[1]},"name")]
    [my_get_attribute({attribute[1]},"value")]
    Plugin Author WP All Import

    (@wpallimport)

    Hi @ak2447,

    I’m marking this as resolved since it’s been inactive for a while. Please open up a new topic if you still have questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Import setting challenges’ is closed to new replies.