Jump to content
martin_88

Display category Name BD Query

Recommended Posts

Got this peace of code but I can't display the Category Name ...

1.7.6

 

        parent::__construct();
        $this->bootstrap = true; // use Bootstrap CSS
        $this->table = 'referencegenerator'; // SQL table name, will be prefixed with _DB_PREFIX_
        $this->identifier = 'id'; // SQL column to be used as primary key
        $this->className = 'Shortcode'; // PHP class name
        $this->allow_export = true; // allow export in CSV, XLS..

	       $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl
            ON (cl.`id_category` = `id_cat`
            AND cl.`id_lang` = '.(int)$this->context->language->id.')';
    

        $this->_defaultOrderBy = 'id'; // the table alias is always `a`
        $this->_defaultOrderWay = 'DESC';
        $this->fields_list = [
            'id' => ['title' => 'ID','class' => 'fixed-width-xs'],
            'id_cat' => ['title' => 'Id Cat'],
            'name'=> ['title' => 'Cat Name'],
            'shortcode' => ['title' => 'Shortcode'],
        ];

 

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More