a php developer weblog

blog Closed!
calin view of the web development world

2002/8/5

Camera shop with PHP: the simplest digital camera shop (external)

@ 12:13 PM (71 months, 29 days ago)

During the past week I have been busy extending the Amazon Webservices class. I added support for heavy XML parsing, instead of using the XSL transformation from Amazon which I found unreliable.

Then I thought of writing an application that ‘looks’ nicer, because why not, this is what everybody is looking for. I thought of some hot topic in current sales, found the Amazon.com category and build this simple digital camera shop:

http://shop.php9.com/camera.php

The only hardcoded items are node ids from Amazon, which are not yet easy to browse in this XML release. They represent the categories on the left side, in the navigation side. The shop runs on 11 files with a code that is not product ready, but works as a demo.

I am using the templates mechanism from the base Amazon_WebService class that is available here:

http://www.php9.com/index.php?p=6

The class is used to display the products contained in a category, the search results (like in the Amazon PHP API), the product page with its accessories and related products.

For the categories pages there is a caching layer which doesn’t come inbetween the feed from XML Amazon and the parser because in this case the PHP script would need to parse the XML file at every call. The caching mechanism is HTML Caching. You can see a basic design of this caching layer here: