custom software design

ArticlesYahoo Store Shopping Cart Integration with PHP and MYSQL
custom software design

This article is intended for someone who already has experience progamming Yahoo Store and is familiar with Yahoo's documentation and/or programming their shopping cart. Yahoo store has traditionally developed their own custom shopping cart language that allows web developers to work with.

The problem has always been that if you have a lot of items in the Yahoo's catalog manager, you want to make them dynamic. In order to do dynamic programming one usually uses a programming language like PHP and a database like MYSQL.

Well, here is the problem, Yahoo technical support does not support PHP/MYSQL since there are lot of web developers with a range of different skill levels. They just support Yahoo store backend core functionality. If you need a special customized shopping cart and Yahoo's tools aren't enough for you, then you are on your own.

custom software design
Well, I am here to tell you that you can use Yahoo store programming called store tags with PHP and MYSQL. There are several things you will need to account for, but once you do that, it will work fine. The problem occurs when the server tries to process the PHP file and the Yahoo Store Tags at the same time. This is because when working with Yahoo store, they divised something called RTML which is their mini-programming language and it conflicts with PHP.

But, did you know that if you figure out what the store tag resolves to first, and then you can simply use that in your PHP code?

First, lets start off simple: The first thing that you find in their documentation is how to view the shopping cart.

This is pretty easily done using their store tag code.

For example the view cart tag is:

And can be used as follows:

Well, when you type this tag into an html form and upload this tag, it will resolve to a URL similiar to this one
(if you view the source...I am using a fake url for tutorial purposes):

Since you know what it resolves to, you can actually use the direct link instead of the store tag:

Now you can use throw this in your PHP code using a simple echo command and it should work as normal:

This is one example of how you do not have to exclusively use their store tag code to get things to work. You will probably want to store the href link into global PHP variable in a header file so that should Yahoo ever change this on you, then it will be a simple adjustment.

Now, armed with this knowledge you can actually develop a PHP/MYSQL custom shopping cart that will display the items and pictures but you will need to also maintain the items and item numbers in the catalog manager.

The same principle applies when adding an item to the shopping cart. For example, using the store-tag wizard I generated this code to pull the description and price for item #10001 along with the form tag action. You will need to already have this item in the catalog manager:

Now you can actually re-write it to do this (by viewing the source) and store it in a file called "test.html". Remember, I am using a fake cart and a fake item. The easiest way to figure out this line is to use the store tag wizard to generate the code, upload the file, view the source and go from there:

These 2 pieces of code above will do the same thing.

Well now you can write this in PHP format and store it in a file called "test.php":

All 3 examples of code above will do the same thing.

Using this philosophy you can now build your shopping cart around PHP with database MYSQL and set it up anyway you want. You may have to develop a feature to export the MYSQL product line to CSV so you can upload it into catalog manager when adding/modifying products.

Remember, other website companies won't tell you how to do this in the first place, so keep this in mind when looking for a company to work with when starting an online store. Either way, this tends to work very well.