RomsWebDesign Posted August 6, 2013 Share Posted August 6, 2013 (edited) Hi guys, One of my clients want to it shop a specific presentation from one of its categories. And for this category, he would like a specific presentation for all its subcategories. I would like to know if it is possible to create a specific template for a category ? And if it is possible to create a template for all subcategory of a specific category ? Example : This link => http://espace-vin.com/domaine.html represent the category page. It list all subcategories. And this link => http://espace-vin.co...rie-bellet.html represent one of its subcategories. We have the subcategory title, description and a list of all product in this subcategory. Can you help me please ? I have find this => http://www.prestasho...cific-category/ but I don't know how to operate it. Thanks. P.S. Sorry for my English. Edited August 6, 2013 by RomsWebDesign (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted August 7, 2013 Share Posted August 7, 2013 Hi, Can you explain 'I don't know how to operate it'? I think that's a good way to go. You have to be fond of php and controllers if you want to do such thing as multiple templating. If you're not, I suggest you first look at how to override controllers and classes in the official docs, here: http://doc.prestashop.com/display/PS15/Overriding+default+behaviors cheers! Link to comment Share on other sites More sharing options...
Skydone Posted December 3, 2013 Share Posted December 3, 2013 Hello, I was using this controller extends in PS 1.4.7 and it works perfectly, but after upgrade to PS 1.5.6 it doesn't works and I don't know why... I am searching for any solution or module to create custom product templates in PS 1.5, but I don't find nothing usefull. Can anyone help me, please? Link to comment Share on other sites More sharing options...
vekia Posted December 3, 2013 Share Posted December 3, 2013 it's probably because your override isn't compatibile with 1.5.6 release. what you mean by "doesnt work" exactly? white page? error messages? can you shed some light on this please? Link to comment Share on other sites More sharing options...
Skydone Posted December 3, 2013 Share Posted December 3, 2013 (edited) Sorry vekia. Simply the override doesn't works :-P Prestashop works fine but don't load the custom tpl. But finally, I have found another way to do this(almost for me). Instead using the category url, it uses the default category id: class ProductController extends ProductControllerCore { public function initContent() { parent::initContent(); /* Teste si le fichier existe ou non, sinon c'est le fichier par défaut qui est affiché */ if (is_file(_PS_THEME_DIR_.'product_'. $this->product->id_category_default .'.tpl')) { $this->setTemplate(_PS_THEME_DIR_.'product_'. $this->product->id_category_default .'.tpl'); } else { $this->setTemplate(_PS_THEME_DIR_.'product.tpl'); } } } Viewed here (in french): http://www.prestashop.com/forums/topic/254182-fiche-produit-en-fonction-de-la-categorie/?do=findComment&comment=1431086 Edited December 3, 2013 by Skydone (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted December 4, 2013 Share Posted December 4, 2013 here on board you can find a lot of threads with this solution, also for cms pages, category pages etc. glad to hear that you found solution thanks for sharing url! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now