Home arrow Web Authoring arrow Page 5 - Personalizing osCommerce
WEB AUTHORING

Personalizing osCommerce


osCommerce is a great open source application for building your online store. While it looks great out of the box, you'll probably want to change it so that it reflects your store's personality, so customers will remember it and keep coming back. Dan Wellman explains how to add your logo, colors, products, and make the most of one of the application's more versatile features.

Author Info:
By: Dan Wellman
Rating: 4 stars4 stars4 stars4 stars4 stars / 35
December 06, 2004
TABLE OF CONTENTS:
  1. · Personalizing osCommerce
  2. · What to know before you make changes
  3. · Logo and colors
  4. · Site content
  5. · InfoBoxes, step one
  6. · InfoBoxes, steps two and three

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Personalizing osCommerce - InfoBoxes, step one
(Page 5 of 6 )

The infoBoxes are a versatile and dynamic feature of the catalog.  Different pages or actions will cause different boxes to be displayed, and one of the things you may want to do is create your own infoBox. This is a three-part process. It starts with the file that actually creates the infoBox. For this example, I’ll show you how to make a box called links.php, containing links taken from other areas of the site.

You may be used to using notepad to create HTML and script files. For working in PHP, you may find that one of the many specialist code editors that are available will help make your life easier. I like to use the excellent Xint text editor: it’s free, it has line numbers (useful for debugging) and it features color coding (which helps you sort your HTML from your PHP and your If statements from your XML).  It has a whole bunch of other features too, but these are the main benefits.

Whichever text editor you use, open it now and add the PHP declaration and an ID and date comment:

<?php
/*
  $Id: links.php,v 1.01 2004/06/28 01:13:58 hpdl Exp $
 
  osCommerce, Open Source E-Commerce Solutions
 
http://www.oscommerce.com

  Released under the GNU General Public License
*/
?>

To keep with the consistency of the pre-defined boxes, the above statement should be kept intact, and comments used to mark the beginning and end of the box:

<!-- links //-->

In order to give the box an appropriately colored heading bar, you’ll need to embed your box in a table and include the following array:

<tr>
            <td>
<?php
  $link_box_contents = array();
  $link_box_contents[ ] = array('text' => BOX_HEADING_LINKS);

The box heading is defined in another file, which is explained in full in step two. For the actual links, add the following code:

$link_box_contents = array();
$link_box_contents[ ]= array('text' =>
'<a href=" ' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' .
       BOX_LINKS_CREATE_ACCOUNT . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .
       BOX_LINKS_LOGIN . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">'.
       BOX_LINKS_MY_ACCOUNT . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' .
       BOX_LINKS_CART_CONTENTS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' .
        BOX_LINKS_CHECKOUT . '</a>');
new linkBox($link_box_contents);}
?>

The names of your links can be changed of course, but essentially, once you have finished the code:

</td>
          </tr>
<!-- links_eof //-->

then saved the file as links.php, step one is pretty much complete. Upload the file in the normal way to the includes folder.


blog comments powered by Disqus
WEB AUTHORING ARTICLES

- Top WordPress Plugins for Social Media
- How to Install WordPress on WAMPP
- More of the Best Wordpress Plugins for Comme...
- Top Wordpress Plugins to Fight Spam
- More of the top Drupal modules for SEO
- Top Drupal Modules for SEO
- More Top Wordpress Plugins for SEO
- Website Optimization Tips
- Backup and Restore a Drupal Website and Data...
- 5 Best Web Font Services
- Web Font Embedding Services
- Joomla Site Administration
- Create PHP Pages that Use WordPress Templates
- Top Joomla Extensions for Social Networking
- Drupal Modules for Site Navigation

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials