-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Dear @fillup ,
Hope you are doing great,
I am using your one of the SDK walmart-partner-api-sdk-php. when I tried create configurable product I face one issue on variantAttributeNames array preparation.
My sample request array given below
requestArray.txt
For eg:
My prepared array under Footwear->Shoes category
'variantAttributeNames' => [
'variantAttributeName' => ['color', 'shoeSize']
],
Expected XML
<variantAttributeNames>
<variantAttributeName>color</variantAttributeName>
<variantAttributeName>clothingSize</variantAttributeName>
</variantAttributeNames>
But I got the different type of XML. I got the following xml from A2X.php
<variantAttributeNames>
<variantAttributeName>
<item>color</item>
</variantAttributeName>
<variantAttributeName>
<item>clothingSize</item>
</variantAttributeName>
</variantAttributeNames>
item tag automatically added after array to xml conversion. After that I checked the A2X.php. I found one static name item on line number 121
$elementName = 'item'
After that I modified my array and modified A2X,php file.
I removed variantAttributeName from my array and replace the item to variantAttributeName in A2X.php
My updated request array given below
requestArray.txt
Now I get the expected result
<variantAttributeNames>
<variantAttributeName>color</variantAttributeName>
<variantAttributeName>clothingSize</variantAttributeName>
</variantAttributeNames>
Will my changes affect any other parts of SDK?
Do you have any functions that create products XML like the expected xml above? if you have the function in SDK then I can use that function to prepare XML from array. I can revert my changes.