Jump to content



Photo
* * * * * 5 votes

Oscommerce Road Map for the newbies


This topic has been archived. This means that you cannot reply to this topic.
117 replies to this topic

#1   lindsayanng

lindsayanng
  • Members
  • 4,258 posts

Posted 02 July 2008 - 19:13

As a newbie to oscommerce AND php, i feel the need to contribute in some way. The ONE thing that I feel I can help with is OTHER newbies. I know EXACTLY what their confusion feels like, and the FIRST thing that you NEED to understand is the file structure of oscommerce, and it is one of the MOST confusing aspects to newbies like myself.

So here goes your road map to the oscommerce file structure.

When you install oscommerce to your server, you have almost TWO separate websites. You have your customer end, which is the part that everyone sees which is USUALLY called the Catalog, and you have the administration end, which is where you end up when you type www.mysite.com/catalog/admin. That is were the majority of your site configuration and administrations happen aside from actual coding.

Each section, both the catalog and the admin have individual files that make up the main part of that page. You have a header, footer, index, left colum, ect. in BOTH of these sections. The thing is, even though they have the same file name, they are ENTIRELY different. If they were the same, you would have a copy of your main website and no administration right? Believe it or not, this was one of the MOST confusing things to me. WHY were there TWO headers? Well, you need a heeader for the shopping cart that will show your shop banner and whatever else you choose to have, but you ALSO need a header in the admin section that shows the oscommerce banner and the header navigation. Those are two totally different things, but they are located in the same place of the page, therefor are called the header. Same with the other duplicate pages.

So WHY are there header, footer, right column, left column pages? Why aren't they just included in the index page like a typical HTML site? Well, there's not really a simple answer to this, and I couldnt tell you EVERYTHING about how it is set up, HOWEVER I can offer this explaination. You index page is the first page that your customer sees when they type in the url to your site. This index page has the code in it that calls for the HEADER.PHP, LEFT_COLUMN.PHP, RIGHT_COLUMN.PHP, and FOOTER.PHP. These when put together, make up the LOOK of the index page of your site and are under the INCLUDES folder. I like to remember which file they are in because they are INCLUDED in the index to make up the main page and they NEED to be INCLUDED in every page of your site. The header, footer, right and left column are ALWAYS shown on your site no matter which section of the site your are on.. much like a template.

The other files in the INCLUDES section of your catelog are the application_top.php, application_bottom.php, configure.php, filenames.php. The application top and bottom have the code in them that calls on certain functions of the top and bottom of your page. The application top is the page that has the code that checks for the SSL and other securities (if in place) and calls on the correct database file, set cookie use, check IP address, ec. It basically does most of the "behind the scenes" functions that your website performs every time someone visits. Same with the application_bottom.php file.

Then you have the FUNCTIONS folder. This folder contains files that, when called upon from your includes pages, will perform certain functions. For instance, the general.php function page will call on certain tables from your database, like the PRODUCT NAME. So instead of writing all of this code for a particular function on one page, you just refer it to the general functions page so it does not get cluttered. It will perform functios to check if stock is available for a certain item, calculate tax and more. This is another "behind the scene's type of file that will access certain data if it is called upon. This data can be called upon by the load of a page or clicking a button depending on the code that is entered.

The CLASSES folder contains files the control the look and functionality of certain parts of the site. So if you create a breadcrumb (which is the little navigation bar the shows you where you've been ie: home->main category->subcategory->product) then when you are writing that code in the header.php file, you can call on the breadcrumb CLASS to define how it is going to work. It tells the website to log and display the sections of the site the visitor has been to. The order.php, when called on will check that the fields were filled out correctly for the order being placed and copy them to the database for further use.

The MODULES folder contains the shipping, order total, payment, and other modules that come pre-installed on your oscommerce. This will grow as you add more modules to your site. many of code in these can be changed in your admin section. The Shipping Module will be installed through your admin, and the changes you make within the admin section on your website will show in the code. I have not done a lot of work with these so I can not explain too indepth about them.

The BOXES folder is probably the MOST used folder by myself when I was trying to make my site functional and good looking. The boxes folder contains an individual .php page for each information box on your page. And information box is either the boxes on the left and right column of your page, or any other box you find within your page. The code inside of these files tells the website how to display the information on the page, and what to display. You will see an HTML table with the <tr> and <tad> tags. It will contain the header information of the box (whether you want an image or text) and will call on a class from the style sheet for the LOOK of the box (ie: outline, size, ect.)

There is a LOT of information about customizing your boxes here: The Knowledge Base



Then you have the LANGUAGES FOLDER, which can be INSANELY confusing because.. wait, you now have ANOTHER index.php page?? Its not as confusing as you think though. Before you get to the other index.php file, you will see you have three language folders, and three language FILES. Since I speak english, I'm going to explain what that one does. The others to the same thing but in a different language. If you open the english.php file, you will see a LIST of DEFINES.
You will see something like this:
define('BOX_HEADING_CATEGORIES', 'Categories');
That is a VERY easy thing to explain. All it says is where you see the words BOX_HEADING_CATEGORIES, the website should display the word Categories. Simple. So the code says that it is DEFINING the words in caps to say whatever it says in that sections of code. It seems redundant if you are only making a website in one language, but it is NESSECARY if you are making a website that uses multiple languages because depending on which language the visitor has chosen, it will call on a different define for the word.

So now inside of the ENGLISH FOLDER you have a bunch of pages that are named the same as the ones in your main catalog, HOWEVER these pages do not carry the functionality or look. They just tell the site to display certain words in that particular language, much like the english.php file. This just organizes it more so you dont have a TON of defines in your english.php. If you open them, they will look A LOT like the english.php file. So see, the second index file is not all that complicated. It just says that if you are on the index page, in the english language, to display certain words in ENGLISH.

You also have an ENGLISH images folder where you will put all of your buttons because obviously, Add To Cart is not the same in all languages. You NEED to have these because if you are in the german language, you don't want the CONTINUE button to show, you want the german counterpart to show instead. This is NOT the image folder where any other website images should be stored unless you only want them to show up if they are in a certain language.

So thats it for the layout of the site.

now i didnt REALLY explain the ADMIN section. Theres a reason for this. It is exactly the same but different. WHAT?? Well, the file structure is the same, but instead of creating the look and functionality of your website, it creates the look and functionality of the admin part of your site. These files will not change the look of your website AT ALL, but it will change your administration. SO if you add a contribution that creates a new section in your admin, you will NEED to access those files, otherwise you will not.



So i hope this helped someone. ANYONE who reads this, please feel free to correct me or clarify if some things sound confusing to you to dont make any sense. I am in NO WAY a php expert, i'm not even advanced.. I'm HARDLY a beginner.. I learned all of this by just jumping in and reading books and some common sense. It took a while and when i first got here, i was SOO confused and SOOO scared to touch anything. The BEST thing i could have done, though, was installing my own contributions. I was scared to do it at first, but if you start with some simple install ones, you will learn the feel of oscommerce better than if you had someone like me telling you.

So get in there, do some searching and messing around. buy some oscommerce books (there are two i LOVE, one by Monika Mathis and the other by David Mercer) that have helped me a TON. Just remember to BACK UP YOUR FILES EVERY TIME YOU MAKE A CHANGE!
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#2   lindsayanng

lindsayanng
  • Members
  • 4,258 posts

Posted 02 July 2008 - 23:25

14 views and no suggestions or input?
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#3   JoshR35

JoshR35
  • Members
  • 30 posts

Posted 03 July 2008 - 04:21

Excellent post !!

I am in the process of learning how to create oscommerce custom themes and this post helps out alot !

For some reason, when people ask how to create a custom theme from scratch, they only get advice on how to modify a current theme or how to work with BTS or STS.

Creating a theme from scratch is alot different than modifying a current theme.

All in all..thanks again for the great post, it really helps alot !!

Josh R.

#4   Didgemandu

Didgemandu
  • Members
  • 18 posts

Posted 03 July 2008 - 16:51

Yep, good post and some good points! Gives a bit of meaning to those random directories inside catalog/ !!

I might just go and look up those Oscommerce books you mentioned!

Cheers!

#5   D-Tech

D-Tech
  • Members
  • 73 posts

Posted 03 July 2008 - 17:24

Excellent for beginners as a complete description. It is sometimes easy to forget once you have learned Osc that other people are baffled at first.

Well done.

I'll add just a little visual addition that sometimes explains the setup of the page.

[img]http://www.d-techperformance.co.uk/images/indexpage.gif[/img]

Edited by D-Tech, 03 July 2008 - 17:25.


#6   lindsayanng

lindsayanng
  • Members
  • 4,258 posts

Posted 03 July 2008 - 18:05

it hought about doing a visual, but i havent had the time. I HOPE this all helps someone. it took a few minutes to write, but i know i sure could have used it when i was learning.

JUST to learn that the catalog and admin section were DIFFERNT THINGS opened my mind!

Anyways, you image isnt showing, i am really interested in seeing it.
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#7   Earl Kurburski

Earl Kurburski
  • Members
  • 36 posts

Posted 03 July 2008 - 23:52

A very long read but well worth it. You show good understanding of how the program and php work. I learned much from the post and must thank you for taking the time to do it.

Unfortuntly, many of the old timers in web building forget how difficult it is to learn some of this stuff. I remember the pulling out of hair trying to figure out why I couldn't save to the disk or read the disk on my first c64 until someone told me the disk had to be formatted! Then it took several days to learn how to format it!!! Things have really improved a lot with the almost instant replys we receive to our questions of the large forums today

#8   spooks

spooks
  • Members
  • 7,017 posts

Posted 04 July 2008 - 10:27

Nice post, great piece for the beginner, I just hope they read it.

Well done.

/smile.gif' class='bbc_emoticon' alt=':)' />
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#9   Bushmaster

Bushmaster
  • Members
  • 456 posts

Posted 04 July 2008 - 23:42

14 views and no suggestions or input?


Just because they viewed it does not mean they read it. With in 2 clicks you can be to the quick install guide but how many posts are made with how do I install OSC. Its on every forum I ever been on. I don't want to look for it tell me within 30 seconds of my post or I will bump it till I get a reply.


Sorry for the rant. /blink.gif' class='bbc_emoticon' alt=':blink:' /> guess its time to go enjoy the holiday


Nice job by the way.

Edited by Bushmaster, 04 July 2008 - 23:45.


#10   goll

goll
  • Members
  • 10 posts

Posted 08 July 2008 - 11:03

thanks for the road map, helped me understand the two different directories, from another newbie

#11   lindsayanng

lindsayanng
  • Members
  • 4,258 posts

Posted 11 July 2008 - 00:14

heres a few more links in case anyone new is trying to figure out how to customize their oscommerce site. I know they have been posted before, but it should help if they come across this and now want to learn HOW to change them.

CATALOG STYLE SHEET DEFINITIONS
SOME MORE STUFF ON HOW TO CHANGE THE LOOK
BASICS FOR DESIGN THREAD theres a lot of info here. Just use the search field at the bottom of the thread when its open to search for specifics, or just browse
Newbie Road Map to oscommerce file structure

I also plan on explaining the style sheet for those who really are new to this whole thing..

I hope this helps people
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#12   ironguardian88

ironguardian88
  • Members
  • 12 posts

Posted 13 July 2008 - 19:43

Great thread. Thanks Lindsay.

#13   gearheadgary

gearheadgary
  • Members
  • 17 posts

Posted 15 July 2008 - 22:24

Nice post, great piece for the beginner, I just hope they read it.


I just hope they Find it.

I wish I'd seen this a few months ago, it would have really helped out on some of my development time.

I have 20 years In IT, have programmed in multiple languages, but little webdev and no PHP experience.

I basically had to poke at the beast to see what made it tick.

It would be great if this thread was easily found by new OSCommerce users.

Edited by gearheadgary, 15 July 2008 - 22:29.

Gary

#14   mochster

mochster
  • Members
  • 10 posts

Posted 16 July 2008 - 02:37

Hi Lindsay,

I'm new to the OSCommerce family and started playing with the cart this evening. I printed and read through your essay and have a question to ask. I downloaded v2.2 RC2a from my ISP to test it out. I have spent a few hours changing somethings around and like what I see so far. How do I get rid of the "What's New Here" and set up lingo in the index page? I'm interested in putting my own message in that area and have not been able to track it down thus far.

Thanks for taking the time to write a good boot up for new users!

Best regards,

Mochster

#15   lindsayanng

lindsayanng
  • Members
  • 4,258 posts

Posted 16 July 2008 - 03:05

MOST of the text on the page is actually a define that is defined the the english.php or it's sub files.. So if you looked at the code for the index.php, you see some text that looks like TABLE_HEADING_NEW (or something like that) I'm sorry i dont have any REAL examples, because i dont have a basic set up anymore. I got rid of the "what's new here" entirely and now i cant remember EXACTLY where it was..

but anyways i can help you find it.
I digress..

So basically the index page which has the text WHATS NEW HERE, does not actually have those words in the code. They have something that looks like code (TABLE_HEADING_NEW - or the like) which calls on the language files.. this way you dont have to have a million pages for different languages.

So the short answer is, look in catalog/includes/languages/english.php

english.php contains a LOT of defines for your site, and has the most defines. If you dont see it in there, then you can open the catalog/includes/languages/ files... But i REALLY think that it is in the english.php files.

Sorry i dont have a more definitive answer. If you post the code for the index.php i will tell you
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!

#16   perfectj

perfectj
  • Members
  • 39 posts

Posted 18 July 2008 - 04:48

As a newbie to oscommerce AND php, i feel the need to contribute in some way. The ONE thing that I feel I can help with is OTHER newbies. I know EXACTLY what their confusion feels like, and the FIRST thing that you NEED to understand is the file structure of oscommerce, and it is one of the MOST confusing aspects to newbies like myself.



oh....my.....god!

thanks!

my brain was starting to hurt trying to figure out why the bloody files get repeated everywhere!

#17   Design Recollections

Design Recollections
  • Members
  • 163 posts

Posted 21 July 2008 - 07:35

Having been quietly trying to get my head around OSC for some months now it has not gone unnoticed by me your learning/questioning/discussions around this forum. I have already had some of my questions answered through your involvement here Lyndsey. I have been grateful to you on more than one occasion already. This is a great post, most informative, thank you /biggrin.gif' class='bbc_emoticon' alt=':D' />

Heather
Heather...

[img]http://img.photobucket.com/albums/v22/ElleFan/smilies/icon_baby_crawl-1.gif[/img]Crawling my way through pages of code with my fingers crossed and one eye on here. Grateful to many at the osCommerce Community. Thank YOU

Coding successes: GV & Coupons, UltraPics, FCK Editor, Product Listings Enhancement, Short Descriptions, Define Main Page, Text Box, Attribute Sets Plus, . PayPal WPP. UL Catagories. Dynamenu. Featured Products. Mailist Report 1.2. Easy Meta Tags (Now even I could have screwed that up) Sold Out but Displayed 0.3. Club osc Specials on Front Page. Order Editor. HTML Emails V2
Working on: SEO



Proud member of the Code Breakers Club

#18   jeff.roberts42

jeff.roberts42
  • Members
  • 2 posts

Posted 21 July 2008 - 15:24

Appreciate this help. I'm new to OScommerce and have already used a lot of what you've written to tweak some things on the site.

Thanks!

#19   fengshui37

fengshui37
  • Members
  • 18 posts

Posted 24 July 2008 - 01:53

This image was especially helpful in being able to form my own question. HOW are the "heading title" and "text main" in the headers changed and WHERE? I found the title for the main page in the english.php file but none of the other text except the "Welcome Guest" line. (See number 1 in the image I am supplying). In number 2 of the image I am supplying, seems to be a canned phrase for category description: "Lets See What We Have Here". Also could not find that anywhere in any file. (Would love to be able to change that to a category description).... I've downloaded the entire catalog with all subdirectories onto my hard drive and initiated search for text (the phrases I want to change and smaller snippets of them) in file or folder with no results. Pretty weird to me...I even searched the sql data base in case they stored text in there for display. I'm stumped on where they are hiding some of these things which should be simple or available for change in the admin section. Any help would be appreciated on this.

[img]http://www.toroscope.com/files/Image3.jpg[/img]

- Feng


Excellent for beginners as a complete description. It is sometimes easy to forget once you have learned Osc that other people are baffled at first.

Well done.

I'll add just a little visual addition that sometimes explains the setup of the page.

[img]http://www.d-techperformance.co.uk/images/indexpage.gif[/img]



#20   lindsayanng

lindsayanng
  • Members
  • 4,258 posts

Posted 24 July 2008 - 15:05

you will find the text for MOST text contained in your website in the catalog/includes/languages/english.php (if it is not there look at catalog/includes/languages/english/index.php

Did you really READ through the road map?? Because all of the info i gave you was in there
A great place for newbies to start
Road Map to oscommerce File Structure
DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

Proud Memeber of the CODE BREAKERS CLUB!!