Jump to content

[SOLVED] Hide left column only on manufacturer-list


Recommended Posts

take a look:

 

controllers/front/ManufacturersController.php

	public function initContent()
	{
		parent::initContent();

		if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop())
		{
			$this->productSort();
			$this->assignOne();
			$this->setTemplate(_PS_THEME_DIR_.'manufacturer.tpl');
		}
		else
		{
			$this->assignAll();
                        $this->display_column_left = false;
			$this->setTemplate(_PS_THEME_DIR_.'manufacturer-list.tpl');
		}
	}

i added $this->display_column_left = false; to section related to manufacturer-list.tpl :)

enjoy!

Link to comment
Share on other sites

oops! by bad

 

the same file, use this code:

if (isset($_GET['id_manufacturer']))
		{
        $this->display_column_left = true;
	    } else {
        $this->display_column_left = false;
        } 

in init() function:

	/**
	 * Initialize manufaturer controller
	 * @see FrontController::init()
	 */
	public function init()
	{
		parent::init();
        if (isset($_GET['id_manufacturer']))
		{
        $this->display_column_left = true;
	    } else {
        $this->display_column_left = false;
        } 

effect:

8ELJuA4.png

 

and left column on manufacturer page:
0TbUkZo.png

  • Like 1
Link to comment
Share on other sites

  • 8 months later...
  • 1 year later...

Vekia's trick works like a charm! Though, in some themes, you may have issue with the width of the center column.

In my case I found a "dirty" solution by adding a <style> inside the manufacturers-list.tpl

<style>
.show-left-column #center_column {
    width: 100%!important;
}
</style>

@Bhodi

The issue is that when you select to activate a column for the manufacturers on the template settings, you enable the column for both, manufacturers-list and single manufacturer, pages. The goal with this trick is to have a column enabled ONLY on the single manufacturer page and NOT on the manufacturers-list. :)

But I agree with you that for all the other pages, you don't need css, or any other coding... Just to set the columns properly (as long as the theme selected supports it!)

Link to comment
Share on other sites

  • 2 years later...

Hello Vekia

I am using prestashop 1.7 and I want to show the left column on the manufacturer listing.

Should I add inside controllers/front/listing/ManufacturerController.php ?

$this->display_column_left = true;

Actually, my main issues is when I try to clic on pagination like 2,3... on the listing of product of a specific manufacturer, nothing happens.

I saw it is because of the faceted module that is not on the left column because on my category listing, the pagination works.

Thank you for your help

Link to comment
Share on other sites

  • 1 month later...

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