Sneak Preview at Discount Coupons v6

Just a couple of screenshots to whet your appetite;

I’ve restricted the 2 “graphic card” products to be excluded from the discount calculations…

So, assuming the customer now buys a couple of products including an “excluded” product, the shopping cart looks like this:

Notice the calculation is correct? It’s discounting only the “Beloved DVD” and not the “Matrox g200″…

And the end of the checkout confirmation looks like this:

Notice it’s discounted only $22 (which is 40% of $54.99)…obviously in the example I used a 40% money off coupon code.

And in the Admin area, the invoice shows like this:

I am still testing this and I have already noticed a couple of areas where the new v6 coupon code could do with a little tweak. No release date as yet…but it is coming soon.

Update iPayment Credit Card; Introduce iPayment ELV and Prepaid modules

+ catalog/ext/modules/payment/ipayment/callback_cc.php
+ catalog/ext/modules/payment/ipayment/callback_elv.php
+ catalog/ext/modules/payment/ipayment/callback_pp.php
m catalog/includes/languages/english/modules/payment/ipayment_cc.php
+ catalog/includes/languages/english/modules/payment/ipayment_elv.php
+ catalog/includes/languages/english/modules/payment/ipayment_pp.php
m catalog/includes/modules/payment/ipayment_cc.php
+ catalog/includes/modules/payment/ipayment_elv.php
+ catalog/includes/modules/payment/ipayment_pp.php

Update iPayment Credit Card; Introduce iPayment ELV and Prepaid modules

osCommerce Twitter

Here are the Twitter accounts of some osCommerce affiliated individuals and companies;

Me: @osc_pro

HPDL: @haraldpdl

Sparky (Mark): @oscsparky

Tony Blacker (of osQuantum): @logondotinfo

John Westera (aka berkedam): @berkedam

Carine: @cbruyndoncx

Holbi: @holbi

That Software Guy: @thatsoftwareguy

Link up at www.twitter.com and say hello!

Banned Passwords in osCommerce

As you can probably tell, I’ve been working on a project to include more user-facing javascript to make the shopper more aware of what is going in the shop. Here’s the next script that I was asked to create for the project;

Banned Passwords in osCommerce

Put simply, my client wanted to stop people from using passwords that are too obvious or too easy to crack. So…he found a list of passwords that Twitter has banned and wanted me to ban them also. He also wanted to ban any passwords below 6 characters and any passwords made of numbers only.

A few lines of code later (some PHP, some javascript) and this is the result;

In this example, the password used is the word “password” which is in the Twitter Banned List. If I change it to “p455w0rd”, a small piece of javascript fires which checks it again and tells the shopper if it’s OK or not – this is done “on the fly” as part of the form filling out process.

Note that for the purpose of this Blog Post, I changed the password input to a 2tep_draw_input_field” rather than a “tep_draw_password_field” in order to show the passwords in the images.

Note also that this script does not check for the “strength” of the password – I suppose that this could be achieved rather easily by checking if the password has at least 1 number and perhaps 1 or more upper-case characters. That may be something I blog about another time.

osCommerce based CMS

The I-Metrics CMS is a complete dynamic content management system that can be used for start-up businesses, blogs and personal sites. One of the objectives of the project is to further expand the MS2.2 framework covering other types of websites.

The package includes features to create, group and associate text pages and image lists, effective SEO modules, scalable via a Plugins manager and uses the engine of osCommerce MS2.2 simplified without e-commerce features.

Several adminn tools allow the site owner to monitor traffic, backup the database, personalize the site, manage the website content, send/receive emails and optionally manage multiple websites via a single administration control panel.

I-Metrics CMS is extremely light, very easy to learn and it is expandable and suitable for both novice and advanced web-developers. Novice programmers can easily learn the basics of the framework as the core structure is basically osCommerce – changes to the core files are very simple, while advanced developers can use object oriented programming and the benefits of he integrated Plugin manager to expand or modify the framework according to their website requirements. Only a handful of files control the layout of website front, making template integration trivial.

The built-in Plugins manager is independent of the core functionality, individual Plugins can take advantage of the core functions or implement their own.

The latest releases of this package can be found in sourceforge.net and there is an online demonstration of the package at demos.asymmetrics.com.

osCommerce rc3 – more new features!

Just sparked up the latest rc3 and notice some more new features;

This shows the latest osCommerce Addons. You can subscribe to the RSS feed by clicking on the orange button. I don’t know if this is much use, as the addons area is a complete mess with all sorts of rubbish being added (such as updates that do nothing, support requests and so on).

Latest osCommerce News box. Kind of interesting to have so long as it will be regularly updated by ALL of the team! By regular, I mean at least a couple of times a week.

Version and Update checker. Again, an interesting possibility to allow people to easily see if an update is available. The only real problem is that it’s impossible to update an osC store at this moment unless it is completely standard and unchanged – and who runs an unmodified osC store? Anyone?? Well yes, but not many! However, with future updates in mind (hooks รก la WordPress maybe?) this will be a good addition.

osCommerce is moving forward!

Screening customers via email address

In the osCommerce forum, someone asked about the possibility of only allowing customers from 1 domain to be able to sign up to their shop. I suppose a typical example might be some shop set up solely for employees of a given company…

Anyway, with a bit of thinking, I came up with the idea of placing the allowed email domains into an array, like this:

$good_emails = array('gmail.com', 'hotmail.co.uk');

Then checking in create_account for the $_POST’d email address and compare against the $good_emails array, and either allow or disallow the account to be created.

$em = explode('@', strtolower($email_address));
if (!in_array($em[1], $good_emails)) {
$error = true;
$messageStack->add('create_account', sprintf(ENTRY_EMAIL_ADDRESS_DISALLOWED, '@' . $em[1]));
}

This works well, but doesn’t give the person trying to create an account any idea that his or her email address is unallowed until they’ve actually filled out the form and submitted – how annoying is that.

So, with a bit more thinking, I used a piece of jQuery to check the inputted email address on the fly. It looks like this;

And by video;

You can easily see that at first I used @gmail.co.uk which is NOT in the allowed list of good emails. I then changed it to @gmail.com and it turned green “on the fly”. A good way to show the potential buyer immediately of any problem.

Had they NOT changed to an allowed email address and gone on to create the account, they would see this;

Notice the error message? I used sprintf to throw back the error message along with the email address they tried to use.

Search Engine Optimised URLs for osCommerce

Dave asks;

Which URL rewriting contribution do you recommend?

I get asked this question quite often. In my opinion, there is just two decent versions of URL rewriters, depending upon whether you have PHP4.x or PHP5.x

If you are running PHP4.x ;

Ultimate SEO Urls – click on the “history” tab and find the version by FWR Media, dated 12 Jan 2010.

If you are running PHP5.x ;

ULTIMATE Seo Urls 5 – by FWR Media

There is also a “Pro” version of #6768, but I am not sure if this has been publically released yet.