Oct 21 2009
Using PHP Data Services in Flex 4 with Shopping Cart
I was at Adobe Max this year and Using PHP Data services with Flex was one of the sessions i attended. It was a very informative one and showed how one needs to do very little work to use remoting with PHP.
Flex 4 has some powerful wizards to use data services and it makes it lot easier to get data into Flash. The value objects are created for you and all the heavy lifting is done by Flex.
It uses Zend Framework for remoting but the best part is you don’t have to write any php code, only some MySQL queries to get the required data.
This is not a tutorial but a working example of how i was able to connect a Zen Cart database with my Flex Application and it took me less than a day to get this working, the main part was spent of learning the zen cart db structure and then writing the MySQL query to get the products list. I am sure any shopping cart can be easily connected.
To have little more fun with it, i also threw in the layout managers which come with Flex 4 and demonstrated how easy it is to change the look and feel of your application. I am not a designer but using Flash Catalyst one can easily make this application very visually appealing too.
http://nayansavla.com/zen/flex-output/zen.html This is the Flex application which pulls in the products from the zen cart.
http://nayansavla.com/zen/ This is the HTML default version which comes with the Zen Cart.
http://nayansavla.com/zen/admin admin/admin if you want to change the products and then see them update in the Flex application.
This was very easy to accomplish, i am not going to share the code sorry. The Flex 4 data services makes it so easy todevelop a CRUD system.
Edit: I have rebuilt my server so the html version of zen cart doesn’t work need to update it. But the flex works.