Web Development Tips and Tricks

Web Development Tips and Tricks

Os Commerce Question & Answer

Catalog Section-
Question1-After installation how can we change store name?
Question2-And how can we develop on local host and after developed implement on server?
Question3-Strating error and solution-
Step1- change istall folder name.
Step2-C:\wamp\www\online\online\catalog\includes\configure.php ,property change as read only file.
Step3-
if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
$this->language = $this->catalog_languages[$key];

ereg is deprecated in PHP 5.3 but I don't have PHP 5.3 so I don't know if that will work.
Question4-top menu item increase and decrease?
Answer-
C:\wamp\www\online\online\catalog\includes\languages\english.php
define('HEADER_TITLE_NEW', 'NEW');
near line 59.
And
C:\wamp\www\online\online\catalog\includes\header.php
  |
Add in line 64

Question4-Add New page?
Answer-
First go to your /catalog/ root directory and open shipping.php(anypage) and do Save As,
then rename the page, I'll name mine new_page.php also. Be sure you save it to your
catalog root dir. Now you have a clone of your shipping.php(chosen page) file.

Now to go to /catalog/includes/languages/your_language/ and find shipping.php
and Save As this file also, this name should be the same as the previous page,
I'll name mine new_page.php also. Make sure you save it to your
/language/your_language dir. Now you have a language file for your new page.

You have created two new pages and now for some editing.

Open /catalog/includes/application_top.php and enter this code.

Edit this to match the name of your new_page.

define('FILENAME_NEW_PAGE', 'new_page.php');

I put mine right at the top of the other defines.

Now open /catalog/new_page.php and find this piece of code:
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIPPING);

And change it to match your new new_page. Mine will be:
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_PAGE);


And on the next line you need to change this line:
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHIPPING, '', 'NONSSL'));

And change this to match your new_page name:
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_NEW_PAGE, '', 'NONSSL'));


Now go to /catalog/includes/languges/your_language/shipping.php And edit it to your taste.

And that is it. Now you can test your work. Open your browser and type in
http://www.yourdomain.com/new_page.php and you should see your new page. Now all you need

Question 5- three Images at top of top menu?
Answer-
C:\wamp\www\online\online\catalog\includes\header.php
Header table start from line 57 and end on 60,we can change anything like header logo or three images from here.
If we want not remove only change these three logo then-

If we want use foure or two images then-

If we want use flash then-

Question6- Change Top Logo of os commerce?
Answer-
C:\wamp\www\online\online\catalog\images\store_logo.png we change our image which name same with this image
If we need to big or small logo or use jpg or other extension logo then-
Question7-Logo and other things at bottom?
Answer-
For Bottom other things-
C:\wamp\www\online\online\catalog\includes\languages\english.php change in english.php
For Bottom Logo/banner-
C:\wamp\www\online\online\catalog\images\banners\oscommerce.gif
We can use admin panel for user banner or not.

If we need to big or small logo/banner or use jpg or other extension logo/banner then-

Question 8-Time of own country?

Question9-How to change the look and feel colours etc.
Answer-
Oscommerce uses a stylesheet to keep the look and feel consistent throughout the website. You can change the colours; font sizes etc, use an html colour chart to get the colour code you want. Just type in html true colour chart into Google and you will find lots of free ones. The style sheet is located here,

Catalog/stylesheet.css

When you change the box colours on your website you will notice that the corners of the boxes have not changed, this is because strangely they are images. They can be found not in the style sheet but in

Catalog/images/infobox there are four that need changing to the colour you chose in the stylesheet. We use a common package like Paint to do this. Just change the pixels using the editor in paint.
Question10-How to change the home page text?
Answer-

Catalog/includes/languages/English/index.php … you will see where the text is to be changed. Save and upload to overwrite the old file.

Also here you change the title “what’s new here” in two place approx line 22 and line 40. This title is controlled from the stylesheet, so if you want to make it bigger or a different colour then that’s the place.

Question11-How to upload your banner?
Answer-

As most images in OSC are called from code elsewhere it’s best to simply upload your image with the same code. Theexisting header image is oscommerce.gif so all you need to do is design you banner and then save it as oscommerce.gif and upload it to replace the default one. The size of the banner should be exactly 780 X 110 pixles.

You upload it here,

Catalog/images

Question12-How to turn off the OSC banner at the bottom?

Answer-
This is something that you can do from the admin section and not directly on the server. Go to your admin section (blue screen) select

tools/banners

You will see a red and green dot next to it, click the red dot to turn it off, DO NOT delete the banner totally as it is part of a banner group that needs to stay.

That’s about it, this should give you a basic look a feel, there is more to do but this is the main part done. If you have any problems post them and I will try to help. Also check out the osc forums. Remember before altering any pages always back up to your local drive.



Question13-How to change the top left menu items “top and “catalog”to Home and Shop?
Answer-

Two files need altering here,

1) catalog/includes/application_top.php

in line 466 HEADER_TITLE “change TOP to HOME”

in line 467 HEADER_TITLE “change CATALOG to SHOP”

2) catalog/includes/languages/English.php

in line 55 HEADER_TITLE “change both TOP words to Home”

in line 56 HEADER_TITLE “change both CATALOG words to SHOP”


Question15- Increase and decrease left and right menu item(informationbox)?
Answer-
includes/boxes/information.php
add
'' . BOX_INFORMATION_WHO . '
' .
At 23line
Then you need to add define('FILENAME_PRIVACY', 'privacy.php'); to includes/filenames.php
and then follow what you see your langauage/english.php file under // information box text in includes/boxes/information.php around line 122 of an vanilla OSC.

Question16-if I do not define page in filename.php then what will happen?
Question17-Where we define all page?
Question18-Main pages of os commerce?
Question19-Change color or style of all menu top images?
Question20-Image small and big (high sliding).
Question21-Menu Totally Changed?
Admin Section-
C:\wamp\www\online\online\catalog\admin\images\oscommerce.png
C:\wamp\www\online\online\catalog\admin\includes\languages\english\login.php
We can change hyperlink from
C:\wamp\www\online\online\catalog\admin\includes\header.php
Want some change in header menu
C:\wamp\www\online\online\catalog\admin\includes\languages\english.php
Question-how can we remove
osCommerce Online Merchant Copyright © 2008 osCommerce
osCommerce provides no warranty and is redistributable under the GNU General Public License



Powered by osCommerce


From catalog/admin/login.php
Answer-
C:\wamp\www\online\online\catalog\admin\includes\fotter.php line33 to 41

Note-We can use HTML code when we upload new product for design.