Just a few products? Dump the categories…

By | April 3, 2008

Years back I had a client who had only a few products in his store. Rather than use the category infoBox I rewrote it to simply give a direct link to each product.

It’s funny that I was looking at that store the other day (it’s on the Hot 100 list), and today someone in the osCommerce Forum asked for exactly the same thing.

Rather than try to find the file I used on that old site, I just rewrote the script. 2 minutes later, and here we are;

[php]

BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, false, false);

$products_list = ‘

‘;

$info_box_contents = array();
$info_box_contents[] = array(‘text’ => $products_list);

new infoBox($info_box_contents);
?>

[/php]

What this script will do is simply list all your products in a long list, instead of the category box. Easy as 123, eh?

Obviously if you use this script, you will need to set a style on the <ul and maybe the <li – depends upon what you want the list to look like 😉

3 thoughts on “Just a few products? Dump the categories…

  1. Ronaldinho53

    Hi Gary,I have a potential client that only offers 1 product to sell. This looks like it could work for this situation. Thanks for the tip!

    Ron

    ps – I like this blog…lots of good info here.

  2. Gary Post author

    Ron – should work just fine – let me know?

  3. Ronaldinho53

    Thanks. I am meeting with him next week so I will keep you posted.

Leave a Reply

Your email address will not be published. Required fields are marked *