Documentation osCommerce

osCommerce recommendation Plugin

This page describes how to use the recommendation plugin.


This plugin makes the most accurate product recommendation. In order to ensure the best recommendation for every product and every user, it collects anonymous data about sales and items in stock. Absolutely no client information is stored.


Please get the plugin from the download page, if not already downloaded.

Also please note that once the installation is completed, recommendations widgets might not show up immediately. This is because the system needs some data to initialize. This might take up to one hour.

1- Copy the content of catalog folder into your osCommerce installation.

  • The folder ezreco should be copied in catalog/includes/modules
  • The folder ezjs should be copied in catalog/ext

2- Configure parameters in ezreco/config.php

  • Recommendation server url to be used: EZ_RECO_SERVER_URL (value provided by default)
  • idsite (provided by ezreco): EZ_RECO_IDSITE
  • Security token (provided by ezreco as private key): EZ_RECO_PRIVATE_TOKEN
  • Allows automatic update on runtime: EZ_RECO_AUTO_UPDATE

New: Use our new automatic configuration generator: config.php

3- Track user behavior

Copy the following php line to enable recommendation tracking (continuously improves recommendations based on user feedback) in catalog/includes/footer.php at the end of the file:
<?php include(DIR_WS_MODULES . 'ezreco/eztracker.php'); ?>

The first 3 steps can be done in advance in order to start collecting more data before actually starting using these info in recommendations.

4- Add recommendation widgets

Copy the lines that loads our recommendation widget into your site. These lines can be copied anywhere you want your widget to show. The simplest way to get recommendation is:
<?php include_once (DIR_WS_MODULES . 'ezreco/ezreco.php'); ezReco(); ?>
– For instance, you can show it on the product page, in product_info.php under the closing </form> tag:
<?php include_once (DIR_WS_MODULES . 'ezreco/ezreco.php'); ezReco('PRODUCT'); ?>
– or on the home page, line 269 in index.php:
<?php include_once (DIR_WS_MODULES . 'ezreco/ezreco.php'); ezReco('HOME'); ?>
– or on the column on the right in template_bottom.php, in ‘columnRight’ div: <?php include_once (DIR_WS_MODULES . 'ezreco/ezreco.php'); ezReco('OFFER','html_template_vertical',3); ?>

ezReco function parameters:

  • First parameter is the recommendation type used (defaults to ALL), values are: HOME, PRODUCT, ALL, OFFER, TOP, RANDOM
  • Second parameter allows you to choose a specific rendering template or implement your own one: html_template, html_template_vertical
  • Third parameter is the maximum amount of products to show, defaults to 6
  • Fourth parameter is the minimum amount of products needed to show the recommendation widget, defaults to 2
  • Fifth parameter is a custom widget title, to be defined in the translation files

5- Automatic versus cron data update

Our system needs to collect some infos to make the best recommendation possible. No customer personnal info is collected.

There are 2 options available:

  • Automatic update on runtime (not recommended for production systems)
  • Cron job: Define periodic updates of your data (i.e. every hour or day depending on your site update rate).

How to define a cron job?

The cron job is a php script that can be run standalone. Scheduling configuration of the job depends on your host. The syntax for the cron job varies from host to host, but the following should work:
php catalog/includes/modules/ezreco/ezproduct_upload.php

6- Customization

The plugin is designed to be easily customized:

  • The main container is defined as a html template in templates/
  • It is designed to be easily modified for css classes, rendering, and blocks organization.
  • In the source file documentation you will see the main variables you have access to.
  • Fill free to contact us for more templates, since we had the opportunity to integrate many specific cases.