Page 1 of 1

[MOD] Block access to Brands page if info not viewable

Posted: Tue Jan 11, 2011 11:08 pm
by Martin
An annoyance for ISC is that if you set your store configuration so that brand information is not displayed, it's still possible for a visitor to go to the brands.php page and start looking through your product brands information and potentially get information on where you're sourcing your products (particularly annoying if your competitors are viewing).

This mod, resolves that by providing a 404 error if the configuration variable for:
Admin > Store Settings > Display > Show Product's Brand? is set to No

Open: includes/classes/class.brands.php

Find:

Code: Select all

			$brand = MakeURLNormal($brand);

			// Get the link to the "all brands" page
			$GLOBALS['AllBrandsLink'] = BrandLink();
Before, Add:

Code: Select all

			// MOD: Show 404 if show brands is not enabled
			if(!$GLOBALS['ISC_CFG']['ShowProductBrand']) {
				$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');
				$GLOBALS['ISC_CLASS_404']->HandlePage();
				exit;
			}
			// MOD END

Re: [MOD] Block access to Brands page if info not viewable

Posted: Tue Jan 11, 2011 11:11 pm
by Martin
If you are using the mobile template in 6.x then you may also wish to remove the following lines in these files:

Open: templates/__mobile/Panels/IphoneTopMenu.html

Find and delete:

Code: Select all

<li><a href="#anchorBrand">Shop by Brand</a></li>
Open: templates/__mobile/Panels/PagesMenu.html

Find and delete:

Code: Select all

<li><a href="%%GLOBAL_ShopPathNormal%%/brands.php">Shop by Brand</a></li>

Re: [MOD] Block access to Brands page if info not viewable

Posted: Tue Apr 19, 2011 4:12 pm
by Martin
This information gets EVERYWHERE...

Here's how to remove the information from your sitemap too..

Open: includes/classes/class.sitemap.model.brands.php

Find:

Code: Select all

	public function getTree($limit = null, $offset = null)
	{
		$root = new ISC_SITEMAP_ROOT();
After, Add:

Code: Select all

		if(!$GLOBALS['ISC_CFG']['ShowProductBrand']) {
			return $root;
		}