Post by Qphoria » Sun Nov 01, 2009 2:59 am

JNeuhoff wrote:I am not quite sure I understand the underlying reasons for your template change.
I noticed that on all your top-level templates, e.g.

product/category.tpl, product/product.tpl, etc. your repeat the same common DIVs, such as

Code: Select all

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
......
</div>
<?php echo $footer; ?> 

If I were to change this layout structure to something else, yet still wanted to use all the sub-templates for e.g. the boxes etc., I'd now end up editing multiple *.tpl file instead of just one common layout.tpl as it used to be the case. I quite often change the main layout.tpl to make it better integrate into existing websites, it's not always doable by merely changing stylesheets. See for example this Opencart store with a different 2-column layout. I would no longer be able to do such a thing in this latest Opencart 1.3.3 unless I changed all the top-level *.tpl files.
I just took a look at what it would take to port my mods to work with 1.3.3.. and I couldn't agree more with JN. Repetitive code is just bad design in any language.. thats page 1 of Coding 101. Having a common base and using modules to "plugin" to it was not only intuitive, it was the norm. I've not seen any other systems use this new method.

Popular ones like SMF forums, ZenCart, osC, WebsiteBaker, Drupal all use the old method of having a "base layout". I think only Wordpress does something similar to this new method. Which is fine for wordpress, but what benefit is it to OpenCart? 5 times the work for the ability to "hardcode" something which is page 2 of Coding 101.

I'm gonna have to go thumbs down on this one. I'll wait for 1.3.4 with hopes that you back this "feature" out.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JNeuhoff » Sun Nov 01, 2009 3:11 am

I just took a look at what it would take to port my mods to work with 1.3.3.. and I couldn't agree more with JN. Repetitive code is just bad design in any language.
I agree. As an example, I just ported the Export/Import module over to Opencart 1.3.3 and had to, among others, change all its *.tpl files because of this issue.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Qphoria » Sun Nov 01, 2009 3:26 am

More to this point... the hacky "fallback" design having to edit each controller is ridiculous.

You should have added the file_exists to the system/engine/controller->render() function where you actually load the files. You already do a file exists there so you could have added a simple 2 line conditional. You could have added the code 1 time and it would work for ALL files without update.

Sorry, but 1.3.3 is a bust.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Sun Nov 01, 2009 5:59 am

I did it to keep everythign spearate.

the cotnroller should not know anythign about the config class.

I know it causes more code but it makes things more resuable.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Leon » Sun Nov 01, 2009 6:55 am

phpMyAdmin errors when i try to run the stuff in the upgrade.txt

Error

SQL query:

ALTER TABLE `order` ADD `shipping_zone_id` INT( 11 ) NOT NULL AFTER `shipping_zone` ALTER TABLE `order` ADD `shipping_country_id` INT( 11 ) NOT NULL AFTER `shipping_country` ALTER TABLE `order` ADD `payment_zone_id` INT( 11 ) NOT NULL AFTER `payment_zone` ALTER TABLE `order` ADD `payment_country_id` INT( 11 ) NOT NULL AFTER `payment_country` ALTER TABLE `order_option` ADD `product_option_value_id` INT( 11 ) NOT NULL AFTER `order_product_id` ALTER TABLE `product` ADD `sku` VARCHAR( 64 ) NOT NULL AFTER `model` ALTER TABLE `product` ADD `location` VARCHAR( 128 ) NOT NULL AFTER `sku` ALTER TABLE `product` CHANGE `image` `image` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE `order` ADD `shipping_country_id` INT( 11 ) NOT NULL AFTER `shipping' at line 4

Active Member

Posts

Joined
Tue Apr 07, 2009 1:20 am

Post by Leon » Sun Nov 01, 2009 7:01 am

Easily fixed by adding ; after each of the changes

Active Member

Posts

Joined
Tue Apr 07, 2009 1:20 am

Post by Qphoria » Sun Nov 01, 2009 7:37 am

Daniel wrote:I did it to keep everythign spearate.

the cotnroller should not know anythign about the config class.

I know it causes more code but it makes things more resuable.
The config class? Its the engine class. It has to load the file with render() anyway, so if you added the file_exist code there it would "blanket" the entire filesystem fallback.

But overall what does it offer? It seems to be more work, but it seems to solve a problem that nobody had. The template system was decent. By just adding the fallback to the render() function would have made it near perfect

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by leovicio » Sun Nov 01, 2009 9:23 am

It would be nice to be able to add or remove fields in the registration form
For some more accurate data than other

What about validation that could make it required or not and if and only numbers or text only, amount of characters such Cóias

For I also need some additional data (CPF, more data address) and every time a new version comes out I have to change a lot of files

User avatar
Newbie

Posts

Joined
Sun Apr 12, 2009 11:43 am

Post by Albert » Sun Nov 01, 2009 8:53 pm

Thanks so much,Daniel!good job!
downloading now...

-> eCommerce Service Provider ekuzo


User avatar
New member

Posts

Joined
Sat Oct 06, 2007 10:51 am
Location - China

Post by Franz-Peter » Sun Nov 01, 2009 10:01 pm

I do not understand the phrase: not happy with OpenCart 1.3.3 without layout.tpl by mentioning OS Commerce or ZenCart.
OSCommerce has no template system and in every php file you have to integrate things like: columnleft, columnright, header and footer. I am using OSC since a couple of years and I confirm there is no template system (the Alpha 3 is not a production release, so it is until now just a presentation how it may or may not work in the future or no future?).
ZenCart is OSCommerce with a somehow integrated template system like bts or sts.
I think Daniel has made the right decision to abolish the layout.tpl and allow a better flexibility.

If someone prefers to use OpenCart with layout.tpl, there is no problem to stay with 1.3.2.
If Daniel would ask everybody for everything, we would continue like oscommerce did or does. If all discussions are finished, the child is dead and there is no need for further discussions.

New member

Posts

Joined
Tue Aug 25, 2009 4:30 pm

Post by Xsecrets » Sun Nov 01, 2009 10:35 pm

I don't think your comparison to oscommerce is completely valid. That project is in the state it is because HPDL wouldn't listen to anyone and did it his way. Now everyone is looking for a better solution.

I don't see how removing the layout.tpl really adds any flexibility. It's not that hard to come up with some conditional statements if you want to change things on one page or another. I would gladly have to do that In order to be able to change the entire basic theme of a site in one file.

as for people who like the old way can just use 1.3.2 that's fine for right this second, but what about in the future when there are security fixes rolled in?

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by creek.jonathan » Sun Nov 01, 2009 11:13 pm

Thanks Daniel for the new release, the effort gone behind it is very much appreciated.
It would be great if someone who is experienced provide some basic guidelines regarding how templates can be designed / ported for opencart 1.3.3.

I am new to opencart, it would be of great help in understanding the design aspects well.

Thanks in advance.


Posts

Joined
Sun Nov 01, 2009 10:55 pm

Post by Qphoria » Sun Nov 01, 2009 11:58 pm

Granted comparisons to osC/Zen is not really saying much. But it still offers nothing. The system opencart had wasn't broke.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Mon Nov 02, 2009 12:45 am

creek.jonathan wrote: I am new to opencart, it would be of great help in understanding the design aspects well.
well all the hoopla is because in the last version if you say wanted to change your entire site from a three column to a two column layout all you had to do was to remove the right column in one file the main layout.tpl, with the new system you have to change it in every top level .tpl file ie. product category manufacture etc.

Qphoria wrote:Granted comparisons to osC/Zen is not really saying much. But it still offers nothing. The system opencart had wasn't broke.
I'm right there with you on this one.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Mon Nov 02, 2009 5:29 am

Xsecrets wrote: well all the hoopla is because in the last version if you say wanted to change your entire site from a three column to a two column layout all you had to do was to remove the right column in one file the main layout.tpl, with the new system you have to change it in every top level .tpl file ie. product category manufacture etc.
That sums it up perfectly.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Mon Nov 02, 2009 8:40 am

So every one wants the layout put back?

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Qphoria » Mon Nov 02, 2009 9:12 am

Well if we just knew some purpose to it. So far it seems like additional reuse of code to "build up" a page instead of drilling down. But I don't know of anyone complaining that their page drilling was a problem. I can kinda see the design that you are making the header, footer, and sideboxes as "children" to the controller. But then it should be done with an admin manager page so that its fully dynamic and not "hardcoded".

Like:
Controller -- Header -- Footer -- Left -- Right
Home -- X X X X
Product -- X X X -
Category -- X X - X
Information--- X X - -

But even still, It's more at the item level, not the controller level. What if I want Information item 1 to have left column and information item 2 to have no columns? That then defeats the design. At least with the old method, a simple conditional could be added to the main layout to easily disable/enable a column.. globally or just for certain products, information pages, etc.

The cons outweigh the pros ten-fold at this point. Of all the things people complained and added bugs about, not one was about the layout file.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Jan R » Mon Nov 02, 2009 10:49 am

Jan Here...

I like the ideal of flexible layouts.
Here is a thought... ???
what if you had multiple 'layout' files
something like..
layout_01 = default
layout_02 = no left pain
layout_03 = no right pain
layout_04 = no side pains
etc...

Then either in the admin area or on the top of each top level .tpl you could set a 'layout variable' that told OCart what layout you wanted.. the possibilities would be endless.

New layouts could be created by anyone and interchanged as needed.

Thats my 2 cents.. Thanks Daniel for the hard work... :-*
-=:@:=-

»-(¯`·.·´¯)->"The most wasted day in that in which we have not laughed."<-(¯`·.·´¯)-«


User avatar
New member

Posts

Joined
Fri Oct 16, 2009 2:20 am

Post by Xsecrets » Mon Nov 02, 2009 11:16 am

I say just put it back the way it was. All this adding stuff to the admin to supposedly make it easy only adds more complexity, and adding a few conditionals to the layout.tpl is not really that hard if you want certain pages to include/not include things.

Another unrelated question. I haven't looked at the code yet, but I was wondering on the guest checkout which is all on one page do you have logic to account for dynamic/zone shipping and payment modules?

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Daniel » Mon Nov 02, 2009 11:30 am

ok sure. I will release an offical 1.3.3 with the layout back and a few fixes and extras people have addnign in this thread.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: Semrush [Bot] and 39 guests