Jump to content

specific product layout


Inform-All

Recommended Posts

Hi!

I've made two product.tpl files, one file is for products with a decimal order input field, and the other one is for round number product orders. They both work correct!

 

But here is the deal, I want to specify for each product wich .tpl file it should use. So I made a category that contains all the the products that are orderd in decimal.

In ProductController.php I changed:


  • if ($this->category->id == 93)

  • $this->setTemplate(_PS_THEME_DIR_.'product2.tpl');

  • else

  • $this->setTemplate(_PS_THEME_DIR_.'product.tpl');

 

And again this worked perfect! Untill a product contains two category's.. If you look at the product in the front office using the main category, it selects the correct .tpl file, but if you visit the product by using the other category selects the wrong one.

 

Any ideas how to solve this?

Thank you in advance.

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