test

20
Oscommerce Document Aktis Web Solutions Pvt Ltd

Upload: sarav-anan

Post on 15-Mar-2016

212 views

Category:

Documents


0 download

DESCRIPTION

ttttttttt333333333333333

TRANSCRIPT

Oscommerce Document

Aktis Web Solutions Pvt Ltd

Contents

1 What is oscommerce?........................................................................................................32 How to install oscommerce?..............................................................................................3

3 How to create the oscommerce template?.......................................................................6

2 | P a g e

What is oscommerce?

osCommerce (“open source Commerce”) is an e-commerce and online store-management software program. It can be used on any web server that has PHP and MySQL installed. It is available as free software under the GNU General Public License.

osCommerce is an online shop e-commerce solution that offers a wide range of out-of-the-box features that allows online stores to be setup fairly quickly with ease, and is available for free as an Open Source based solution released under the GNU General Public License.

osCommerce was started in March 2000 and has since matured to a solution that is currently powering 12,464 registered live shops around the world.

Today, osCommerce has been taken to the next level, moving towards an e-commerce framework solution that not only remains easy to setup and maintain, but also making it easier for store administrators to present their stores to their customers with their own unique requirements.

How to install the osCommerce?

To install OsCommerce on your hosting account manually, you should first of all download the OsCommerce files archive on your hard drive. You can download the osCommerce files here.

http://www.oscommerce.com/solutions/downloads

Version: 2.3.1

Upload the osCommerce file on your hosting account

Once you have downloaded the release you would like to use, you can upload it to your hosting account using an FTP client or the File Manager tool under your Cpanel.

As soon as the upload of the file is completed, you can unpack it using the File Manager tool. In order to do that, you should access the File Manager from your cPanel, find the osCommerce package, click on it and extract it using the [Extract File Contents] button.

OsCommerce Web Installation

3 | P a g e

To start the installation, you should go to yourdomain.com/shop (for the purposes of this tutorial, we will assume that /shop is the folder of your osCommerce installation) and click on [Continue].

Then you should fill in the Database information:

Database Server: localhostUsername: youruser_oscPassword: your passwordDatabase Name: youruser_osc

and click on [Continue] again.

4 | P a g e

The next page shows the Web Server settings. In most cases you won't have to change anything here because the installation detects them automatically.

Again, to proceed to the next step you should click on [Continue].

Then the OsCommerce installation will prompt you to enter the shop info, as well as the administrator username and password.

5 | P a g e

After you fill in the details, don't forget to click on the [Continue] button to proceed to the last page.

Finally there are two more steps that you should make to complete the installation.

1. Rename the /install folder or delete it, using the File Manager or FTP.2. Change the permissions of the files /includes/configure.php and

/admin/includes/configure.php to 444 using the File Manager.

The catalog button will show the site and the administration tool button will show the admin panel.

6 | P a g e

How to create the Oscommerce template?

We have to create one html file and one css for the oscommerce template first.

The following are the files which are related to oscommerce template

includes/template_top.phpincludes/template_bottom.phpstylesheet.cssimages/ (template image files)

template_top.php and template_bottom.php are the two important php files which determines the template of the oscommerce.

We need to separate our html file into two files. For example consider the below code as our html file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Aktis Jewellery</title>

<link rel="stylesheet" type="text/css" href="stylesheet_sample.css">

</head>

<body id="freeoscommerce_009">

<div id="wrapper1">

<div id="wrapper2">

<!-- Header -->

<div id="header_wrapper">

<div id="header">

<div id="top_menu">

<span><a href="http://localhost/oscommerce/oscommerce/catalog/index.php">Home</a></span>

<span><a href="http://localhost/oscommerce/oscommerce/catalog/specials.php">Specials</a></span>

<span><a href="http://localhost/oscommerce/oscommerce/catalog/account.php">My Account</a></span>

<span><a href="http://localhost/oscommerce/oscommerce/catalog/shopping_cart.php">Shopping Cart</a></span>

7 | P a g e

<span><a href="http://localhost/oscommerce/oscommerce/catalog/checkout_shipping.php">Checkout</a></span>

</div>

</div>

<div id="header_background1"></div>

<div id="header_background2"></div>

</div>

<!-- Content and Sidebars-->

<div id="wrapper3">

<div id="content_wrapper">

<div id="content">

<div id="navigation">

<!-- Breadcrem portion -->

</div>

<div>

<!—Top portion endhere-->

<!- Bottom portion starts here-->

</div>

</div>

</div>

<div id="left_sidebar_wrapper">

<div id="left_sidebar">

<!-- Contents In the leftside bar -->

</div>

</div>

<div id="right_sidebar_wrapper">

<div id="right_sidebar">

<!-- Contents In the rightside bar -->

</div>

</div>

</div>

<!-- Footer -->

<div id="footer">

<div id="footer_content">

8 | P a g e

<!-- Footer content -->

</div>

<div id="footer_background1"></div>

<div id="footer_background2"></div>

</div>

<!-- Layout Graphics -->

</div>

<div id="left_shadow"></div>

<div id="right_shadow"></div>

</div>

<div id="top_background"></div>

<div id="main_background"></div>

<!-- Website Name/Logo -->

<div id="website_name"><a href="http://localhost/oscommerce/oscommerce/catalog/index.php">Aktis Electronics</a></div>

</body>

</html>

Create template_top.php file

In the above codes cut the top portion till <!—Top portion end here--> put in one file and name that one as template_top.php.

And follow the following steps to complete the template_top.php file

Step 1:

Add the following code in the first line.

<?php

$oscTemplate->buildBlocks();

?>

Step 2:

Replace the <title> tags with the following codes.

<title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>

Step3:

9 | P a g e

Add the following tags in the <head> portion after the <title> tag

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />

<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6.css" />

<script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script>

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"></script>

<?php

if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {

?>

<script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script>

<script type="text/javascript">

$.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']);

</script>

<?php

}

?>

<script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>

<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />

<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

<link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />

<link rel="stylesheet" type="text/css" href="stylesheet_sample.css">

<link rel="stylesheet" type="text/css" href="stylesheet.css" />

<?php echo $oscTemplate->getBlocks('header_tags'); ?>

Step 4:

Add the following codes between the wrapper1 & wrapper2 divs.

<?php

// BOF: from header.php -- error message and info message

if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerError">

10 | P a g e

<td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>

</tr>

</table>

<?php

}

if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerInfo">

<td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>

</tr>

</table>

<?php

}

// EOF: from header.php -- error message and info message

// Get cart content count for Shopping Cart menu link

$cart_count = '';

if($cart->count_contents() > 0)

{

$cart_count = ' (' . $cart->count_contents() . ')';

}

?>

Step 5:

Replace the content in the top_menu link with the following codes.

<span><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">Home</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . $cart_count . '</a>'; ?></span>

11 | P a g e

<span><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING) . '">' . HEADER_TITLE_CHECKOUT . '</a>'; ?></span>

<?php if (tep_session_is_registered('customer_id')) { ?>

<span><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></span>

<?php } ?>

Step 6:

Add the following codes in the navigation div.

You are here:

<?php

// BOF: from header.php -- breadcrumb

echo '&nbsp;&nbsp;' . $breadcrumb->trail(' &raquo; ');

// EOF: from header.php -- breadcrumb

?>

So your template_top.php file will look like the following way.

<?php

$oscTemplate->buildBlocks();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />

<title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />

<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6.css" />

<script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script>

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"></script>

<?php

12 | P a g e

if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {

?>

<script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script>

<script type="text/javascript">

$.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']);

</script>

<?php

}

?>

<script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>

<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />

<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

<link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />

<link rel="stylesheet" type="text/css" href="stylesheet_sample.css">

<link rel="stylesheet" type="text/css" href="stylesheet.css" />

<?php echo $oscTemplate->getBlocks('header_tags'); ?>

</head>

<body id="freeoscommerce_009">

<div id="wrapper1" >

<?php

// BOF: from header.php -- error message and info message

if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerError">

<td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>

</tr>

</table>

<?php

}

13 | P a g e

if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerInfo">

<td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>

</tr>

</table>

<?php

}

// EOF: from header.php -- error message and info message

// Get cart content count for Shopping Cart menu link

$cart_count = '';

if($cart->count_contents() > 0)

{

$cart_count = ' (' . $cart->count_contents() . ')';

}

?>

<div id="wrapper2">

<!-- Header -->

<div id="header_wrapper">

<div id="header">

<div id="top_menu">

<span><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">Home</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . $cart_count . '</a>'; ?></span>

<span><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING) . '">' . HEADER_TITLE_CHECKOUT . '</a>'; ?></span>

<?php if (tep_session_is_registered('customer_id')) { ?>

14 | P a g e

<span><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></span>

<?php } ?>

</div>

</div>

<div id="header_background1"></div>

<div id="header_background2"></div>

</div>

<!-- Content and Sidebars-->

<div id="wrapper3">

<div id="content_wrapper">

<div id="content">

<div id="navigation">

You are here:

<?php

// BOF: from header.php -- breadcrumb

echo '&nbsp;&nbsp;' . $breadcrumb->trail(' &raquo; ');

// EOF: from header.php -- breadcrumb

?>

<hr class="accessibility">

</div>

<div>

Create template_bottom.php file:

Copy and paste the code from <!- Bottom portion starts here--> to end of the code in your html file to a new file and save it as template_bottom.php.

Follow the following steps.

Step 1:

Add the following code in the left_sidebar div

<?php

if ($oscTemplate->hasBlocks('boxes_column_left'))

{

//replace the quickfind button with "button_quick_find_freeoscommerce_105.gif"

15 | P a g e

$boxes_column_left_search_modified = $oscTemplate->getBlocks('boxes_column_left');

$boxes_column_left_search_modified = str_replace('button_quick_find.gif','button_quick_find_freeoscommerce_009.gif',$boxes_column_left_search_modified);

echo $boxes_column_left_search_modified;

}

?>

Step 2:

Add the following code in the right_sidebar div

<?php

if ($oscTemplate->hasBlocks('boxes_column_right'))

{

// replace the quickfind button with "button_quick_find_freeoscommerce_105.gif"

$boxes_column_right_search_modified = $oscTemplate->getBlocks('boxes_column_right');

$boxes_column_right_search_modified = str_replace('button_quick_find.gif','button_quick_find_freeoscommerce_009.gif',$boxes_column_right_search_modified);

echo $boxes_column_right_search_modified;

}

?>

Step 3:

Add the following code in the footer_content div

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

Step 4:

Add the following code above the top_background div

<?php echo $oscTemplate->getBlocks('footer_scripts'); ?>

So the template_bottom.php file will look like the following way.

</div>

16 | P a g e

</div>

</div>

<div id="left_sidebar_wrapper">

<div id="left_sidebar">

<?php

if ($oscTemplate->hasBlocks('boxes_column_left'))

{

//replace the quickfind button with "button_quick_find_freeoscommerce_105.gif"

$boxes_column_left_search_modified = $oscTemplate->getBlocks('boxes_column_left');

$boxes_column_left_search_modified = str_replace('button_quick_find.gif','button_quick_find_freeoscommerce_009.gif',$boxes_column_left_search_modified);

echo $boxes_column_left_search_modified;

}

?>

</div>

</div>

<div id="right_sidebar_wrapper">

<div id="right_sidebar">

<?php

if ($oscTemplate->hasBlocks('boxes_column_right'))

{

// replace the quickfind button with "button_quick_find_freeoscommerce_105.gif"

$boxes_column_right_search_modified = $oscTemplate->getBlocks('boxes_column_right');

$boxes_column_right_search_modified = str_replace('button_quick_find.gif','button_quick_find_freeoscommerce_009.gif',$boxes_column_right_search_modified);

echo $boxes_column_right_search_modified;

}

?>

</div>

</div>

</div>

17 | P a g e

<!-- Layout Graphics -->

</div>

<div id="left_shadow"></div>

<div id="right_shadow"></div>

</div>

<!-- Footer -->

<div id="footer">

<div id="footer_content">

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

</div>

<div id="footer_background2"></div>

</div>

<?php echo $oscTemplate->getBlocks('footer_scripts'); ?>

<div id="top_background"></div>

<div id="main_background"></div>

<!-- Website Name/Logo -->

<div id="website_name"><a href="http://localhost/oscommerce/oscommerce/catalog/index.php">Buy Online</a></div>

</body>

</html>

Now replace these two files with the old file in the oscommerce.

Move the images folder & the style sheet to their locations

Your new template is ready.

18 | P a g e