Jump to content

[SOLVED] Adding manufacturer pages (different manufacturer.tpl)


Recommended Posts

Hi everyone,

manufacturer.php generates pages under urls such as this on:
root/manufacturer.php?id_manufacturer=1

The appearance of these pages is controlled through the theme's manufacturer.tpl
In my case it is only displaying manufacturer logo and description on the page.

However I'd also like to use the catalog sorting function the manufacturer page has in PrestaShop. Thus I would like to add a second set of manufacturer pages with a separate manufacturer2.tpl. in order for this template to be styled like product-list.tpl.


This is how far I've gotten until now.

In Presta's root I've doublicated the manufacturer.php and renamed it manufacturer2.php. That gives me a new manufactuer page at this location: root/manufacturer2.php.
Not very surprisingly it has the very same content as manufactuer.php.

How do I go about from here?
All I want is to be able to apply a different manufactuer.tpl and a different manufacturer-list.tpl?

Looking forward to your reply!

Link to comment
Share on other sites

Ok, now here is my approach to this.
Works perfectly.

In Presta's root folder dublicate manufacturer.php and supplier.php and rename them to manufacturer2.php and supplier2.php.

supplier2.php which is no more than this tiny bit of code

<?php
$objectType = 'manufacturer';
include('./supplier.php');
?>



needs to be changed to

<?php
$objectType = 'manufacturer';
include('./supplier2.php');
?>



Then inside supplier2.php find the following two lines

$smarty->display(_PS_THEME_DIR_.$objectType.'.tpl');


$smarty->display(_PS_THEME_DIR_.$objectType.'-list.tpl');



and change them to

$smarty->display(_PS_THEME_DIR_.$objectType.'2.tpl');


$smarty->display(_PS_THEME_DIR_.$objectType.'2-list.tpl');



Now at last you will need to copy your theme's maufacturer.tpl and manufactuer-list.tpl renaming the copies to maufacturer2.tpl and manufactuer2-list.tpl.

That is it. Theses two new tpl. files can be edited to show completely different content than the originals.

Link to comment
Share on other sites

Can someone assist me in editing the manufacturerblock navigation to reference these new manufacturer-pages.

Nothing fancy required. I was thinking to just dublicate the blockmanufacturer navigation and then editing blockmanufactuer.php or blockmanufacturer.tpl to reference the manufacturer2... insted of the original files.

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