Jump to content

Hide/disable manufacturer and supplier pages from F.O.


DARKF3D3

Recommended Posts

The page is always there as long as the page controller is there.

If you want complete; remove this page, you need rename or remove the page controller

 

/controllers/front/ManufacturerController.php

/controllers/front/SupplierController.php

 
Link to comment
Share on other sites

There's actually a setting available for this in the Back Office. Go to the Preferences > General tab and change "Display suppliers and manufacturers" to "No" and then click the "Save" button at the bottom.

  • Like 2
Link to comment
Share on other sites

I think the configuration option will only hide or remove option for manufacturer or suppliers on product related pages.

but if you manually enter the URL of the page ( can be opened typing the url in the browser), it will still shows because the pages are always there unless you rename/remove the page controller.

Link to comment
Share on other sites

  • 2 months later...

Following the shokinro tip I renamed supplier and manufacturer controller, and now that pages are no more visible.

The only annoying thing it's that now my server error log it's full of warns like this one:

mod_fcgid: stderr: PHP Fatal error:  Class 'ManufacturerControllerCore' not found in /var/www/vhosts/my-domain.com/httpdocs/override/controllers/front/ManufacturerController.php on line 11

 

Do you know if there's an alternative method to avoid this?

Link to comment
Share on other sites

  • 3 years later...
  • 2 months later...

I don't know if my solution is the best way of doing it but it's better than anything here.  Hope it helps

Add an override file here: ./overrides/controllers/front/ManufacturerController.php

<?php

class ManufacturerController extends ManufacturerControllerCore
{
	public function initContent()
	{
		parent::initContent();
		
		// set 404 headers
		header('HTTP/1.1 404 Not Found');
		header('Status: 404 Not Found');
		
		// load 404 template
		$this->setTemplate(_PS_THEME_DIR_.'404.tpl');
	}
}

The same will no doubt be true for the Supplier Controller.

Also remember to remove manufacturer & supplier from our robots.txt file

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