Prestashop: display of tree categories in the back-office of the module

I am making a payment gateway, and it may happen that, depending on the store manager, taxes may already be included in the price or not. Thus, when enabled, the tax field will be 0, and I need to get the value without tax. I came up with the idea of ​​creating a category tree in the back office of the module, where the store manager can specify the tax for each category, so if it is included in the price, I can calculate it, which category the product belongs to.

My problem, I do not know how to display the category tree in the back office. How can i do this?

+4
source share
2 answers

renderCategoryTree Helper (classes/helper/Helper.php):

$helper = new Helper();
$categoryTree = $helper->renderCategoryTree();

modules/blocklayered/blocklayered.php .

+3

HelperTreeCategories.

        $categories = new HelperTreeCategories('associated-categories-tree', ' ');
    $categories->setUseCheckBox(1)
                ->setUseSearch(1);
            $categories->render(); // To show categires select with checkboxes as on product category association page
+1

Source: https://habr.com/ru/post/1540351/


All Articles