osCommerce 2.3 – adding currencies is easy!

Adding a new currency in 2.3 version of osCommerce is now incredibly easy. Go to your admin area > localization > currencies;

On this page, you’ll likely see “US Dollars” and “Euro” installed. To install a new currency, click the [+ New Currency] button, and you’ll see a number of input boxes ready for the new currency to be inserted. Just like the older versions of osCommerce…

What is new is the dropdown list of “pre-installed, but not active” currencies;

Selecting one of these from the dropdown will populate the input boxes, as so (I chose New Zealand Dollars);

So all I now have to do is press the [save] button. And now my shop is also able to use NZD as one of it’s currencies.

Updating the new Currency

It’s important to note that evary time you add in one or more new currencies, you must also press the [update exchange rate] button, else you will find that you are making a good profit or a bad loss when people pay you in currencies other than your shops default!

Easy as 123.

osCommerce 2.3 – Total Revenue Dashboard

Here is something new and cool in 2.3 – the Total Revenue Dashboard. This is an Admin Dashboard module showing your total revenues over the past 30 days;

As you can see this keeps a running total of the order values made on a day by day basis over the past 30 days. If you mouseover the small circles, you are given the value of the daily sale;

A nice and easy way to see total value orders. Should be quite handy.

To turn this off…

Easy enough – in your admin area, go to modules > admin dashboard > click the “total revenue” entry and press the [- Remove Module] button;

osCommerce 2.3 – Store Logo

Another new feature of 2.3 is the ability to easily change the Store Logo. As most users will be aware, the logo on a new installation of osCommerce looks like this;

Now it’s “easy” to change the logo…

Enter your admin area and go to configuration > store logo, you’ll see an uploading page that looks like this;

Click the [Choose File] button and you can browse through your files until you find your new logo that you want to use. It has to be a .png file type.

Once selected, click the [Save] button. You should now get a success message and a preview of your new logo;

Visit your store and refresh your browser and you should see your new logo;

Why this feature should never have made it into any osCommerce release

Because it’s pointless! If someone knows enough to set up osCommerce and create a new logo, then they presumably know enough to log into their webhosting and use FTP to overwrite the existing image. This feature is pandering to the lowest common denominator in my opinion.

Even worse, a simple image change is NOT enough to give a store any style – any store also needs to have some things removed, css changes, feature additions and so on. Have a look at the osCommerce Hot 100 and I guarantee to you that not one of them made that list simply by changing the logo.

osCommerce 2.3 – Social Bookmarks

Another new feature of 2.3 is the “Share Product” buttons which appear on each products information page;

Each of these buttons links to their respective sites to allow anyone browsing your shop let their friends and followers know about your product. As an example, here is what happens if the “twitter” button is clicked;

As you can see, the status is automatically showing the product URL, ready for tweeting. Same for facebook, buzz etc.

The only one that is slightly different is the first one, which is basically the same as the old “tell a friend” functionality that was in earlier versions of osCommerce.

It’s always good to allow people to promote your products, so these buttons are a welcome addition to 2.3 in my opinion.

What if you want to remove a button?

That’s easy enough, it’s an admin setting. So enter the admin area and go modules > social bookmarks;

Here you can remove modules, change the sort order of display etc. I’d like to remove all the modules except for Digg. So I highlight each in turn and press [- Remove Module] button. Now my Share Products box looks like this;

What if I want to add in Social Bookmark Icons?

Again, that’s easy. Simply hit the [+ Install Module] button…and you will be presented with a list of installable modules to select from. An interesting one is “Facebook Like”, so I’ll select that and press again press [+ Install Module]. I can now edit this module to suit my needs.

I now have a facebook like button on my product page;

This is something that people have been wanting for a while. Note that this module uses the iframe method from facebook rather than the much better API version that I previously blogged about.

You want to change the text “Share Product” ?

Open up /includes/languages/english.php and find the text to change;

I changed it to “Social Bookmarks”;

So my box now looks like this;

Conclusion

Nice addition to osCommerce, that will allow the site owner to have his/her products promoted by both customers and potential customers easily. I think we all know that word of mouth is the most powerful way of getting new customers, so this has to be a great addition…

Version Checker in osCommerce 2.3 (aka rc3)

Not quite sure why this feature made it into the osCommerce 2.3, as I thought that 2.3 was to be the last in the 2.x series of osCommerce. With 3 being impossible to upgrade to, and 2.2rc2a with contributions being hard to upgrade to 2.3, it seems a redundant feature. But it’s worth explaining;

In your admin summary page, you’ll see a box like this:

If you click it, your version will be checked to show you whether you have the latest osCommerce installed. If you have the latest version it’ll look like this;

And if you do not have the latest, it’ll look a bit like this;

How does it work?

A file in your osCommerce install gives the version of osCommerce that you are running – /includes/version.php – when you press the link to check, a signal is sent to the osCommerce site, which compares your version against the version stored at osCommerce. If the version you have is older than the version osCommerce has, then a message is given, and equally a different message if the versions match.

It’s a fairly simplistic approach for Site Owners to check what they have, but it appears impossible to actually act on that information (as I explained above, the system is a bit redundant). Hmmmm.

So, how to remove this (apparently!) useless box. Easy!

Go to your admin, click on modules > Admin Dashboard and click on “Version Check” in that list;

And simply click the “- Remove Module” button;

Fancybox AND image swapping in osCommerce

One of my very good clients came to me with an example website where the website had 3 or 4 different product images. These product images could be mouseovered to change a slightly larger image, and they could be clicked on to popup a much larger image.

Well, I’d done both these things before, but never at the same time. I was fairly sure that it should be relatively straightforward in theory…but as with anything osCommerce, theory and practice are usually like cat and dog, or chalk and cheese.

So, I set out to make it a reality, and here is what I came up with;

In the video, you can see that I have 4 product images (1,2,3,4 for ease of videoing!). The first is also shown as a larger image. If you mouseovered the smaller image, the slightly larger one changes – I thought this was pretty cool to get a quick overview of the product (imagine a front, back, side view)…

But also, if the user clicks the smaller images, the jquery fancybox kicks in and brings a web2 styled popup. All in all, it seems to work well. A little bit of work to get it all to play nicely, but worth taking the time to do, I think.

osCommerce buttons in 2.3 (aka rc3)

You might have noticed the cool new buttons that are pre-installed in the new version of osCommerce. These are powered by javascript (using jquery) – the default theme looks like this:

You can see that some buttons are plain (add to cart button in the image), and some are bold (write a review). With javascript turned off, they degrade nicely and look like this:

How to change the look of the buttons?

These LOOK of these buttons is controlled by .css – the css file for the default buttons is: /ext/jquery/ui/redmond/jquery-ui-1.8.4.css – you can change this file to suit your design.

For example, let’s say I want buttons with square corners…I’d open that .css file and find this line of code: /* Corner radius */ and remove the 9 or so lines of code underneath it. Save the file and upload. Now the buttons are square:

How about if I want them with a black border?…open up the css file again and find this lines of code:

[php].ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; }[/php]

Change it to:

[php].ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #000; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; }[/php]

And we end up with this:

So, you can go off and play with the .css file to get the look you need.

OR…

You can shortcut this! At the top of the .css file is a link to enable you to play with an online generator…here is a tinyurl link to the generator. Have a play with it.

I also found that it is ultra simple to entirely change the theme of your buttons, go to the jquery themeroller site and press the gallery tab button. You’ll see this;

You can see pre-made themes ready for download. I like the green “le-frog” theme, so I downloaded it and unzipped it. I then found the /le-frog/ folder (in the /css/ folder) and copied that to the same location as the /redmond/ folder (/ext/jquery/ui/).

And I made a note of this themes .css filename:

In this case, jquery-ui-1.8.5.custom.css

Then I opened up /includes/template_top.php and found this line of code:

[php][/php]

and changed it to:

[php][/php]

Saved the file and refreshed my osCommerce site. Now the buttons are green!

How simple is that? Well, fairly. Enjoy the new osCommerce!

osCommerce rc3 – installation is super simple

The installation is very similar to rc2 and 2a. Just follow the steps provided.

The first screen also gives a summary of whether osCommerce will work on your server:

If any of the items here has a red cross (unless they are optional), then osCommerce will not work. Contact your hosting provider!

If all looks good, then continue the install procedure. At step 3, there is now a change to allow you the shop owner to change the name of your admin section – please PLEASE change the name to something completely random.

Once the install is complete, please go to your admin area and insert your username and password, to enter. The first page that you will see after logging in is the overall summary page, which includes this message:

You must now correct these errors – do as the message says! Once properly done, the message looks like this:

Next, go to configuration > administrators. Here you will see your admin username, along with a large pink message like this:

Click the [edit] button and type in a new password, and tick (check) the checkbox to enable .htaccess protection.

Click the [save] button. As you enabled .htaccess protection, a grey box will popup asking you for your username and password.

Insert them and press the [Log In] button. If done correctly, you will see this message:

The installation is now complete.

If you are unable to install osCommerce, please get in touch as I will be happy to help for a beer fee.

Fraud via Shipping / Billing Address

One of my clients noticed that he was getting a bit of fraudulent activity via the changing of shipping and billing addresses, and came to me for a solution.

My initial solution was simply to set the “max number of addresses” to zero – meaning that only the address used during the creation of the account can be used for both shipping and billing.

However, my client needed something a little more flexible – for some known clients he wanted the ability to have multiple addresses, and for other clients to just have the one address.

With a little bit of thinking I came up with a way to do this. First of all, I flagged each customer (1 or 0 [database], green and red buttons [admin], meaning “can have” or “cannot have” addresses). I did this by amending admin/customers.php like this:

Next up I added and extra configuration option to set the allowed number of addresses like this;

Then I amended a few files within osCommerce to determine if the logged in customer is allowed extra addresses, and if so, he/she is able to add them;

and if disallowed, then he/she is not!

A fairly straightforward modification that did not take too long to get coded and tested. There is probably an existing contribution available that has this functionality, but by the time I found it, tested, recoded it to do what is wanted, tested again, it’s quicker to just write it from scratch!

List of Product Ordered for seasonal promotions

At the osCommerce forum, Heather asked;

What Im basically looking for is a list of customers against what products they ordered, some of my products are seasonal, and I want to be able to email the customers that bought them last year to remind them that they are in stock again.

Ideally:

Product + Customer + email address

My answer was to use phpmyadmin, and run the following SQL query;

[php]SELECT DISTINCT op.products_name, o.customers_name, o.customers_email_address
FROM orders o
LEFT JOIN orders_products op
ON o.orders_id = op.orders_id
ORDER BY op.products_name[/php]

I didn’t test it, but Heather returned to the thread to advise it worked as she wanted it. I’m not all that great at SQL stuff, so was hoping it worked out OK.

Basically, the SQL query is interrogating two osCommerce tables; orders and orders_products. From orders we are getting the “customers name” and the “customers email address”. From orders_products we are getting the “products names” ordered, but because we placed a DISTINCT on that, it only returns one rather than many (as there is no point knowing that Mr XYZ bought 3 of the same item!). Then we link the results from the two tables together, based on the orders_id (which is the same integer in each of the two tables). And finally we present the results ordered by products name.

So, in a real life situation, the output from phpmyadmin would look somewhat similar to this;

Please note I blurred out the email addresses in my graphics program.

What’s next?

I’m thinking that this (obviously with a few amendments) could be made into an automated script, which is run on a daily basis. This script would email each customer to let them know that a year ago (or a month ago or whatever) they ordered XYZ product, and it is now time for them to order again. Completely automated with no additional work needed from the shop owner. Probably make a really good addition to osCommerce, though I guess most shops don’t sell seasonal products?