New look for osC Books – check it out!

After 4 years, I decided that osC Books was a very stale design – so this morning, I rebranded it!  Have a look at www.oscbooks.com and let me know what you think.

I’ve tried to give it a more “modern” look and feel – as well as make it easier to navigate – I’ve also given most of the books a nice “Cover Shot” as well, as the old cliche is somewhat true – one picture IS worth 1000 words.

The whole site is now much more accessible than previously – always a good thing!

In addition, I’ve recently hanged over to a new system for delivering the eBooks which is working out very well.  They are now on an instant download via my good friends at Digital Product Delivery.

Why this post?

I want to point you guys at the site, as the osC Books will give you a really good head start on the subjects they cover.  All the eBooks are very competitively priced – and for a while I still have the BOGOF (Buy One Get One Free) offer running whereby you get a 2nd eBook to the same value as your purchased eBook for free.

www.oscbooks.com

Top 100 Script – not an update!

I’ve been getting a lot of emails about the script that I am using to power the “Hot 100” list. It’s basically a script which was coded for me, which I call “5 Starred“.

star_rater.gif

At the moment, it costs $20, but I have it on offer at 1 Month – present price is just $2.00, which increases by $1.00 each day.

02.gif

So, if you like the look of the script, feel free to get on over to 1 Month and pick it up at the cheapest price possible.

Gary

The Walk of SHAME ;)

I thought it might be interesting to post up URLs of sites that are using the Green Template I made without linking back to this blog (as is required)…

What I will do, when I find such sites, is send them an email asking for the link to be reinstated – if they ignore it, or just plain refuse, I’ll out the URL in this blog post, so that we can all see just who takes advantage of other peoples hard work, without a thank you…
Should be fun as I already found 2 sites this morning!

How to use PHPMyAdmin to load SQL

Sometimes it is necessary to action a SQL file when installing contributions into osCommerce. This is really simple, and consists of you making changes to your shop database.

You will need to have access to a piece of software called “PHP My Admin” – thankfully this is supplied as standard on 99.9% of all hosting accounts. So you should log into your control panel and find it! You can see some general screenshots by clicking here.

All you need to do is click the name of your osCommerce database in the small left hand pane. This will bring up the right hand pane which has tabs along the top. One of these tabs is called “SQL”. Click that, and then paste the contents of the SQL into the box and press go. DONE!

Here’s a video that shows how to do this:

However, you should note that PHP My Admin is a VERY powerful tool and it would be quite easy to nuke your whole database if you did something wrong. For this reason, I suggest that you BACKUP your shop database before making any change to it.

Adding A Delivery Date

Over in the official osCommerce Forum, someone wanted the ability to add a “delivery date” that the customer can choose to select.

I have no doubt that there is a pre-existing contribution that can handle this, bt I thought it would make an interesting exercise, to see if I could come up with something that is coded cleanly and, most importantly, works easily…

Introducing the Club osCommerce Date Picker!

This little mod took me about 15 minutes work. I added a text input using javascript on the checkout_shipping page, and created the value as a session. I input the session value into the database. Then pull the value from the database to display the customer preferred delivery date in the Admin area.

Here’s a short video showing this;

If anyone wants the code, please let me know – it does involve some changes to core osCommerce files (though the changes are very minimal. If anyone wants it, I’ll package it up ready for download.

Make A Comment, Ask A Question

When you are making a comment (on this blog) or asking a question (by email), please follow these “rules”;

  1. Be polite. 
    Goes without saying.
  2. Ask your question (or make your comment) usefully. 
    Ask your question giving as much detail as you can, if it would help to show a URL, please do so.  If you give me nothing to work with, I cannot answer you!
  3. Use a real email address
    This is mainly for Blog Comments – if you use an email address which doesn’t exist, eg “dontspamme@spam.com” I will not set your comment live and you will not get an answer.  You be fair, and I’ll be fair.
  4. Realise that time is money
    I take exception to people thinking that they somehow own MY time.  So, don’t expect to get me on “messenger”, you need to wait for an answer.  If you email, realise that I usually don’t email back – I put your question(s) and my answer(s) on this Blog.

Follow these rules and I’ll do my best to help you out.  If you bypass these, I simply won’t bother.

Thanks!
Gary

Sanitize the Best Sellers InfoBox

In this post, I’m going to show how to take out some of the usual osCommerce code and replace it with sanitised (clean), semantically correct code!

The fiel we are working on is /includes/boxes/best_sellers.php

Find this code:

$bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
$rows++;
$bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
}
$bestsellers_list .= '</table>';

And replace with

$bestsellers_list = '<ol>';
while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
$rows++;
$bestsellers_list .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</li>';
}
$bestsellers_list .= '</ol>';

What we have done here is strip out a table (always a good thing!) and replace it with a numbered list (ol).  osCommerce makes far too much use of tables to simply position items – which should be done using sematically correct HTML and CSS.

This little change in the best sellers box is the first step towards making osCommerce semantically correct!

osCommerce Online Merchant v2.2 RC2a Released

osCommerce Online Merchant v2.2 RC2a has been released to fix 2 bugs and replaces 2.2 RC2. The fixes are:

  • Use of PHP 5 only stripos() function during the database restoration routine on the Administration Tool. A compatibility function has been added to work on PHP <5 servers.
  • A PHP warning message is produced on requests where the session has not been started (ie, for search engine spiders). This is due to referencing the $_SESSION superglobal variable in tep_session_is_registered() which does not exist if the session has not started. A check for this variable has been added to this function.

The code changes for existing 2.2 RC2 installations can be seen here:

(Click on the green “Expand all” link to reveal the changes)