Jump to content

Problem using Helper::renderCategoryTree()


Recommended Posts

I'm trying to develop a module and I need to show the category tree in the admin panel to select multiple categories. I've seen the helper with the "renderCategoryTree" function, but it only shows me the home category.

Any idea what I might be doing wrong?

This is the source code:

public function getContent(){
        if(Tools::isSubmit('procesar')){
            $valueFromPostOrGet = Tools::getValue('email');
            $msg = '<div class="alert alert-info">'.$valueFromPostOrGet.'</div>';
        }

	$url = AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules');
	$helper = new Helper();
        $categoryTree = $helper->renderCategoryTree();        
        
        $output .= '
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel col-lg-12">
                        <div class="panel-heading">
                            '.$this->name.'
                        </div>
                            '.$msg.'
                        <form action="'.$url.'" method="post" class="form-horizontal clearfix">
                            '.$categoryTree.'
                            <input type="text" name="email">
                            <input type="submit" name="procesar" value="submit"> 
                        </form>                        
                    </div>
                </div>
            </div>
        ';
        
        return $output;
    }

And this is the result.

c8SWejZNTnKJQiu9fuQcAA.png

 

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...