Installing UDM4 dropdown menu on osCommerce

osCommerce is one of the most popular PHP and MySQL based e-commerce web applications. This document is designed to help you install and configure a UDM4 dropdown menu on an osCommerce installation. The dropdown menu will be automatically populated with all categories and sub categories on your osCommerce installation and will be dynamically updated when you make changes to your category structure.

osCommerce requirements

The following prodecures were tested and verified to work on osCommerce 2.2. These procedures should work on previous versions of osCommerce as well, but have not been tested.

Displaying osCommerce categories in your UDM4 dropdown menu

There are three steps to installing UDM4 on an osCommerce website.

  1. Get the UDM4 Code
  2. Install the udm.class.php file
  3. Modify your osCommerce Installation

Get the UDM4 Code

The first thing you will need to do is have a licensed copy of UDM4 to install on your system. You may either purchase a license or, if you work for a non-profit / non-commercial organization, request a non-profit license online.

Once you have a license, you may download the UDM4 dropdown menu code and install the code on your server (using FTP or similar method), in the catalog directory. (i.e. you should have a catalog/udm-resources/ folder).

Install the udm.class.php file

Once you have the UDM menu installed on your server, you will need to download the following file:

osc_udm.class.zip

Extract (unzip) this file. You should see a file named "udm.class.php". Place this file in the following directory on your server...

INSTALLATION_DIR/catalog/includes/classes/
(Where INSTALLATION_DIR is your web root - usually similar to /var/www/html)

Modify your osCommerce installation

The final step is to add UDM to your installation. To do this, you should be aware of the various customizations you have done to your osCommerce installation. The examples below assume a standard osCommerce installation.

First, open the INSTALLATION_DIR/catalog/index.php file and add this code. You should find this on or around line 15 in the index.php file.


require('includes/application_top.php');
/* UDM INCLUDE */
require(DIR_WS_CLASSES . 'udm.class.php');
$udm = new UDM();
// the following cPath references come from application_top.php

Next, you'll need to call the head and body configuration files. To add the head configuration files, find the </head> tag in the index.php file and add the following immediately before it.

 
<?php
	$udm->get_config('header');
?>

</head>

Next, you'll need to add the body configuration files immediately after the <body> opening tag.


<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<?php
	$udm->get_config('body');
?>

The final step is to add the udm menu to your site. This can be added anywhere on the site, in many different locations. For our example, we will add it to the index.php file, but your particular installation may vary. Below is an example on how to add your menu to the index.php file.


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

  <tr>
  	<td colspan='3'>
  			<?php
				$udm->display();
			?>	
  	</td>
  </tr>

NOTE: Depending on your UDM needs, you may need to modify the udm.class.php file, specifically the get_config() method, to generate the correct head and body configuration options. If you have questions on how to do this, you may contact us, or post in our forum.

This should provide the basics to get a functioning UDM menu installed and working on your osCommerce system. If you need assistance with customization, feel free to request a quote from us to customize your UDM menu to match your site's look and feel. If you have any problems with these instructions, or would like to offer use some helpful tips, please feel free to contact us.

Thank you.

This document is intended to offer methods to install UDM4 on a third party system. We do not endorse the use of any particular third party system, and offer this document as-is, without warranty expressed or implied. osCommerce is a Trademark of osCommerce , © 2000-2007 osCommerce - All Rights Reserved

User Notes


Search

UDM 4 is valid XHTML, and in our judgement, meets the criteria for WAI Triple-A conformance.