Jump to content

[SOLVED] how to add manufacturer name in tpl


ruisonika

Recommended Posts

hello guys,
does anybody knows how can i add a manufacturer name in my custom tpl file, i've developed a module and this is my controller
 

<?php
Class pesquisaequipamentoAllproductsModuleFrontController extends ModuleFrontController
{
    public function init()
    {
        $this->page_name = 'allproducts'; // page_name and body id
        $this->display_column_left = true;
        $this->display_column_right = false;
        parent::init();
    } 
    
    public function setMedia()
    {
        parent::setMedia();
        //$this->addCSS(__PS_BASE_URI__.'modules/'.$this->module->name.'/css/'.$this->module->name.'.css');
        $this->addCSS(__PS_BASE_URI__.'modules/'.$this->module->name.'/js/pesquisaconsumiveis--.js');
        //$this->addCSS(__PS_BASE_URI__.'modules/'.$this->module->name.'/css/datatable.css');
         
    } 
    
    public function initContent()
    {
        parent::initContent();
     
        $products_count = $this->module->countAllProducts();
        $this->pagination($products_count); // needs to be here, so that page number and products per page are assigned to "p" and "n"
        $var = $this->module->searchAllProducts();
        //$products_partial = Product::getProducts($this->context->language->id, ((int)$this->p - 1) * (int)$this->n, $this->n, 'name', 'asc');
        $products = Product::getProductsProperties($this->context->language->id, $var);
        
        
        foreach ($products as $key => $product) {
            foreach ($products as $key => $product) {
                $products[$key]['id_image'] = Product::getCover($product['id_product'])['id_image'];
            }
        }
        
        $this->context->smarty->assign(array(
            'products' => $products,
            'homeSize' => Image::getSize('home_default')
            
        ));
        $this->setTemplate('allproducts.tpl');
    }   
}

In my tpl file i only get id_manufacturer

Edited by ruisonika (see edit history)
Link to comment
Share on other sites

  • ruisonika changed the title to [SOLVED] how to add manufacturer name in tpl

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...