Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Proposal: the future of OSC


clickbuild

Recommended Posts

Happy New Year to all....

 

A a fairly new user to OSCommerce I am struck by the following thoughts...

 

Oscommerce is very good

Oscommerce sucks!

 

 

How is this possible!?? How can OSC suck and be good at the same time?

 

Simple. The end result is good, getting there sucks!

 

As a programmer with over 20 years of pain and suffering under my belt, I would put this code base in my top ten of ugliest code. Don't get me wrong here, I am not blaming or accusing anyone. I have some legacy code that is almost as ugly and I know how it gets that way.

 

Because of the ugly code, interface or functionality changes that *should* be simple require touching several files and sometimes an hour or more just reading thru the code to find the line(s) that need to be tweaked (comment the code -- pleeeeease).

 

So instead of just bashing the developers I am suggesting some solutions. You may or may not like them but I am hoping this will get people thinking about how to introduce some improvements that make it easier for developers to work with OSC.

 

Keep this thought in mind "It's not the speed of code, it's the speed of coding" (e-gineer.com)

 

 

--- Suggestion:

Give up on your templates. I am recommeding Smarty. http://smarty.php.net

 

# Reasons:

There are a bunch of templating solutions for OSC but so far, none of them is a "real" templating solution ie. true separation of code and presentation. I am suggesting Smarty even though it has a slighty higher learning curve because the features are really outstanding. [note: x-cart is already using Smarty]

 

First: Smarty already contains a plugin structure. Write a plugin, drop it in the plugins folder, use it. If it is not used, it is not included. How much easier would life be if plugins didn't require code changes in the main code? The "open file X, change line Y" method is guaranteed to be destroyed by the next revision / plugin / fix / mod (and no, I really don't want to diff all the files every time I make a change).

 

Second: Smarty does compilation and cacheing. Not just cacheing but CACHEING - the real deal right down to which included file for how long. Let's face it, OSC is fairly resource intensive on the ol' DB and File front. With Smarty it would be possible to cache each page item separately for different times, even cache the box but keep the content dynamic. Yes, I know OSC has some cacheing but I am talking about the future here where everything could be cached with individual times and limits.

 

Third: Smarty separates code from presentation. It took me a while to wrap my head around Smarty but combined with the my following suggestions the presentation aspect of OSC could become the easiest, most fun part of the configuration... as it should be!

 

 

--- Suggestion:

Give up on the database interface. I personally like EzSQL by Justin Vincent.

http://justinvincent.com/

 

# Reasons:

There are database wrappers that are better than the native OSC wrapper, cover more databases and they are free. I am recommending EzSQL for several reasons:

 

First, it is atomic, like a web page... make your request, get your data, done. I wasn't sure about this approach to begin with, but for anything but really large results (in the thousands) it is a great way to deal with databases.

 

Second, it already wraps a number of databases [mySQL, Oracle8, InterBase/FireBird, PostgreSQL, SQLite (PHP), SQLite (C++) or MS-SQL database(s] so interchange is a snap if needed and the increased db suppport should increase OSC useage.

 

Third, result sets are returned as arrays which can be plugged straight into Smarty...

 

 

 

--- Suggestion:

Give up on HTML . Hmmm, this is a big one but design is heading toward more CSS so why not jump ahead and go all CSS? See http://www.csszengarden.com for a fabulous demonstration.

 

# Reason: CSS allows the designer to do things that are just not possible in HTML and combined with the suggestions above, a "page" could be just a few lines of CSS that renders a completely morphable front end.

 

 

So there you go, my 2c for the new year - please no flames or whining about how great OSC is - I have already covered that. OSC is great... I can see it being so much more than it currently is - just look at the examples page - pretty well everyone uses the standard OSC layout with a few changed colors and that's it. The only people who have made serious layout changes are developers and development companies who must have slogged thru the code base rewriting as they go.

 

I put my stick in the water and swirl it around to see what comes to the surface...

 

Your thoughts?

 

Steve

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Been there, discussed that.

 

It'll never, ever, ever happen. Nor should it.

 

I agree that the presentation should be completly seperated from the functionality, but I don't believe that it should incorporate a 3rd party template engine into that solution. It should be pretty straightforward to create an in house segregation.

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

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

I think everyone has had those thoughts since they started using OSC. My opinion is this.... IT'S FREE.... what more can you ask for?

 

Introducing a third party for templates is the wrong way to go... OSC should remain one product, standalone. Creating more dependencies will turn it into a beaurocratic (spelling check please) nightmare! [bureaucratic - B) ]

 

Nice thoughts though...

Dan

Link to comment
Share on other sites

clickbuild,

 

I couldn't agree with you more.

I am not familiar with the products you suggested - so I cannot comment on that part.

 

BUT the current system, where every contribution can edit the core pages is a nightmare. I found that some of the contributions use already edited pages as the base for their modules. It is therefore not enough to diff the changes, you actually have to understand WHY and WHAT the contributor is doing to feel safe enough to add the contribution. Not to mention the effort needed to remove an early contribution after you have already added a new ones.

 

I like the OSC. But reading comments from the main contributers here I get the impression that they think that anyone who is not willing to go through this effort is plain lazy. And "ITS FREE SO BE THANKFUL AND SHUT UP" seems to be another theme.

 

The problem you raised is well known in the software field and there are many viable solutions. This is especially true for Open Source projects. Software stability and manageable maintenance is not considered a luxury anymore.

 

I am personally waiting until the powers of OSC adopt a solution to the contribution problem - I don't really cares which one.

Link to comment
Share on other sites

I agree that the presentation should be completly seperated from the functionality, but I don't believe that it should incorporate a 3rd party template engine into that solution. It should be pretty straightforward to create an in house segregation.

I agree that 3rd party integration isnt the way to go.

 

Things such as DB independance arent too difficult to achieve and do not need to use 3rd party add-ons. We will be addressing this ourselves soon.

 

The same goes for a templating system :)

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

I'd disagree on moving to CSS. Why? Well, I've never seen CSS designed pages display correctly on my computer. For instance, the afformentioned csszengarden.com. If that is a "fabulous" demonstration, no thanks. Nothing was placed correctly, and I received several .php errors (though not affected by CSS, annoying nonetheless).

 

However, just about everything else that clickbuild said I agree with. There has to be a for real templating system. I am not a programmer, nor do I intend to become one - I am a project manager. My graphic designer has no clue what is going on. This is not "the way it's supposed to be."

 

That said, I'd be back at square one without osCommerce and the amazing developer community.

Six jars of Mayonnaise: $12.50

20 feet of rubber tubing: $4.25

Latex-rubber gloves: $3.25/doz.

The look on the cashiers face: Priceless.

 

There are some things money can't buy, for everything else, there's your parent's money.

Link to comment
Share on other sites

SuperJosh,

 

Sorry you didn't enjoy CSS Zen Garden.

 

I would venture to guess that if none of these sites display correctly, then your browser could use an upgrade. The Mozilla project would be the best place to start.

 

Back on topic:

The templating system is a must. If you don't want to wait, try the Basic Template System (BTS)

 

Abstracting the database is also a good idea and wouldn't be hard to do.

 

All these suggestions are excellent and I'm sure the osC team will consider them (if they haven't already).

 

My main question/concern is, why does the osC project move so slowly? I understand that it's a huge project, but months pass between Milestone releases. Is there any way the community could help speed up the development progress?

 

Just wondering.

Link to comment
Share on other sites

I'm using Safari on OS X. The same kind of errors happen in IE and Mozilla.

Six jars of Mayonnaise: $12.50

20 feet of rubber tubing: $4.25

Latex-rubber gloves: $3.25/doz.

The look on the cashiers face: Priceless.

 

There are some things money can't buy, for everything else, there's your parent's money.

Link to comment
Share on other sites

I take that back. It's a Safari specific problem. Time to submit a bug report. Still, my aversion to CSS stands.

Six jars of Mayonnaise: $12.50

20 feet of rubber tubing: $4.25

Latex-rubber gloves: $3.25/doz.

The look on the cashiers face: Priceless.

 

There are some things money can't buy, for everything else, there's your parent's money.

Link to comment
Share on other sites

TheIdeaman said

Is there any way the community could help speed up the development progress?

 

Why doesn't the community set up a central fund for an OSC Forum to be held this summer. I'm sure OSC users would welcome the opportunity to contribute to a central point to help the project move faster.

 

Just look at how Easypopulate and Recover Carts has moved ahead when the complimentart skills come together. How quickly could it fo when we are all in the same location....

 

Any takers?

Citizen of US Minor Outlying Islands

Link to comment
Share on other sites

The problem with that is that osC users are ALL over the world. It would be VERY VERY difficult to get all of the members together in one central location given the diversity of people involved and/or interested in this project.

Chris Sullivan

Link to comment
Share on other sites

Hmmm... things float to the surface...

 

To address a couple of items:

 

CSS: it's a thought not a requirement -- it's where we are going to end up so let's look at it, that's all.

 

Learning Curve: With Smarty you have to separate your thinking into programmer and designer - as the designer there is "presentation code" for you to learn -- pretty easy stuff but very useful and powerful.

 

Third Party Integration: I would have agreed with the naysayers a while ago but the reality is you can get more done if you swallow your "I must roll my own" pride and use other peoples work. I'm using OSC after all and I didn't write it. Same applies to PHP itself, where would we be if the PHP developers hadn't added CURL, Mcrypt, Mhash and hundreds of other libraries?

 

For those of you that are not programmers, let's put it another way - using third party stuff is just good business. Ford doesn't make the plastic knobs and buttons in it's cars, it makes cars. A good portion of what goes into those cars is from third parties because they can make the parts cheaper and better -- and Ford doesn't have the time or resources to take care of it themselves.

 

[ Here is an interesting thought. You can go to the Ford website and customize your car but you can't do that OSC (yet) without being a "mechanic"... ]

 

With all that said please remember I am just stirring up conversation. I think OSC is currently the best of the cart/store software in the PHP arena and I say that after testing several other apps. However, configurability and customization are seriously lacking in some areas and without those being addressed, OSC may not be at the top of the pile for long.

Link to comment
Share on other sites

My main question/concern is, why does the osC project move so slowly? I understand that it's a huge project, but months pass between Milestone releases. Is there any way the community could help speed up the development progress?

Alot of it has to do with time. I for one have a full time job and dedicate most of the spare time my girlfriend will let me on osCommerce (A bunch of flowers allows me 3 hours of coding time ;))

 

There are a number of things people can do to help.

 

1. Donate money so we can say no to side projects and concentrate on osC

2. Donate code which meets our standards so we can integrate it easily.

3. Help with the documenation effort.

4. Help the moderators answer questions on the forums

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

Why doesn't the community set up a central fund for an OSC Forum to be held this summer.  I'm sure OSC users would welcome the opportunity to contribute to a central point to help the project move faster.

If people are interested there is fosdem www.fosdem.org in Brussels in feburary. Maybe something could be arranged for the european users :)

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

Steve,

 

I totally agree with all you have said - and I totally believe the project will never take it on board. It is just too conservative to make any radical moves like that, which is a shame.

 

After customising an OSC site last year, I came to all the same conclusions. I just don't understand why the OSC team does not concentrate on just the commerce side of the project and leave the other 80% to other projects that have already done the other stuff so well.

 

I don't think the team realises how much of their effort is duplicating what others have done before them, and how much time they would save by swallowing some pride and taking on third-party modules to handle templates, database abstraction, sessions, user management, content management, e-mail management etc etc - that stuff really has nothing to do with "commerce", yet it takes up 80% of the project's resources, IMO.

 

Also - by taking on these third-party modules (and choosing the best-of-bread, naturally) there are new skills to be learnt. But what is not considered is that these new skills are *portable*. I can honestly say that nothing I have had to learn or customise in an OSC site has been something I can usefully carry on to other projects.

 

Anyway - I've said all this before, and it will fall on deaf ears again, I'm sure.

 

I'm not trying to put the project or its developers down - just warning you not to be stuck with a lemon that no-one wants to touch because some little upstart of a commerce project has come along by bolting together a handful of well-known modules that people feel instantly confortable with.

 

Please look around - there is much to learn elsewhere. No project can sit as an island any more.

 

-- Jason

Link to comment
Share on other sites

I somewhat understand what judgej is saying, an example might well be email, but then the thought occurred that in doing so osC would have start fixing other peoples bugs? just a thought.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

I somewhat understand what judgej is saying, an example might well be email, but then the thought occurred that in doing so osC would have start fixing other peoples bugs? just a thought.

"...start fixing other peoples bugs..."

 

You know - "other people" don't just provide bugs. There are some projects out there, some code modules and tools that are much superior to OSC's offering. For example, OSC has a limited banners system. I stripped that out and used the far more versatile PHPadsNew product. I would never expect OSC to even begin to get close to what PHPadsNew does - because PHPadsNew is a whole project in its own right and does not water itself down by trying to be other things. It is best of breed. If you find bugs in it, then the author will fix the bugs for you, or incorporate the fixes you provide. Get with the community spirit and you will see how the wider community can work for you.

 

If the belief is that OSC is based on code that is superior to everyone elses, then there is nothing more to be said, and nothing more to be done.

Link to comment
Share on other sites

This will be my last post on this subject but thought I would share my thoughts...

 

Whilst modifying OSCs output for a site I am working on I wasted several hours trying to figure out a display bug in the boxes -- I am usually pretty good at finding bugs but this one evaded me -- perhaps it is because the boxes are built using a combination of arrays and classes with intertwined HTML in different files... In my frustration I decided to see how long it would take me to "roll my own" using the method I outlined - EzSQL & Smarty.

 

Well I'm hooked. After taking a half hour to structure a file/template layout I was able to duplicate the functionality of most of the OSC boxes in about an hour -- the presentation and code are totally separate and the largest line count is about 10 (not including the HTML)

 

For example: the "Manufacturers Box" - Display all manufacturers. Total lines of code: 2. Total lines required to display the data: 3 - after that it's just the HTML or CSS that you want to present the data with.

 

// Example

// manufacturers: display all in list format

 

#PHP code:

 

$q="SELECT manufacturers_id, manufacturers_name FROM manufacturers ORDER BY NAME";

$smarty->assign('BOX_OUTPUT', $db->get_results($q));

$smarty->assign('BOX_COLLECTIONS', $smarty->fetch('components/collections.tpl') );

 

#TPL code:

 

{foreach from=$BOX_OUTPUT item=rowobj}

<li><a href="/catalog/collection/{$rowobj->manufacturers_id}">

{$rowobj->manufacturers_name}</a>

{/foreach}

 

That's it. Wanna change the way the data is chosen? Change the SQL. Wanna change the display? Change the html/css in the TPL file (there are some very cool ways to transform lists into menus in CSS). Wanna put it in a drop down list like OSC - easy - Smarty has a plugin that makes drop down lists! Wanna display the finished box? Just put {$BOX_COLLECTIONS} anywhere in the index.html page and bingo.

 

Some benefits:

- To change the presentation is trivial.

- EzSQL takes care of the db and arrays for Smarty

- Special funtionality can be supported thru Smarty Plugins (they're easy to make)

- The whole thing is way fast and can be cached as required

 

I figure I can roll my own and duplicate the front end of OSC in about a day - maybe I'll put it together this weekend and add some of the backend stuff too.

 

As always - just pointing out that there are other choices...my choice is to stop whining and build my own store using Open Source tools.

 

Steve

Link to comment
Share on other sites

Steve,

 

You speak as someone with a mission. We should talk.

 

Josh

Six jars of Mayonnaise: $12.50

20 feet of rubber tubing: $4.25

Latex-rubber gloves: $3.25/doz.

The look on the cashiers face: Priceless.

 

There are some things money can't buy, for everything else, there's your parent's money.

Link to comment
Share on other sites

I somewhat understand what judgej is saying, an example might well be email, but then the thought occurred that in doing so osC would have start fixing other peoples bugs? just a thought.

"...start fixing other peoples bugs..."

 

You know - "other people" don't just provide bugs. There are some projects out there, some code modules and tools that are much superior to OSC's offering. For example, OSC has a limited banners system. I stripped that out and used the far more versatile PHPadsNew product. I would never expect OSC to even begin to get close to what PHPadsNew does - because PHPadsNew is a whole project in its own right and does not water itself down by trying to be other things. It is best of breed. If you find bugs in it, then the author will fix the bugs for you, or incorporate the fixes you provide. Get with the community spirit and you will see how the wider community can work for you.

 

If the belief is that OSC is based on code that is superior to everyone elses, then there is nothing more to be said, and nothing more to be done.

There are a number of issues here... I dont believe osC's code is better than everyone else's its more of a case of simplicity.

 

Smarty is designed to be as flexible as possible to help people achieve changes quickly... how often do people change the look of thier stores???

 

I personally think a simple template system is more beneficial than a full template system due to a less frequent number of changes.

 

Lets rely less on external code and make things simple for ourselves as this is easy to achieve.

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

Whilst modifying OSCs output for a site I am working on I wasted several hours trying to figure out a display bug in the boxes -
Was it http://www.oscommerce.com/community/bugs,1242 (i.e. was it missing all or part of an HTML tag or tags)? If you got the same error in Smarty (it's a PHP bug and Smarty is written in PHP), you would have even more trouble figuring it out. In that case, the problem could be in your code, the Smarty code, PHP, etc. I doubt that I would have ever figured it out if I hadn't read the bug report (while getting ready to post one of my own).

 

If osCommerce is going to integrate a template engine, I think that it should use Smarty, as the Smarty site is part of the PHP site in the same way that PHP is part of the Apache site (i.e. it is an approved project).

 

Creating a template structure will make it easier to test out projects like this. For example, if the BTS were adopted as the template structure, one could make a template where all the template pages were written with Smarty hooks.

 

Hth,

Matt

Link to comment
Share on other sites

I think people should have a choice and not get forced to use the smarty template, what should be possible is for osC to have all the varaibles, contstants in particular prefixed with OSC that way if someone wanted to use smarty all they would need to is loop through the environment (whatever i dont recall) vars and then be able to identify the osC stuff and filter that into smarty.

 

Also I think PEAR::HTML_TEMPLATE_IT is a versatile template pkg (without caching).

 

A basic osC template would suffice, one that does not require learning another scripting language but rather for example similiar to BTS or even just as osC does for there installation interface.

 

BTW, an idea came to me about some of the stuff metioned in this thread, is that if you have found something else that is better or strongly feel that it should be used here then 'put it in to the contributions section' where it will probably get more serious consideration especially if other people actually start to use it.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Steve

Well I'm hooked. After taking a half hour to structure a file/template layout I was able to duplicate the functionality of most of the OSC boxes in about an hour...etc

 

Nice one. I'm sure this will still go right over many people's heads - they still don't see the point of using tried and trusted software, even when the evidence is staring them in the face. I'm being harsh though - I don't mean to be confrontational. The developer's can code this project however they like, and Open Source evolution will take care of its survival.

 

The myth that I have seen in these boards purveyed over and over is that simple code is better. That simple code returns fewer errors, and is easier to handle and debug, that complex third-party code should not be introduced to the project because it is, well, complex.

 

By that token, we should all be riding around on bikes and never driving cars (autos). After all - look how complex cars are! How on earth can be drive them when they are made of so many parts, any of which can go wrong. We can't understand the purpose of every bold and screw in that car, so we had better not use one at all. Can you imagine having to rely on someone else to manufacture, say, a light bulb for you if you find the headlights don't shine bright enough. Can't be doing with that. No - we should only ride bicycles, because if they go wrong we can fix them ourselves. Hell, lets build our own bicycles from scratch. An engine sounds a bit complicated, so we will pretend we don't need one of those. Who wants to go that fast anyway? People may only occasionally want to travel fast, so there is no point putting in an engine (that someone else would have to build) just for those few people...

 

You get the point. Or you may not. But that's my last post on the subject too.

 

-- JJ

 

PS. What am I talking about above? Simple: black boxes. Don't get bogged down with how a third-party module or template engine works - it will just get you worried and all stressed up for nothing: you don't need to fix its bugs - that is what the third-party project is all about. Why not look at what it can do for you instead. Draw a box around it - look at what goes in and what comes out. I promise you such an approach will pay dividends. And much quicker than you expect.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...