Leonardo Lanchas
Leonardo Lanchas

Reputation: 1668

Prestashop: Display Categories tree in module back office

I am making a payment gateway and It could happen that depending on the shop manager, taxes maybe already included in the price, or not. So, when included, the tax field would be 0 and I need to get the price value without the tax. I came up with the idea of making a categories tree in the module back office where the shop manager may specify each category tax, so if it's included in the price, I can calculate it looking what category the product belongs to.

My problem, I do not know how to display the categories tree in the back office. How can I do it?

Upvotes: 4

Views: 6860

Answers (2)

I am using HelperTreeCategories helper.

        $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

Upvotes: 1

yenshirak
yenshirak

Reputation: 3106

You can use the renderCategoryTree method of the Helper class (classes/helper/Helper.php):

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

Take a look at modules/blocklayered/blocklayered.php for an example.

Upvotes: 3

Related Questions