E-commerce for Training System

E-commerce for Training System

In a rush job, I was asked to prepare a complete e-commerce web site for a company providing online training. Well, I confess: I actually volunteered for the job. I was fairly confident that OpenCart would be able to get us through in a short time, and I knew that the client did not have excessive or unusual requirements for a template. We bought a cheap basic template then modified it slightly. All went well.

At very short notice, I got a complete e-commerce site running for a company selling online training. (Cannot be named for reasons of confidentiality).

Again, I used the excellent Opencart system written in PHP. I am always pleasantly surprised how this system accommodates so many requirements so quickly and reliably. In a short time we had loaded many training products, catered for tax and shipping in NZ, Australia and worldwide. We made 3 "stores", one for each zone, and all using one set of product data and static pages, but automatically re-pricing into the local currency. This makes just one set of product data to maintain, the most efficient way.

PHP Template Amendment

Naturally, Opencart lets you publish static information pages, such as "About us" and "FAQs".  But these are not held in any category system, unlike Products.  We wanted to shows three categories of such pages, about a dozen each for screenshots and help guides for three major components of the software.

I hit about a neat trick to vary the OpenCart software with the minimum of PHP, (so that it would be easy to upgrade in future years). First off, I added the three sets of Help pages as products rather than as Information pages. I set their prices to zero, and amended the PHP template so that any product which had a zero price did not show any Add-to-cart options. This meant that we could easily organise them in categories but still look just like regular pages.

Secondly, we wanted a means of showing "Previous" and "Next" buttons so that the user could easily move through the set. OpenCart has a concept of a route to a page, and a design concept called a "Layout Override", where the standard template can be superceded by a variation of your choice.

  • Instead of the usual "product/product" route, I made a new PHP template in the product folder called "sequence", containg the "Previous" and "Next" buttons and some formatting amendments. 
  • Then, in System > Layouts, make a new layout and associate it with the route called "product/sequence".
  • Finally, for each of the pages (products) in question, you use their Design tab and choose "ProductSequence" as the Layout Override from the dropdown.


Buy Product

Special Template page

PHP, OpenCart, E-commerce
Date: 2012

Top of page