Writing a WordPress plugin

A while ago I was asked if I could write a shopping cart. I had already started one a few years ago, but never finished it. So I began to go through the scripts and tidy them up ready for use. But part way through I discovered that what was really needed was something to integrate into WordPress.

During the process I realised that turning it into a plugin would provide many advantages. A major one of which was the ability to process the orders within WordPress admin. The scripts grew, bugs were found, integration with paypal was eventually managed and finally we achieved our goal.

The result was that Mike Cherim was finally able to open up his online shop for Green Methods: Biological Pest Control and Integrated Pest Management.

Most of the coding I have done is seriously behind the scenes. Mike was responsible for creating products, and styling everything. I had to take his products, using his existing framework and integrate a set of shopping cart scripts. Mike’s ideas pushed things far beyond what I had imagined, and we both hope that users of the shop enjoy their experience.

But how did we get to that point. There were two or three shopping cart plugins out there, but they had flaws that made them unacceptable for our needs. Over use of javascript, complicated, and integrated, product entry and poor mark-up. I looked at adapting those scripts, but decided it would actually be quicker to adapt my own. Problem was I knew nothing about writing a wordpress plugin!

I learnt as I went along, and I dare say there are a few places where things could be achieved a lot easier, but it works! and that is the main thing.

Of course leaving it there would be one option. However I decided part way through, or Mike suggested it, that releasing it as a plugin could be an option for the future. This may actually become a reality.

But WordPress is limited when it comes to using it as a Content Management System, let alone a shop! So I have been scouring the WordPress site, utilising Google searches and am getting closer to having all the necessary snippets to begin writing a full blown paypal shopping cart for WordPress. Mike has already offered, or was that press ganged?, to help with layout, CSS, enhancement suggestions and testing.

But as a always when writing scripts, we can’t think of everything. Wish lists and suggestions will be appreciated.

Updated 1st October

Currently the feature set may include some or all of the following, plus any I think of as the work progresses.

  • 1 product per pagedone
  • Product form will appear on the edit page – done.
  • Products can have options – done.
  • Shipping rates – done.
  • Parent page will be able to list sub pages just like categories with posts (hopefully) – done.
  • Admin Order handling section – done.
  • Automatic emails on successful purchase, with option to send one from the admin order handling- done.
  • User configurable email – done.
  • Configurable Out of Stock message – done
  • Automatic form/message for each product added to page – done.
  • Automatic creation of required pages – done
  • Pages added to WordPress search – done

Then along came a new set of features, which need integrating before launch:

  • Upload downloadable products – nearly completed
  • Full handling with stats for downloadable products – nearly completed
  • Integrate with product entry menu – to do
  • Integrate with shopping cart front end – to do
  • Integrate with shopping cart back end – to do
  • Other integration to ensure I don’t miss anything – to do
This entry was posted in Accessibility, Colleagues, News. Bookmark the permalink.

8 Responses to Writing a WordPress plugin

  1. John Faulds says:

    Would it be possible to give a list of features that will be included? And then people could suggest ones that are missing that they think would be important.

  2. Rich says:

    John, problem is if I do that it gives people a list of pre conceived ideas, and may hinder getting fresh ones.

    But I can see your point, and will add above.

  3. John Faulds says:

    1 product per page

    I’d think the ability to display more than one product, ie, all products in a particular category, would be high on most people’s wishlists.

  4. Rich says:

    I know, hopefully point 5 will cover this. But it is difficult to explain. If you create products on sub pages of a main page, then there will be a facility to list snippets of all products/sub pages.

    Posts already have that capability, I’m just extending it to pages as best I can.

  5. John Faulds says:

    I guess it’s hard to describe as a feature but aside from it being easy for customers to use, the main thing I’d think people would be looking for would be ease and flexibility of adding and updating products including product images.

  6. Rich says:

    Ease of use is one reason I am turning it into a plugin. The few that are available don’t really help, with complicated installation and even the interface is a bit unwieldy. Product images will be handled by standard WordPress upload. I’m hooking the product entry into the ‘edit page’ to try and make things as easy as possible.

  7. Rich says:

    This plugin will shortly be available via Quirm.net.

  8. luukmuu says:

    Thank for plug-in.

Leave a Reply

Your email address will not be published.

Comments will be sent to the moderation queue.