Category Archives: Code Tips

Pop Quiz! osCommerce. Lets see how good you are…

So, this image shows a SQL command that I have amended from the original; Can you answer these questions; 1. In which file can the original SQL be found? 2. What add-on have I added to this particular site? Please provide a link to the add-on… 3. What change(s) did I make to the SQL,… Read More »

Google Breadcrumb Links for osCommerce

Recently, a reader of clubosc, “Snowbird” brought up an interesting diversion based on one of my previous posts about changing the breadcrumb in osCommerce. I did not know that Google sometimes shows breadcrumbs as part of the Search Engine Results Page (SERP), like so; The breadcrumb part is the bottom line (in green). Note that… Read More »

Add Order Number to Invoice – osCommerce

A client wanted to add the order number to the invoice, so it shows like this; It’s a pretty simple change, as shown below; Remembering to also create the constant for the language; Done! Then I was asked to “pad” the Order Number with a bunch of leading zero’s. My first idea was to simply… Read More »

osCommerce -> Admin -> Manufacturers -> BUG -> Fixed

I’ve been working on the manufacturers page of the osCommerce Admin section to get some “proof of concept” code working. Whilst working on it, I couldn’t understand why the manufacturers image kept disappearing. On closer inspection I found some buggy code which I have now fixed. Github Commit. Basically, the image was uploading nothing, and… Read More »

Using cURL instead of file functions

Some hosts don’t allow the possibility of using the file functions that are built into PHP. A URL can be used as a filename with this function if the fopen wrappers have been enabled. So, if the fopen wrappers are turned off, you have no chance of using an external URL to get information (an… Read More »

Password Masking osCommerce

Quite a while back, I was part of a discussion on a forum (not the osCommerce forum) about Jakob Neilsen’s ideas on password masking. You can read Mr Neilsen’s thoughts here). My idea was that his thoughts are valid, and are based on usability. My opinion is that 90% of users don’t need to have… Read More »

Only 1 product at a time in osCommerce

Over at the official osCommerce forum, someone asked about the possibility of only allowing a buyer to select 1 of each product.  My answer was to amend the display of the shopping cart and the shopping cart class… It’s fairly easy.  What I am going to show you is amending the display using HTML and… Read More »

osCommerce Quiz?

An osCommerce Quiz for you to think about; [php] switch (tep_get_zone_code($order->delivery[‘country’][‘id’], $order->delivery[‘zone_id’], ”)) { case ‘HI’: case ‘AK’: $extra_cost = ($cart->show_total() * (13/100)); break; default: $extra_cost = 0; switch ($order->delivery[‘country’][‘iso_code_2’]) { case ‘US’: $extra_cost = 0; break; default: $extra_cost = ($cart->show_total() * (13/100)); } } [/php] And then an extra piece of code like this,… Read More »

New, Used, Refurbished in osCommerce Product Info

Interesting code question posed on the osCommerce forum so I thought it would make a decent blog post; Are there any contributions out there which add product information fields in the admin section so that you can list the product as new, used, or refurbished? Always self code if possible, it’s better and you learn… Read More »