Home | Store | osCommerce Tutorials

osCommerce New Products Module Introduction

The osCommerce New Products contents will be displayed under two conditions. If you study the file structure or file codes of osCommerce homepage and other visual pages carefully, you will find out that the New products module will be included or inserted into the webpages when category_depth == 'top' and category_depth == 'nested'. The file structure is illustrated in the following diagram:

osCommerce file structure and New Products module

What is the $category_depth variable?

The value of $category_depth will be assigned according to which osCommerce pages are browsing:

  • visit osCommerce homepage: $category_depth == 'top'
  • visit osCommerce Parent Categories: $category_depth == 'nested'
  • visit osCommerce Product Pages: $category_depth == 'products'

Where is New Products Module Saved in osCommerce Website

The PHP codes already told the path and filename of the osCommerce New Products Module.

include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

The file path (DIR_WS_MODULES) of the New Products Module is defined in catalog/includes/configure.php as shown below:

define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

Therefore the file path (DIR_WS_MODULES) of osCommerce New Product Module is: includes/modules/

The filename (FILENAME_NEW_PRODUCTS) of the New Products Module is defined in catalog/includes/filenames.php as shown below:

define('FILENAME_NEW_PRODUCTS', 'new_products.php');

Therefore the filenames (FILENAME_NEW_PRODUCTS) of osCommerce New Product is: new_products.php

Path of osCommerce New Products Module:

Combined the file path and filename of New Products Module: includes/modules/new_products.php

osCommerce Homepage

The first condition is when visiting the osCommerce homepage (i.e. when category_depth == 'top'). The New Products contents is highlight in red color in the following picture.

osCommerce homepage New Products module

osCommerce Navigate Through Categories

The second condition is when visiting the osCommerce Parent Categories (i.e. when category_depth == 'nested'). The New Products contents is highlight in red color in the following picture.

osCommerce homepage New Products module

Now we know that the osCommerce New Products module will be included when visitor visiting:

  • the osCommerce homepage, and
  • the osCommerce Parent Categories.