Sort XML before / at start of Import ( Xpath / Function )
-
Hello ??
is there any way to sort the XML file before / at the start of an Import with for example Xpath or a Function ?SITUATION:
XML Import Products with Variations by GROUP ID
( Option 2: All products with variations are grouped with a unique value that is the same for each variation and unique for each product. Unique Value: {group_id[1]} )
+ When product has no variation convert to simple productPROBLEM:
Variations of Products in XML arent BEHIND THEMSELVES with the same GROUP ID.
Import detects that the next product doesnt have the same GROUP ID so it changes the product to simple product. When it arrives to another product with the same GROUP ID it wont change the first product to variable product and wont add the variation.RESULT:
Products are simple products even if they should have variations.EXAMPLE IMPORT:
Product Coca Cola 1253 should have variations but its a simple product.<?xml version="1.0" encoding="UTF-8"?> <document> <product> <title>Coca Cola 1253</title> <group_id>1253</group_id> <price>6</price> <size>6 pack</size> <description>Fizzy and tastes great.</description> </product> <product> <title>Coca Cola 1</title> <group_id>1</group_id> <price>10</price> <size>12 pack</size> <description>Fizzy and tastes great.</description> </product> <product> <title>Coca Cola 2</title> <group_id>2</group_id> <price>12</price> <size>18 pack</size> <description>Fizzy and tastes great.</description> </product> <product> <title>Coca Cola 1253</title> <group_id>1253</group_id> <price>99</price> <size>300 can case</size> <description>Fizzy and tastes great.</description> </product> <product> <title>Sprite</title> <group_id>19283</group_id> <price>6</price> <size>6 pack</size> <description>Not as good as Coca Cola.</description> </product> <product> <title>Sprite</title> <group_id>19283</group_id> <price>10</price> <size>12 pack</size> <description>Not as good as Coca Cola.</description> </product> <product> <title>Sprite 1253</title> <group_id>1253</group_id> <price>12</price> <size>18 pack</size> <description>Not as good as Coca Cola.</description> </product> <product> <title>Sprite</title> <group_id>19283</group_id> <price>99</price> <size>300 can case</size> <description>Not as good as Coca Cola.</description> </product> </document>
WORKAROUND NOT WORKING:
Disable “When product has no variation convert to simple product”. All products will be variable, but products with one variation cant be bought ??Any ideas?
Ive found something like fn:sort and sortedXPath but I dont have a clue how to use it in XPATH or function. Or if its even working.
Thank you in forward for an answer
Luká? LEAX Dunaj
- The topic ‘Sort XML before / at start of Import ( Xpath / Function )’ is closed to new replies.