Page 1 of 3

Multiple Product/Category Templates + CSS Override [1.5.x.x]

Posted: Sun Apr 04, 2010 5:44 pm
by spikeachu
Multiple Template System
This will allow you to add some variance throughout your store by giving each product a different template.
Upload all templates you wish to use to your theme's template folder.

Under the data tab for each product and category you will find a Template dropdown. Select the template that you wish to use.

Provided as vQmod.


CSS Override
This will allow you to add some variance throughout your store by adding new CSS files and applying them to any product.
Upload all stylesheetss you wish to use to your theme's stylesheet folder.

Under the data tab for each product you will find a Stylesheet dropdown. Select the stylesheet that you wish to use to override.

Provided as vQmod.




Spike.

Mods have now been updated to v1.5.4.1

Multiple Template System ($15)
http://www.opencart.com/index.php?route ... on_id=2359

CSS Override ($15)
http://www.opencart.com/index.php?route ... on_id=8496

Or buy both together and save $10
http://www.opencart.com/index.php?route ... on_id=8497

Re: Multiple Product Templates [1.4.6]

Posted: Mon Apr 05, 2010 11:55 pm
by spikeachu
Would there be any interest in me extending this to also allow variation of category templates across the store?

Re: Multiple Product Templates [1.4.6]

Posted: Tue Apr 06, 2010 12:35 am
by i2Paq
Why not?

Any demo-site where I/we can see this?

Re: Multiple Product Templates [1.4.6]

Posted: Tue Apr 06, 2010 1:11 am
by spikeachu
I've only got it running on a local WAMP right now. I'll set it up on my live server so people can have a look. Will post link when done.

To be honest, i would have thought it should be a feature that would have been included as standard anyway. Maybe it will be integrated in a future release.

Re: Multiple Product Templates [1.4.6]

Posted: Tue Apr 06, 2010 1:50 am
by spikeachu
Test environment is set up at

http://www.celebritysweepstake.co.uk/opencart/admin

user: opencart
pass: opencart

The product template feature is available at Catalog > Product > Edit > Data Tab > Template drop down

Not all the templates uploaded are product compatible, but you should be able to see the effects in the actual store at http://www.celebritysweepstake.co.uk/opencart/

I have also added a mod for separating out orders of Zero value, which can be viewed under Sales > Zero Value Order

Any improvements or alterations required, let me know.

Re: Multiple Product Templates [1.4.6]

Posted: Wed Apr 07, 2010 1:34 pm
by cmebd
spikeachu wrote:Test environment is set up at

http://www.celebritysweepstake.co.uk/opencart/admin

user: opencart
pass: opencart

The product template feature is available at Catalog > Product > Edit > Data Tab > Template drop down

Not all the templates uploaded are product compatible, but you should be able to see the effects in the actual store at http://www.celebritysweepstake.co.uk/opencart/

I have also added a mod for separating out orders of Zero value, which can be viewed under Sales > Zero Value Order

Any improvements or alterations required, let me know.
G'day,

I am getting a lot of errors when visiting the product pages (after clicking on a link from the categories list).

10mins later: It was because the Category had a product template attached. If there was some way you could separate the different template types that would help I think.

Also not sure what the differences are in some of the product templates??

Re: Multiple Product Templates [1.4.6]

Posted: Wed Apr 07, 2010 2:27 pm
by spikeachu
cmebd wrote:
spikeachu wrote:Test environment is set up at

http://www.celebritysweepstake.co.uk/opencart/admin

user: opencart
pass: opencart

The product template feature is available at Catalog > Product > Edit > Data Tab > Template drop down

Not all the templates uploaded are product compatible, but you should be able to see the effects in the actual store at http://www.celebritysweepstake.co.uk/opencart/

I have also added a mod for separating out orders of Zero value, which can be viewed under Sales > Zero Value Order

Any improvements or alterations required, let me know.
G'day,

I am getting a lot of errors when visiting the product pages (after clicking on a link from the categories list).

10mins later: It was because the Category had a product template attached. If there was some way you could separate the different template types that would help I think.

Also not sure what the differences are in some of the product templates??
Right now, there's very little difference between product templates. Just a line of text saying 'Template 1' , 'template 2' etc ... Which was so I could identify that a different template was loading while testing. When I get a spare hour i'll make a couple that look visually different.

The point you make about selecting incompatible templates is valid and i'll amend the code over the next couple of days.

Thanks for the feedback.

Re: Multiple Product Templates [1.4.6]

Posted: Thu Apr 08, 2010 4:22 am
by spikeachu
Updated to prevent selection of incompatible templates.
Now includes category template system.

Tested with 1.4.6 and 1.4.7
<<Scroll Down for v 1.4.8 / 1.4.8b>>

Re: Multiple Product Templates [1.4.6]

Posted: Thu Jul 15, 2010 11:20 am
by cmebd
I am so sorry I missed this previously - the notifications are getting a bit spasmodic - I am getting notification of posts in threads from May at the moment.

Thank you so much for this - I will install and test out the concept I am looking to achieve and post back here.

Cheers
Christine

Re: Multiple Product Templates [1.4.6]

Posted: Fri Jul 16, 2010 11:21 am
by 900pixels
Any plans for getting this working on 1.4.8 version of opencart?
Will it work on a 1.4.8 install as it is?

Cheers.

Re: Multiple Product Templates [1.4.6]

Posted: Sun Jul 18, 2010 9:45 pm
by cmebd
spikeachu wrote:Updated to prevent selection of incompatible templates.
Now includes category template system.
I seem to be having problems with the download. I keep getting an error when trying to unzip: does not appear to be a valid archive. I am sure its at my end but I have downloaded about 7 times (turning off my security scans (which I wouldn't normally do)) but still get the error.

Is it possible to send to me please. I will PM you details if that is OK?

Cheers

Re: Multiple Product Templates [1.4.6]

Posted: Mon Jul 19, 2010 1:40 am
by spikeachu
cmebd wrote:
spikeachu wrote:Updated to prevent selection of incompatible templates.
Now includes category template system.
I seem to be having problems with the download. I keep getting an error when trying to unzip: does not appear to be a valid archive. I am sure its at my end but I have downloaded about 7 times (turning off my security scans (which I wouldn't normally do)) but still get the error.

Is it possible to send to me please. I will PM you details if that is OK?

Cheers
The files uploaded above have become corrupted. I've updated for v1.4.8 and attached to this post.
Any issues, let me know.

The zip file attached contains 2 versions.
v0.1 for 1.4.6 - 1.4.7
v0.2 for 1.4.8 - 1.4.8b

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Tue Jul 20, 2010 11:12 pm
by timkirtley
All good - except one small hitch..

Pretty sure I made all the correct edits but obviously have missed something...

The setting in the back end to select a template for a category was there, but when I tried to save my change I get this error:

Error: Unknown column 'template' in 'field list'
Error No: 1054
UPDATE category SET parent_id = '0', sort_order = '1', template = 'category_35.tpl', status = '1', date_modified = NOW() WHERE category_id = '35'


I'm pretty sure I have created the 'template' field in the products table correctly.

Any ideas what I've done wrong?

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Wed Jul 21, 2010 7:41 pm
by spikeachu
timkirtley wrote:All good - except one small hitch..

Pretty sure I made all the correct edits but obviously have missed something...

The setting in the back end to select a template for a category was there, but when I tried to save my change I get this error:

Error: Unknown column 'template' in 'field list'
Error No: 1054
UPDATE category SET parent_id = '0', sort_order = '1', template = 'category_35.tpl', status = '1', date_modified = NOW() WHERE category_id = '35'


I'm pretty sure I have created the 'template' field in the products table correctly.

Any ideas what I've done wrong?

You'll need to insert a new column named 'template' of type VARCHAR into your product table. That should do the job.

Regards, Spike.

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Wed Jul 21, 2010 7:59 pm
by timkirtley
Okay, I'm pretty sure I've done that correctly though..

Using phpmyadmin, selected the 'product' table. Added a new field at the bottom of the table called 'template' as varchar(64).

Does that sound right?

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Wed Jul 21, 2010 8:20 pm
by spikeachu
Sorry, misread the error. It needs one in the category table too.
I updated the module to support category as well as product, but might have missed that step from the documentation.

I'll update the docs when I get home, thanks for bringing it to my attention.

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Thu Jul 22, 2010 9:17 am
by cmebd
Hi Spikeachu,

I installed in 1.4.8 installation went very smoothly. However when installing the 1.4.6 -1.4.7 version I am getting this error on the product /general tab page

Notice: Undefined variable: entry_tags in /path/html/admin/view/template/catalog/product_form.tpl on line 43

Any idea what my problem may be?

Cheers

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Fri Jul 23, 2010 12:17 am
by DannyMacD
as mine is a custom install and would love this feature, would you happen to have the snippets of code rather than files at all? :)

thank you so much.

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Fri Jul 23, 2010 5:47 am
by spikeachu
cmebd wrote:Hi Spikeachu,

I installed in 1.4.8 installation went very smoothly. However when installing the 1.4.6 -1.4.7 version I am getting this error on the product /general tab page

Notice: Undefined variable: entry_tags in /path/html/admin/view/template/catalog/product_form.tpl on line 43

Any idea what my problem may be?

Cheers
Hi,

Looks like i've managed to sneak in a template for 1.4.8 into the 1.4.6 - 7 folders. Tags weren't introduced until 1.4.8, so the variable on that line of code in the template needs removing.

Regards, Spike.

Re: Multiple Product Templates [1.4.6 - 1.4.8]

Posted: Fri Jul 23, 2010 5:50 am
by spikeachu
DannyMacD wrote:as mine is a custom install and would love this feature, would you happen to have the snippets of code rather than files at all? :)

thank you so much.
I'll put together some code snippets, but my work load is quite high at the moment. Can you hang on till the weekend?
If not, v1.4.8 should be commented, so you can find the comments and make the changes in your customised files.

The only change for 1.4.8 is the token system.

Regards, Spike.