Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Contributions, STS, and non-STS customizing


Recommended Posts

I'm certainly not a newbie to the web - I have several years experience and I know how to handle HTML, PHP, uploads, downloads, edits, etc. But, I AM new to OSC, so please forgive me if my questions are pretty basic at first. Fortunately, though, I usually catch on fast and it shouldn't be necessary to explain things to me more than once! ;)


To start with, I'm trying to use the STS templating method to design my store. I'm finding that it lives up to its name, at least for the most part. However, my OSC installation is only a very small portion of my site. I use a lot of include files on my other pages in order to get a consistent header, layout, etc. I have a line in my .htaccess file that sets .html files to be parsed for SSI; however, when I try to use an include in the sts_template.html file, it comes through as a plain HTML comment. I realize that the sts_template.html file is being "grabbed" by PHP somehow and interpreted dynamically, but I had expected it to parse the file first for whatever content it was supposed to include. All of this long-winded description of my problem boils down to, how can I use my site-wide include files within my STS templates? (See last paragraph below before answering this one - it may be unnecessary.)


Another problem I have is with all the contributions that are available. It's great that people have contributed that much work, but I'm having a really hard time finding out which contributions I need. At the moment, I'd like to use one of the SEO-Friendly contributions, and something that will allow me more control over the <title> of the page. However, there appear to be compatibility issues between some contributions, and being so new to OSC, I'm a little over my head trying to figure out what each contribution does, if it's likely to conflict with others, and exactly which contributions I need in the first place. Advice, references, and suggestions will all be welcome on this score.


Finally, I just read a discussion that pretty strongly indicated to me that a templating system like STS may not be the best way to go at all. I don't mind at all "getting my hands dirty" with the code of OSC, but I was wondering, if I do decide to customize my store that way instead of with STS, how much of a job is it? I mean, I'll have to change layouts, images, and all kinds of things to make OSC match my site. The customizing I need to do goes beyond what can be done in the header and footer files. Looking at the OSC root directory, there are something like 40 PHP files. A quick check seems to show that they all use hardcoded HTML, including those nasty spacer gif's and nested tables. The code, while obviously good and effective, is about the messiest tag soup I've ever seen, with invalid HTML all over the place and constantly entering and exiting PHP. It seems like going through all this would be a huge job - but perhaps I'm wrong and there's not as much to be changed as meets the eye?


So anyway, I like what I see in OSC so far, but I'm feeling a little lost at the moment. I'm well-known in some circles for being a heavy customizer, and that's what concerns me the most with OSC. Any thoughts on the points outlined above will be most appreciated.


Thanks a lot,



Link to comment
Share on other sites

Anything that can be done in STS can be done manually. Personally, I would never use it because it just adds another layer of obfuscation and makes it a lot harder to debug when things go wrong.


SSI are only meant for small bits of presentation - why not drop them altogether and replace with dynamic php (or PHP include files)


Contributions are used at your own risk. The coding standards vary from acceptable (very few) to horrendous. Too many fingers in the pie make a lot of them badly-hacked together and unreliable. No compatability is guaranteed. Some may suggest "work-arounds" that make them compatible with the more popular ones.


Yes, the layout uses tables and nasty spacer gifs - I think the next release is moving more towards a true template system for abstracting presentation and functionality. Depends if you can wait for this or not...


If you want to convert your site to do this, then yes, it is a pretty big job, but certainly not impossible.


Sorry for the abbreviated reply - but your post was a little long - I'd be happy to expand on any particular areas of concern you have, as I'm sure would others.

Link to comment
Share on other sites

I have never used a template system so I can not help with that portion of your questions but I can tell you that if you know html and php then editing oscommerce is not hard to do at all.


What I do is create an html page so I know how I want my site to look, then grab the beginning and end (stuff i want to show up in the header and footer) and change those files.


So what is left is the middle content. Then I grab one of the php pages, like shipping.php which does not have a lot of php on it and strip it of any code I do not need, change the html so I have the layout I want then save it as a template page. (guess this is my own little template system lol)


Quick edit by opening the main files in the catalog directory and grabbing everything above the header and pasting it into my template page, then there is a main table in he center of the page, just grab that and copy and paste it into the template page. (some pages have a form field before and after the table that you have to be sure to grab). Look for any javascript code that is right above the body tag and put that in the template page, the copy and paste it all into the original file.


Sounds like a lot of work but once you do it a few times you can fly through it. Only suggestion I have is you add any contributions to your site before making all of the html changes because the instructions sometimes reference html code that will be missing once you change the layout.


Other than that there is the product_listing.php, language files and other little tweeks to get it exactly how you want it but those are pretty easy if you know html and php. Which is stuff you would have to do to tweek the look anyhow...


I know it sounds like a template system would be easier but in the long run I think it is easier. I have seen many issues come up with trying to get contributions to work with the template systems.

Wendy James


Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

Thanks for the tips guys. I think I'm going to bite the bullet and do the customizing without any template systems. I guess it will take longer, but I just have a feeling (based on my own experience and your suggestions) that it will be much better in the long run. And who knows - maybe it won't be such a long job after all.


I've seen a lot of talk about a guy named "Chemo" around here lately, whom I gather is well-liked by the community for his contributions. You say that many contributions are badly hacked together; does the same go for Chemo's or do his contributions have a pretty solid reputation? It seems like he's pretty well respected, but I'd appreciate explicit opinions on this before I do anything. I'm particulary interested in one of his SEO contributions, but I don't want to install it until I'm sure it's the right thing.


I may be expecting too much, but I'd like to get this store right the first time around. I think my tech skills are up to it, but I'm concerned that my inexperience with the concept of the contributions may be my downfall . . .


Thanks again for the ideas,



Link to comment
Share on other sites

Thanks for the tips guys.  I think I'm going to bite the bullet and do the customizing without any template systems.  I guess it will take longer, but I just have a feeling (based on my own experience and your suggestions) that it will be much better in the long run.  And who knows - maybe it won't be such a long job after all.




STS is pretty transparent and for this purpose you should put your include into the osC file you want to as opposed to the template file just as you would for a store not running STS.


If you decide at some point to add some more boxes or want to add sepcific formatting you'll have to define that for STS but other than that it should make your life easier, not harder.


There are, of course, conflicting opinions on this. The only way to know for sure is to try out both methods and see which one makes sense for you.



Everything's funny but nothing's a joke...

Link to comment
Share on other sites

1: you can always use STS or BTS to have a switchable tempalte system in OSC, but be aware that it adds to the query count and at times makes it more difficult to add contributions.



2: To change the design of osc without the template systems, is very easy and basically you can change most of the looks from these 5 files:


1. header.php

2. footer.php

3. left_column.php

4. right_column.php

5. stylesheet.css


Some editing of the 30 something main files might also be required if you want to do substantial changes.


A small tip, if you want individual css controll of your infoboxes use this contribution......


To get it w3c validated is not really that difficult to do, and there are actually 3 differnt contributions available to help you in the contribs section. (2 xhtml and one html)


You can also find more tips on design here....

Link to comment
Share on other sites

Chemo's contributions are the better ones - he knows what he is doing and the SEO contribution code is solid.

He's currently on a forced "leave of absence" right now, so don't expect any support for his contribs in the immediate future...

Link to comment
Share on other sites


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

  • Create New...