private function _renderData($data) { if (!is_array($data) && !$data instanceof Traversable) { throw new JException(JText::_('COM_JEPROSHOP_DATA_MUST_BE_A_TRAVERSABLE_ARRAY_MESSAGE')); } $html = ''; foreach ($data as $item) { $html .= JeproshopTools::jsonEncode($item) . ', '; if (array_key_exists('children', $item) && !empty($item->children)) { $html .= $this->renderData($item->children); } } return $html; }