lukabers Posted September 24, 2014 Share Posted September 24, 2014 Hello, how can i use different layout/template for a product page? I know i can use a different layout for a category but how with products?Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 24, 2014 Share Posted September 24, 2014 productController.php located in /controllers/front/ directory depending on product ID load template file you want to display: if ($this->product->id==5){ $this->setTemplate(_PS_THEME_DIR_.'theme-file-for-product-with-id-5.tpl'); } else { $this->setTemplate(_PS_THEME_DIR_.'product.tpl'); } Link to comment Share on other sites More sharing options...
wiliwili Posted November 21, 2014 Share Posted November 21, 2014 or by category replace on line 293 $this->setTemplate(_PS_THEME_DIR_.'product.tpl'); if ($this->product->id_category_default == 15 || $this->product->id_category_default == 16 ){ $this->setTemplate(_PS_THEME_DIR_.'product-abb.tpl');} else $this->setTemplate(_PS_THEME_DIR_.'product.tpl'); or what ever you want :-) Link to comment Share on other sites More sharing options...
Orsetto Posted November 22, 2014 Share Posted November 22, 2014 Sorry, this solution is for every version of PS or no? 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