Category Archives: Code Tips

What Category are you looking at?

Sometimes you are not able to tell which Category you are looking at as the template that you are using might have changed (or even removed!) the Categories infobox. I’ve seen a few sites which use a horizontal dropdown menu (eg Easy Menu) which looks good, but takes away the visual representation of where you… Read More »

HOW TO: make just 1 infobox a different style

There are lots of ways to make osCommerce look different. Here is 1 way to make 1 infoBox look different to the rest – it’s easy – and is done using a CSS (Cascading Style Sheet) “trick”… Step 1: decide which infoBox to change In this example, I’m going to change the look of the… Read More »

UK Pound Question Mark – HUH?

Changing host is a simple thing – I’m not going to go into great detail about where to find a host, name server changes or any of that. I have found that moving an osCommerce site can sometimes be problematic – not least because of database issues and the sheer number of files that osCommerce… Read More »

Update price based on attributes

Lilotanni asks; When there are attributes assigned to a product and the attribute has money value to them. I wanted the base price to update automatically before the customer add it to cart. As in if the base price is $200.00 and the attribute is -$10.00, when the customer chooses -$10.00, the displayed price would… Read More »

Stripos used in RC2

In one place, stripos is used in RC2.  Stripos is PHP5 only, so many shops will break when used on a host that is not up-to-date. The solution is to find every instance of stripos, and change it to strpos (which is backwards PHP compatible).  I believe the only code you will need to change… Read More »

HOW TO: show number of products in cart

Shwoing the number of products in osCommerce cart is very simple; echo $cart->count_contents(); This will show the total number of items in a persons cart. You can go further with this and say something like; You have <?php echo $cart->count_contents(); ?> items in your cart. But this will not be grammatically correct if only 1… Read More »