Quick Add To Cart using Product Model

Over the next couple of days, I’ve been tasked to recreate the look/theme of a Magento site, to osCommerce. In addition, I also will port as many of the features as I can (given the complexity of code and time frame).

One of the features on the Magento site is a “quick add to cart” box, where the buyer can insert the product model and quantity – this then reacts with the shopping cart to add the given product…

I don’t know Magento well enough to say if this is a core feature, or a commercial extension. But it looks like this (in my clients Magento cart);

With a bit of thought, I was able to make some -experimental- code to to do the same job, here is how it looks in osCommerce;

Note; I will obviously be re-styling this to look like the Magento example!

And here it is in action;

Note that in the example I inserted the product model “pc-twof” which in a base install of osCommerce is the product called “The Wheel of Time”. If you can read between the lines, this functionality requires every product to have a unique product model.

I guess it is good if you have a shop that has a printed catalog that carries the product models – the good news is that customer won’t have to search or drill down through the category structure to press the buy button.

Let me know what you think of this idea? Can you see any drawbacks or benefits?

osCommerce 2.3 is officially available

A flurry of activity from Harald and Mark saw osCommerce 2.3 released yesterday. The download link can be found on the official osCommerce site at http://www.oscommerce.com/solutions/downloads

A quick overview of new features available in the new osCommerce is as follows;

  • Modular Action Recorders to log and limit certain functions, including:
    • Administration Tool login attempts
    • Tell A Friend e-mails
    • Contact Us e-mails
  • Security Directory Permissions for the Administration Tool shows which directories are writable
  • Version Checker for the Administration Tool to check for new versions
  • Modular Social Bookmarks to share products on social sites, including:
    • Facebook and Facebook Like
    • Twitter and Twitter Button
    • Google Buzz
    • Digg
  • PayPal Express Checkout pre-configured for new store owners
  • Guest orders through PayPal Express Checkout
  • Modular Header Tags for optimizations, including:
    • Google Analytics and E-Commerce Tracking
    • MailChimp E-Commerce 360
    • OpenSearch
  • New separated XHTML/CSS based template
  • jQuery UI design
  • 960 Grid System CSS Framework
  • Password hashing algorithm changed to Portable PHP hashing for customer and administrator passwords
  • Security Check modules for add-ons to check on server requirements
  • Administration Tool Dashboard widgets, including new charts
  • Modular Boxes to inject content anywhere in the HTML layout
  • Multiple Product Images with large images and HTML content for Flash videos
  • New Payment Modules, including:
    • PayPal Website Payments Pro and PayPal Express Checkout
    • Moneybookers
    • Sage Pay

Go ahead and try it. I’m sure you will be pleased with the majority of it. I’ll go into more depth on some of my ideas for it in some upcoming blog posts.

Well done Harald and Mark. Well done to that handful of the osCommerce Community who helped to find bugs and solve them.

This marks the beginning of a new era for osCommerce. Now that 2.3 is out, there will be a 2.3.1 to mop up any important changes. Then full concentration can go to bringing osC 3 to market.

osCommerce 2.3 – Information Boxes

2.3 has quite an interesting new feature which should make it much easier for store owners to change the look of their shop.

The Information Boxes (that is those in the left and right column of most osCommerce sites) can now be turned on and off and swapped positions from directly in the shop admin. Previously the shop owner (or developer/designer) had to amend /includes/column_left.php and or /includes/column_right.php to achieve the same.

So, how does it work?

Enter your admin area > modules > boxes – here you will see the admin functions to change the boxes;

In a new installation of osCommerce 2.3, all the infoBoxes in the left column have a sort order starting with 1 and the right column infoboxes have a sort order starting with 5. Easy to see what goes where? The LOWER the number the more towards the top of the column. In other words a box with a sort order of 1000 would be above a box with a sort order of 1050 – hope this makes sense?

How to turn an infoBox off?

Easy. Let’s turn off the Manufacturers box. Click the Manufacturers box and press the [-Remove Module] button;

How to move an infoBox more towards the top (or bottom) of the column?

As previously explained, you will need to change the sort order! Let’s move the “whats new” box from it’s present position to a new position above the “search” box, but below the “categories” box. First thing to work out is the present sort orders of the search and categories box. Search = 1030 and Categories = 1000. Thus to get our box in between those two, we can use any number from 1001 to 1029. I’d suggest exactly halfway at 1015. Select the “Whats New” box and press the [edit] button. This will give you the small editing box;

Look for sort order, and change the value to 1015, then press [save].

Go to your site and refresh your browser. The Whats New box is now between the Categories box and the Search Box;

How to move a box from one column to the other?

Easy! Again decide where you want your box by choosing a new sort order. Let’s say I want the “Search” box to be moved from left column to right column and to go at the top of the right column. Presently at the top of the right column is the shopping cart, so we know that the search box needs a LOWER number than the “shopping cart” box (5000). Let’s say 4900. Select the “Search” box, and press [edit] button. Again this brings up the editing box;

This time, change the sort order to 4900 and ALSO select “Right Column”. then [save]. Go to your site and refresh your page, and the Search box is now placed at the top of the right hand column;

Conclusion

It’s now easier for the Store Owner to change the look of his site.

osCommerce 2.3 to be tableless (well almost)

Latest commit shows osCommerce 2.3 is going tableless (well almost). This is great if the commit remains in the eventual download.

That is conditions.php – 12 lines of code. Reduced from 2.2 which is triple that.

66 changed files, with thousands of lines of code updated, removed, added.

This commit should absolutely do away with the need for STS (Simple Template System), Niora’s “osc2css” contribution and many more.

Of course,it does mean that developers will need to recode portions of contributions to deal with the new layout, but that’s easy enough.

This change really brings the 2.x family of osCommerce back as a force to be reckoned with in the world of e-commerce. osCom3 (version 3 osCommerce) will still be much better though as that’s a whole new engine, rather than this change which is just a new body…but, it’s a MASSIVE leap forward for osCommerce.

I also noticed that the “download source” button is now gone. So how to download this version from Github? Anyone know LOL.

2.3 and Simple Template System

I just learned that my good friend Bill Kellum is to start work on making the Simple Template System (STS) compatible with 2.3 version of osCommerce.

STS is basically a module script that parses information and displays it based on one (or more) template files. It’s a convoluted and not particularly great way to make a site look nice. Side note; I’ve seen sites with hundreds of STS template files which gave an effect that a couple of well placed “switch” could have achieved. Horrible module that no-one should be using in my opinion.

So, 2.3 and STS…

On the one hand I’m disappointed as STS brings little advantage that 2.3 does not have natively. 2.3 moves towards a slightly better template structure. 2.3 has the ability to grab tags per page. And so on.

On the other hand, I love STS, as it holds back people from learning how osCommerce and PHP work together. The smallest error or needed code change usually means an STS user having to get help from someone like me, and that means they have to pay for expertise.

It’s a conundrum. With no conclusion. Perhaps some of the readers here might like to share their views on STS? Should it make it into 2.3? Why? Why not?

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…