Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

IEMA - new BSI documents


Recommended Posts

The IEMA (Institute of Environmental Management and Assessment) shop http://www.iema.net/shop has been live for a few months now, selling various IEMA documents.


Today we entended the shop to supply a range of environment-related BSI (British Standards Institute) documents. There are about 2000+ documents listed, and they are updated each month.



For the technically-minded, here is how we update the documents each month. The documents arrive as a flat file of records in the BSI custom export format. A simple awk script converts this into XML. We then use XSLT to transform that XML into a file of SQL statements, used to update the database. We are careful to update where possible and insert only where new documents are included. We haven't thought about how to remove older documents yet - probably by hand through the admin screens.


A few extra columns needed to be added to the products and categories tables to store the BSI references for the products. I recommend adding these extra columns - 'external references' - to the base OSC product as it is the only real way to keep track of uploaded products from an external database.


The categories is supplied to us as a spreadsheet. We convert this to XML too, and then to insert/update statements. There are several hundred categories available, but we only use a small selection of them, so load them all in the 'disabled' state.


A PHP script then goes through the categories and enables just those that have products against them, and disables the remainder. We don't therefore have empty categories hanging around (I would advise the many OSC shops out there to check their categories and disable those that do not have products - it just does not look neat).


Updating all the products takes just a five minutes, but does involve a number of steps, each using different technologies. Each technology was good at one or two areas of the process (awk: processing flat files; xml: transforming XML into several different formats at once; PHP: fixing data in the database, getting around the limitations of MySQL [would not be needed if MySQL allowed sub-selects]).


There are many other customisations on the shop, most involving layout tweaks. Drop me a line if you need any explanations of how something works - but don't expect code you can 'drop in' to your shop as OSC is not structured in a way that allows that kind of thing (which is a shame - a better structure would have allowed me to implement the customisations much more quickly, and in a way that would allow me to share those changes more easily - but that is just the way it is:)


Have fun exploring - if you are into standards and stuff.


-- JJ

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...