Post by aha56 » Fri Nov 30, 2012 11:00 pm

Hi there,
Forgive me if I'm about to say something daft - I am a beginner at opencart and php.
I am using Opecart Version 1.5.1.3

I have found/ created a way to apply a different product template to a single product. This was done by adding the following code into the file at catalog/controller/product/product.php -

Code: Select all

			if($this->request->get['product_id'] == '500') {  // If ID matches this, use this new template
			   if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product_new.tpl')) {
				  $this->template = $this->config->get('config_template') . '/template/product/product_new.tpl';
			   } else {
				  $this->template = 'default/template/product/product.tpl';
			   }
			} else {  // If not, use standard
			   if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
				  $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
			   } else {
				 $this->template = 'default/template/product/product.tpl';
			   }
			}
What I would like to do is find a way so that all products within a certain category are sent to the product_new template. Can anybody help?

Thnks,
A

Newbie

Posts

Joined
Fri Jan 27, 2012 1:54 am
Who is online

Users browsing this forum: Baidu [Spider] and 209 guests