diff --git a/src/LukeSnowden/GoogleShoppingFeed/Item.php b/src/LukeSnowden/GoogleShoppingFeed/Item.php index 7463661..69c6231 100644 --- a/src/LukeSnowden/GoogleShoppingFeed/Item.php +++ b/src/LukeSnowden/GoogleShoppingFeed/Item.php @@ -452,15 +452,19 @@ public function cloneIt() if (is_array($node)) { // multiple accepted values.. $name = $node[0]->get('name'); + $multipleNodes = array(); foreach ($node as $_node) { if ($name == 'shipping') { // Shipping has another layer so we are going to have to do a little hack $xml = simplexml_load_string('' . trim(str_replace('g:', '', $_node->get('value'))) . ''); $item->{$_node->get('name')}($xml->country, $xml->service, $xml->price); } else { - $item->{$name}($_node->get('value')); + $multipleNodes[$name][] = $_node->get('value'); } } + if (count($multipleNodes)) { + $item->{$name}($multipleNodes[$name]); + } } elseif ($node->get('name') !== 'shipping') { if (method_exists($item, $node->get('name'))) { $item->{$node->get('name')}($node->get('value'));