Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

modules system should be improved


netcat

Recommended Posts

I am sure that all the people who write contributions would gladly let you write that for them!

Should be done by the "core" team. It would be total redesign. That is something they did not think of in advance. No blames. Noone can think of everything in advance.

 

Supposed "todo"

* Implement registry

* Implement "hooks"

Link to comment
Share on other sites

It just doesn't make sense that one should manually edit

several files in order to install a module. There should be

one file like registry (mozilla's plugins registry is good example).

You dont need to edit several files to install a module, you just need to copy the files to the correct location.

 

The only time modification is needed is when you want to change something.

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

It just doesn't make sense that one should manually edit

several files in order to install a module. There should be

one file like registry (mozilla's plugins registry is good example).

You dont need to edit several files to install a module, you just need to copy the files to the correct location.

 

The only time modification is needed is when you want to change something.

That's exactly the point, who has a plain jane install of OSC? Rairly anyone, maybe someone who has just done a fresh install.

 

No wonder so many people are having so many problems in so many areas, somebody writes a mod to do one thing and all of their files get over written because they didn't stop and think that they have this mod and that mod already installed and when you over write some of your files with a new mod, the ones you installed don't work any longer because that info is no longer there, it's been over written.

 

I agree that there should be a specific way to write these mods so they don't interfere with what is already installed on a persons system and yes a person does have to go thru each and every file supplied to find the info that is needed in a particular file and then most of the time that info/code isn't even marked as an add on in the files supplied. This stinks the way it is now. If someone writes a mod at least don't be so lazy that you can't write documentaion and explain what goes where.

 

I don't care how good a mod is if it doesn't have reasonable documentation and I need to copy their files over, I just won't use that mod.

 

JMO

Best Regards

Link to comment
Share on other sites

I am sure that all the people who write contributions would gladly let you write that for them!

Contributions are greatly appreciated by me or anyone who can use them, is it possible that you haven't taken a look at some of these mods lately or you would understand what was said by netcat.

Best Regards

Link to comment
Share on other sites

You dont need to edit several files to install a module, you just need to copy the files to the correct location.

 

The only time modification is needed is when you want to change something.

That's exactly the point, who has a plain jane install of OSC? Rairly anyone, maybe someone who has just done a fresh install.
No, you are missing his point. He is responding to the comparison to the mozilla plugins directory. If all you are doing is adding a new page or module (like a plugin), you just need to *add* the files (not overwrite, as this is new functionality that was not there previously). It doesn't matter if you have a plain install or not. However, if you are *modifying* the functionality, then you need to modify the files (if you start with a plain install, you can modify the files by copying over them).

 

In osCommerce, the equivalents of the mozilla plugins directory are the three subdirectories of includes/modules and includes/boxes. Adding a new box does require modifying a file (either column_left.php or column_right.php), but the modules use the existing registry: the configuration table. This is where all configuration values are stored. You click install in admin, and they magically install. New hooks can be entered as contributions, which can be integrated during MS4.

 

For example, someone has already made a contribution where the language file defines are put in the database (may not be up to date). Someone could (and perhaps already did) make a box manager that outputs the appropriate box in the appropriate place in the column. This is not a fundamental redesign, it is just using the existing structure. All that would need to be done would be to add some code to the admin area and replace the stock column_ files with ones that access the box manager.

 

The existing Product Attributes - Option Type Feature contribution does this as well (and is thus on my list of contributions that should be integrated in MS4). It modifies all the admin and catalog files that deal with attribute display (admin/categories.php, product_info.php, shopping_cart.php, checkout_confirmation.php, checkout_process.php, includes/classes/shopping_cart.php, and includes/classes/order.php). Once Chandra finishes moving the configuration and setup to the database, adding a new Option Type Feature (as the File Upload contribution does) can be as simple as running a .sql file and modifying the product_info.php file (and in fact, even that could be handled in most situations by moving the option types into the modules format). However, you would still have to manually change the code in includes/application_top.php to handle the actual upload (for the File Upload contribution) as this is a change in behavior, not an added behavior.

 

Cheers,

Matt

Link to comment
Share on other sites

If someone writes a mod at least don't be so lazy that you can't write documentaion and explain what goes where.

 

I don't care how good a mod is if it doesn't have reasonable documentation and I need to copy their files over, I just won't use that mod.

 

JMO

It could just as easily be said "Don't be so lazy as to not look through the *marked files* to see where the new code needs to go".

 

If you have an already modified installation, a text file explaining exactly which lines/code must be modified is not the best solution - I have spent a great deal of time providing support on these forums - people usually run into trouble copy and pasting from *installation diff files* to their installation - the usual problem being confusion as to where exactly the new code must be placed - as line numbers, and in many cases the compared changes, are different.

 

Using file compare between the marked contribution file and your existing modified file is the best option IMO. In some cases you will need to find a unique solution due to existing changes.

 

To imply that contributors are lazy does not sit well at all....

 

 

Matti

Link to comment
Share on other sites

Hi guys. It looks like most of you overlook the most important thing.

Have you noticed that mozilla's sources are not changed for added/changed

functionality by plugins ?

 

Another good example for configaribility is "sawfish" window manager.a

It have hooks for all events that can possibly happen so any plugin

just adds himself to the list of procedures called on some event.

 

I want to live in a "perfect" world when no changes in source code are required.

 

As for "upload" functionalty mentioned here. ((... application_top must be modified ...))

It's not if there is a hook "application-top".

Link to comment
Share on other sites

Ah you mean modules (contributions) not modules (shipping / payment) which I thought you were referring to :)

 

Yes in an ideal world you will be able to click a button and extra functionality will be added automagically.

 

This however requires a major change to the core osCommerce code and will need planning sometime after 2.2 final is released.

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

If someone writes a mod at least don't be so lazy that you can't write documentaion and explain what goes where.

 

I don't care how good a mod is if it doesn't have reasonable documentation and I need to copy their files over, I just won't use that mod.

 

JMO

It could just as easily be said "Don't be so lazy as to not look through the *marked files* to see where the new code needs to go".

 

If you have an already modified installation, a text file explaining exactly which lines/code must be modified is not the best solution - I have spent a great deal of time providing support on these forums - people usually run into trouble copy and pasting from *installation diff files* to their installation - the usual problem being confusion as to where exactly the new code must be placed - as line numbers, and in many cases the compared changes, are different.

 

Using file compare between the marked contribution file and your existing modified file is the best option IMO. In some cases you will need to find a unique solution due to existing changes.

 

To imply that contributors are lazy does not sit well at all....

 

 

Matti

Matti,

 

Well, I don't mean to ruffle yours or anyone elses feathers, but as I explained, these mods are appreciated by you or anyone else that writes them, the way I see it is when say you for instance write a mod, it looks like your writting them for yourself and sharing the mod in it raw form in the files that need to be re-edited by us, in most cased, we don't even need the files supplied with a mod, just the documentation of the code and where to put it, as I said prevously, rarely is there a plain jane OSC that the files can just be copied over overwriting our files unless these files are renamed as to not interfere with what we already have on our system, it just seems to me that you and/or others don't care if we destroy our working, heavily modded OSC by over writing our files with yours or anyone elses or looking thru countless files for additions or changes that were made so your mod will work on our systems.

 

I'm sorry, but there needs to be a guideline as how these mods need to be writen, as that mod you came out with a while back I have never got to work because I'm either to stupid and can't read or maybe the coding could have just been in an install.txt file explaining where to put the code in what file, it looked like a good mod too, to bad I can't use it.

Best Regards

Link to comment
Share on other sites

It could just as easily be said "Don't be so lazy as to not look through the *marked files* to see where the new code needs to go".

 

I might also add that as of today the hardest mod out there for me to install and get working right was the phpbb2 interface with osc and even as hard as it was to go thru the install.txt because of a language barrier that wasn't real clear, I got it installed and running right, but at least there was documentation and I have to give who ever wrote it credit for at least giving us that much, without that, that mod would have been useless.

Best Regards

Link to comment
Share on other sites

Hi guys. It looks like most of you overlook the most important thing.

Have you noticed that mozilla's sources are not changed for added/changed functionality by plugins ?

No, I didn't miss it. The problem with the Mozilla comparison is that Mozilla is an interpreter. As such adding hooks is a matter of changing the *HTML* source. The plugin system just maps hooks to plugins in the interpreter. To do the equivalent in a shopping cart, you would have to write your own shopping cart language. Then the person using the shopping cart language would be the one responsible for creating the hooks and you would just have to register them in the interpreter. Of course, then you are right back to modifying code to make changes (in a whole new language that you would have to learn!).

 

That said, the osCommerce existing source is not modified to add modules (shipping, payment, order_totals). They are simply registered (called Installed in osCommerce--same concept). This is relatively easy to do in situations where it can be anticipated that multiple methods (that do not interact with each other) might be used, like osCommerce modules or infoBoxes. The hard part is anticipating *all* the places that someone might like to make a change. Some, yes. All, no. osCommerce could increase this, but I don't know that it is really practical to expect it in general.

 

Consider the following case: I want to install two contributions. One updates the price as attributes are modified. The other lists the MSRP and the store price. Assume that there is a hook for store price. Now I can make it install either of those contributions simply. However, I can't install both without modifying code, as the two contributions use the same hook with the same trigger.

 

Let's go back to Mozilla again, to try to illustrate this more clearly. Consider two plugins for the same media: Real Player and Quicktime. Both run as Mozilla plugins, and they overlap in the files that they will play. What happens when you install them both? The last one that you install is the one that runs (note: you can actually customize this during the install process; however, the important point is that both can't run at once). Why? Because Mozilla assumes that you only want to do one thing with a piece of media. This is generally a reasonable assumption in Mozilla's case, as one generally does only want to do one thing in response to a given object (although you may want to do different single things). It is not reasonable in osCommerce, as it is common to want to do multiple things.

 

Let's go back to the upload contribution again. You argue that if there was a hook in application_top.php for new code, that I wouldn't have to modify the file. I disagree. To get this to work, I modify the actions of *existing* code, something that Mozilla style plugins can't do (unless the original code was in a plugin; in which case you can replace it, losing all the behavior of the original plugin). I could *not* do what I need to do simply by adding code (actually, one of the changes I make is to move some existing code that can only run once earlier in the file). To change the code into a form that I could, osCommerce would have to essentially anticipate the changes that I wanted to make prior to my making them and add code to disable just that part of the code so that I could replace it (note: I would also have to provide all the functionality of the plugin that I am replacing, something that I do not have to do if I modify the code direct). Now what happens if someone else wants to modify the same section(s) of code? They disable my code; once again we're back to modifying code to integrate contributions.

 

osCommerce could be more modular. If it was, it would somewhat improve store owners ability to make changes (existing workboard entries are moving in this direction: template structure, login and session classes, etc.). However, don't expect that *all* contributions would be able to use this, as the system can never anticipate *all* possible changes (short of going to a shopping cart language). Also, you have to realize that in osCommerce, some of the contributions will always interfere with each other (requiring code to be rewritten).

 

Cheers,

Matt

Link to comment
Share on other sites

I might also add that as of today the hardest mod out there for me to install and get working right was the phpbb2 interface with osc and even as hard as it was to go thru the install.txt because of a language barrier that wasn't real clear, I got it installed and running right, but at least there was documentation and I have to give who ever wrote it credit for at least giving us that much, without that, that mod would have been useless.
I'm lazier than Matti, so I don't mind implicitly being called lazy :). However, I would like to point out that I am more willing to modify and/or read code than you are. As such, contributions that are not useful to you would be useful to me. In other words, if you got your way, some contributions that would help me would no longer exist (not meeting the standards you set forth).

 

I wouldn't mind a labelling system that designated the install difficulty: drop-in (like a basic shipping, payment, or order_total module); drop-in code plus SQL (new pages can do this; I would include contributions that require changing links in infoBoxes in this level); modify code in files (plus SQL) with detailed instructions; example code (primarily for developers). At least this would save time for those who are looking at contributions to install. It sounds like the phpbb2 mod is the third one and at the edge of what you want to do (i.e. if it's not something that you really need, you would skip most of these). I would find the fourth (example code) useful (note: I would still prefer the third, second, or first in those cases where they are possible).

 

It's worth noting that the open source movement was started by someone who was looking for the fourth level (Richard Stallman). He stopped using proprietary versions of unix precisely because it did not allow him to share his fixes with other sysadmins nor them with him. The fourth level is where open source makes sense for developers (who share the code among themselves). The first three levels are more along the lines of charity. In general, if you find yourself relying on the charity of strangers, you are probably doing something wrong IMO.

 

Btw, post MS3 releases of forum integrations will probably be much easier to install than now. The new class interface should allow the interface to be just a drop in on the osCommerce side (possibly on the forum side as well but that would depend on the modularity of the forum software).

 

Cheers,

Matt

Link to comment
Share on other sites

I'm lazier than Matti, so I don't mind implicitly being called lazy :).  However, I would like to point out that I am more willing to modify and/or read code than you are.  As such, contributions that are not useful to you would be useful to me.  In other words, if you got your way, some contributions that would help me would no longer exist (not meeting the standards you set forth).

 

The only problem is I do find some of these undocumented mods very usefull not just for you but for me and others too, all I'm saying is don't be so lazy and just do the docs or install.txt file and forget supplying the coded files, if they are not needed, they are usually to confusing and vague to say the least and to subject for errors on our part, I don't want or need these files and it's a waste of space in the Contributions area and on my drive, others and myself feel this way about undocumented mods, that's all, what's so hard about this to understand, if you don't want to do the install.txt file of course that's up to you and all mod writers, but you sure do make it very dificult for me and others to use these mods if we choose to, I choose not to.

 

Keep up the good work, maybe you and other mod writers will see our side one of these days, maybe not. If your trying to improve the quality of OSC with the usefulness of these mods, then make them quality mods, not some that I or others have to say oh $hit look at this and discard it.

 

Have a Happy Holiday Season

Best Regards

Link to comment
Share on other sites

OSC is like a childs toy.. it's so esy to install modules and debug, anyone that complains is just ungrateful. If you can't stand the heat get out of the kitchen baby!

If it is that easy for you, maybe you could offer your services to write the install.txt files for us that aren't so talanted with debuging php code, but still learning. This would be nice.

Best Regards

Link to comment
Share on other sites

An install.txt file is far more subject to error than properly marked files from a working installation - and as both Matt and I have pointed out, it is impossible to anticipate changes - from my part, what changes you have made to your installation already - what good is it me telling you to do 'such and such' on line 'such and such' when you have something totally different from a standard file on that line anyway? :blink:

 

Using a tool like Beyond Compare, you can have both the contribution file and your existing file side by side - the click of a button to move the new code over to your file. This is far simpler and less subject to error that copy and pasting from an install.txt file - you can see both the new code *and* other changes you have made to your file B) Have you ever tried this..??

 

The files included in a contribution show you *exactly* where the code must go - from a text file things can become very uncertain... I can't tell you how many times I have helped somebody with a parse error because they missed a } when copy and pasting from an install.txt or pasted below the wrong instance of the same snippet of code....

 

Another point - I have yet to use an editor which shows syntax highlighting on a .txt file - perhaps some do, but I have not seen one - from this I assume that most don't - do I need to go into a discourse on the benefits of syntax highlighting when determining the placement of code?

 

I think this is at least the second time I have said all this :unsure:

 

Matti

Link to comment
Share on other sites

I think this is at least the second time I have said all this

 

About 7 posts back I explained all this, but in case you missed it, if I copy your moded files over to my working OSC system, your mod now works, but in over writing my files any other mods that was already incorporated now don't work, because the code need by another mod is no longer there because it was over written by your mod, there are way to many mods that are setup like yours that just copy the necessary files and go, one keeps over writing the other causing errors because the mixture of mods now really installed by bits and pieces depending on which file was over written are all set for different mods.

 

The only way to keep a modded system is to install an already fully modded OSC with all the bells and whistles that can be turned on or off at a switch in admin...

 

Your right, the install.txt is subject to errors, but so is over writting my files with yours, I really don't know what errors you might have nor how to correct them if they did exist or what file the error may be in and wait for a fix from you if an error exists, but the same goes for the install.txt, but at least there I only have one file to deal with and I can test my system with the changes and if errors accure all I have to do is hit the CTRL-Z and I'm back to where I started in my editor, I haven't over written anything. I do keep backups so I don't worry much about errors, but OSC is getting bigger each time I need to unzip it.

Best Regards

Link to comment
Share on other sites

if I copy your moded files over to my working OSC system, your mod now works, but in over writing my files any other mods that was already incorporated now don't work
Yes. Don't do that. Instead, use a utility like Beyond Compare or ExamDiff (or the unix diff). Note: you need to compare both your modded files and the contribution modded files (separately) to the original unmodded files, which it is recommended that you keep for this purpose. This will give a much clearer picture of what changes need to be made than an install.txt file possibly could. The way that I would make an install.txt file would be to copy and paste from one of these utilities--cutting down the information available (try to install an MS1 contribution to MS2 from an install.txt file; much easier with full files).

 

It is my understanding that the full commercial versions of these programs can actually try to make the changes for you. I have not tried to use that feature with osCommerce (I have used the unix patch command successfully).

 

Hth,

Matt

Link to comment
Share on other sites

It is my understanding that the full commercial versions of these programs can actually try to make the changes for you. I have not tried to use that feature with osCommerce (I have used the unix patch command successfully).

I use Beyond Compare - the files are displayed side by side with differences highlighted and a single scroll bar B)

 

Click a single line or shift for multiple and then a button to copy/overwrite to the other file - saves hours and errors.

 

Matti

Link to comment
Share on other sites

In reply to iiinetworks' message.

 

have to write your own shopping cart language

 

Very likely - yes. That should be not that difficult becuase we are building on top

of another language. I mean no new implementation of some sort of interpreter.

Just adding new set of functions. I don't think we _must_ have some new

language constructs (that we do not have in php) for the new language.

 

As I see it: "core" of the language is implementing the registry,html(and text for emails) templates and the hooks. Everything beyond that should use this new language.

 

As to the multiple handlers for one hook problem. There are implementations that allow that.

 hook -> list of handlers

. We have to think about some cool algorithm to

figure out the correct order (of calling the handlers). I think the following _idea_ is a good start point.

rcorder (man page, section 8)

 

The hard part is anticipating *all* the places that someone might like to make a change. Some, yes. All, no

Agreed. Proposal: developers should ask the core team (another contributors?) to add hooks as they run into this problem.

Link to comment
Share on other sites

if I copy your moded files over to my working OSC system, your mod now works, but in over writing my files any other mods that was already incorporated now don't work
Yes. Don't do that. Instead, use a utility like Beyond Compare or ExamDiff (or the unix diff). Note: you need to compare both your modded files and the contribution modded files (separately) to the original unmodded files, which it is recommended that you keep for this purpose. This will give a much clearer picture of what changes need to be made than an install.txt file possibly could. The way that I would make an install.txt file would be to copy and paste from one of these utilities--cutting down the information available (try to install an MS1 contribution to MS2 from an install.txt file; much easier with full files).

 

 

Hth,

Matt

I rest my case, in most cases most want-a-bee programmers or modders like myself have nothing but the notepad, I do use a better editor then that and now have looked at Beyond Compare, I'll see how that works, but for me an editor like UltraEdit has worked for many mod installations and has worked quite well with just the install.txt file and nothing else.

Best Regards

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...