选择类别表单元格ID和描述

时间:2019-02-17 17:25:54

标签: php categories opencart-3

尝试在opencart中创建xml。向类别表添加了两个额外的单元格。我可以在opencart 2,0的类别表中选择两个单元格。我想opencart 3,0具有不同的结构。我无法选择我在opencart 2,0中使用的两个单元格,我应该改变什么,或者我应该怎么看?

$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['a11_id'];
                                } else {
                                    $string .= ' > ' . $category_info['a11_id'];
                                }
                            }
                        }

                    }
                }
                foreach ($categories as $category) {
                    $path = $this->getPath($category['category_id']);
                    if ($path) {
                        $string1 = '';
                        foreach (explode('_', $path) as $path_id) {
                            $category_info = $this->model_catalog_category->getCategory($path_id);
                            if ($category_info) {
                                if (!$string1) {
                                    $string1 = $category_info['a11_description'];
                                } else {
                                    $string1 .= ' > ' . $category_info['a11_description'];
                                }
                            }
                        }

                    }
                }

0 个答案:

没有答案