Post by Qphoria » Wed Sep 10, 2008 11:03 pm

This kind of spins off from the Override system idea. The Steps are not reliant on eachother to work. Just ideas that would bring it all together.

Step 1:
There currently isn't an easy way to include new modules within a page without manually editing the page. This can cause conflicts with other contribs that have also modified the page. But assuming things became more modular, you could have a single main wrapper named "product.php" that would call all files within the "product" folder. It would then be dynamic as the code would recursively loop through all the files in the directory that matches the file basename. Then adding new features to a page would be easy.

product.php
-loads:
/product/name.php
/product/description.php
/product/price.php
/product/quantity.php
/product/weight.php
/product/options.php

each file would be a element

Finalize it with css to design the layout and you're done.

Now if you want to change the way the options display, it won't affect any other contribs on that page affecting things like description or quantity.

Step 2:
For languages & css, we need a way to include "extras" without modifying the base. CSS is already cascading and overriding of its previous settings, so creating a contrib that changes part of the display without changing the core css file is so simple that its silly to not do it. If default.css has .box {color=#FFF;} and your new custom.css has .box {color=#CCC;} that will auto override it without changes.

Languages needs an "extra" file that will load not only the language file that matches the controller name (which is currently hardcoded in the file, but really if you stick to the naming convention, just match the name of the controller and make it dynamic.). So "controller/product.php" will load "/language/english/controller/product.php" and all other files with the word product in that folder (product_contrib1.php, product_contrib2.php, etc.)

Just some ideas that kinda spin from the override and kohana discussions, but do it a little differently as the ideas spew out of my head.

There still needs to be a way to override functions or at least variables within another file, but then conflicts are created over 2 contribs trying to modify the same variable.. but really that would mean that they are 2 conflicting contribs anyway.

[/mind dump]

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hm2k » Wed Sep 10, 2008 11:34 pm

Personally I think you're getting a bit ahead of yourself with this...

In my mind there's quite a few other issues that need to be tackled first.

Adding a new level of complexity such as this will only make it more difficult to update in the future.

Although your suggestions are good, it's not going to be feasible to impliment right now.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Qphoria » Wed Sep 10, 2008 11:44 pm

;D I agree.. I'm using this more as a place to dump my thoughts for future ideas. I just think of this stuff while I'm working on contribs and think "this would a lot easier if..." so then I come here to talk about it. Maybe for OpenCart 2.0 we can come back to some of these :P

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hm2k » Thu Sep 11, 2008 1:29 am

It's no problem, in fact it's something I've found myself doing in the past.

However, right now for 0.7.x I'm concentrating on developing a stable platform.

I'm not 100% sure what Daniels plans are for 0.8, I expect things will start to unfold as that version gets released.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK
Who is online

Users browsing this forum: No registered users and 3 guests