Product MiniDescriptions for OSCommerce 2.3

Product MiniDescriptions for OSCommerce 2.3

Adding minidescription to your product listing in OSCommerce 2.3 is easy:

  1. Create a new field in products_description. (use the following in phpMyAdmin)
    ALTER TABLE `products_description` ADD `products_minidescp` TEXT NOT NULL

    Then type the product mini-descriptions directly into the database.

  2. On about line 121 in index.php
    change:

    case 'PRODUCT_LIST_NAME':
    $select_column_list .= 'pd.products_name, ';
    break;

    to this:
    case 'PRODUCT_LIST_NAME':
    $select_column_list .= 'pd.products_name, pd.products_minidescp, ';
    break;

  3. In includes/modules/product_listing.php
    change this:
    case 'PRODUCT_LIST_NAME':
    if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
    $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
    } else {
    $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
    }

    to this:

    case 'PRODUCT_LIST_NAME':
    if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
    $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br/>'. $listing['products_minidescp'].'</td>';
    } else {
    $prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br/>'. $listing['products_minidescp'].'</td>';
    }

That’s it!

In OSCommerce 2.2RC2a step three above is different:
3. In includes/modules/product_listing.php
change this:
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

To this:

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br/>'. $listing['products_minidescp'];