Skip to content

Commit

Permalink
fix validation of custom attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Miles authored and Mike Miles committed Jul 17, 2017
1 parent 511d3e6 commit 1b4ba7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Elements/ProductElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,12 @@ private function generateCustomAttributesXMLArray(array $custom_attributes) {
foreach ($custom_attributes as $attribute_id => $attribute_values) {
// Loop through all values for this attribute.
foreach ($attribute_values as $value) {
// Add basic element with value and id attribute.
$element['#children'][] = $this->generateElementXMLArray('Attribute', $value, ['id' => $attribute_id]);
// Add basic element with id attribute.
$attribute = $this->generateElementXMLArray('Attribute', FALSE, ['id' => $attribute_id]);
// Add Value as child of attribute.
$attribute['#children'][] = $this->generateElementXMLArray('Value', $value);
// Add to Attributes array.
$element['#children'][] = $attribute;
}
}
}
Expand Down

0 comments on commit 1b4ba7e

Please sign in to comment.