I am working on the inbuilt google base extension in opencart 3.x, i need a special tag to display all the child element in a categories in format(Home>category1>category1_1)
Here's the inbuilt code i tried to tweak which displays every category one after the order
$categories = $this->model_catalog_product->getCategories($product['product_id']);
foreach ($categories as $category) {
$path = $this->getPath($category['category_id']);
if ($path) {
$string = '';
foreach (explode('_', $path) as $path_id) {
$category_info = $this->model_catalog_category->getCategory($path_id);
if ($category_info) {
if (!$string) {
$string = $category_info['name'];
} else {
$string .= ' > ' . $category_info['name'];
}
}
}
$output .= '<g:product_type><![CDATA[' . $string . ']]></g:product_type>';
}
}