Post by smileyriley21 » Thu Feb 02, 2012 12:56 am

Hi all,

Firstly, I am loving Open Cart. Nice to get hold of a platform so neatly built.

OK, So this is my problem.

I am trying to create an alternative layout for certain products. For instance, some products will use the standard product layout file (product.tpl) and others will use an alternative layout.

I have tried creating a new layout called alternative_product.tpl and copied it from the product.tpl. I have added athe new layout in the admin area (System > Design > Layouts) have then assigned it to a product to test it but it seems to use the default layout. Of course, I have made some modifications to check it works.

Do I need to create a new controller to manage this? How does it work?

Any help would be much appreciated.

Cheers

Newbie

Posts

Joined
Tue Jan 31, 2012 6:42 pm

Post by straightlight » Thu Feb 02, 2012 1:45 am

Do I need to create a new controller to manage this? How does it work?
You will either need to create a new controller file or to use the already created product controller file to assign your new template along with it. However, if you decide to use the product controller file for integration, then better to do it from VQMod on this one though so not to affect core files for upgrade purposes in the future. ;)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by smileyriley21 » Thu Feb 02, 2012 1:56 am

Hi Straightlight,

Thanks for the response. I am fairly new to open cart but an experienced programmer. Is VQMod the way to go when making modifications to core files?

Cheers

Chris

Newbie

Posts

Joined
Tue Jan 31, 2012 6:42 pm

Post by straightlight » Thu Feb 02, 2012 2:17 am

Yes, definitely. The only thing you need to assure is not to encounter conflict between XML file initialization from either same or different distributors.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by smileyriley21 » Thu Feb 02, 2012 7:30 pm

Hi Straightlight,

Found some VQMod info and reading through it now. Exciting times :)

Thanks for your help

Chris

Newbie

Posts

Joined
Tue Jan 31, 2012 6:42 pm

Post by mandamexico » Tue Jun 25, 2013 1:32 pm

anyone figure this out? custom product layouts would make opencart even more epic than it already is!

My Extensions

OpenCart Developer (OCD) Tools

Donate - If I ever helped you.


User avatar
Active Member

Posts

Joined
Mon Jun 29, 2009 10:14 am
Location - Los Angeles, CA

Post by labeshops » Tue Jun 25, 2013 7:00 pm

There is an extension in the store for custom category and product layouts, though it had some issues and I had to manually assign the layouts in the database to make it work. Not sure if this has been fixed now or not.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by mandamexico » Thu Jun 27, 2013 11:15 am

Then what is the design tab used for when editing a product? I created a new layout and assigned the product to it but the default product controller keeps loading. If there is no use for the design tab to allow different product layouts remove this feature all together.

Very frustrating...

My Extensions

OpenCart Developer (OCD) Tools

Donate - If I ever helped you.


User avatar
Active Member

Posts

Joined
Mon Jun 29, 2009 10:14 am
Location - Los Angeles, CA

Post by mandamexico » Thu Jun 27, 2013 11:24 am

On another note: Deleting the header tags on top of any .tpl file for page editing breaks the whole page. This is because the header tag calls the styles for all the pages. This makes it harder if not impossible to highly customize a page that does not need a header (or even footer for the footer tag) in every page.

This is why developers still use wordpress. They use wordpress and use cart plug-ins (opencart being the least used). If this issue is resolved OpenCart would expand greatly, not only as a shopping cart but a full fledged/full featured Web designing CMS that would have people saying "wordpress what?"

Just my $.02

My Extensions

OpenCart Developer (OCD) Tools

Donate - If I ever helped you.


User avatar
Active Member

Posts

Joined
Mon Jun 29, 2009 10:14 am
Location - Los Angeles, CA
Who is online

Users browsing this forum: stefansmith129 and 185 guests