Posts Tagged credits as currency
Zen Cart - Using On-Site Credits as Currency
Posted by alexbranning in Portfolio on August 25th, 2009
I recently published LetterheadStudios.com; a web site selling professional clipart using on-site credits as the currency to purchase the art. I wanted to walk you through the steps I took, the problems I encountered and what you need to know to make credits work for your Zen Cart store. NOTE: Due to privacy concerns and my own integrity, I will not be sharing the database schemas or any other information that could open up my client to hacking or foul play. I will not respond to inquiries asking for specific information regarding the site setup, but I’ll be happy to help as you develop your own store using credits as currency.
First, keep in mind that the only way for you to use credits as currency (and allow the purchasing of credits on your site) you will essentially have TWO separate commerce systems running on your store: one for buying credits and another for buying merchandise. Making them work side-by-side will require extensive modification to your Zen Cart store that will be hard to reverse if you ever wanted to run a “normal” store on your web site. Now that you understand the risks, let’s make this work!
Step 1: Set up a category that allows your visitors to purchase products
You will need to have some separation between your “credit” items and the items your visitors will purchase using credits. My client asked me to do some extensive modification on the category detail page so that his “credit” items appeared dramatically different (in layout) than the items he is selling for credits. I recommend you do the same so you don’t confuse your customers.
Step 2: Set up the rest of your store for credit purchases
Your customers will use the normal Zen Cart ordering process for purchasing credits, so setup your payment modules appropriately. You will have to modify your includes/classes/order.php to track the credits purchased and debit the appropriate accounts (this step proved to be somewhat difficult, I had to use some out-of-the-box solutions to make this work the way the client asked).
Step 3: Add the rest of your products (the ones you will sell for credits)
Add these products using the Zen Cart inventory management tools, we want to use as much of the functionality that comes with Zen as we can!
Step 4: Create necessary database tables to track credit spends, refunds and other important transaction details
LetterheadStudios.com asked me to track all purchases made using credits (as well as downloads of the purchased clipart). Storing and using this data will require a lot of custom code because you will not be using the normal Zen Cart ordering process. LetterheadStudios had me record all transcations instantly using Ajax technologies so that the customer could continue browsing (and spending) without any delays. As I noted in my introduction I will not give any database schemas to protect my client; but I can help you along. Make sure you save the product ID of the purchased item with timestamp, logged-in customer ID, and the number of credits spent.
Step 5: Enhance the administration so you can track credit spends and give refunds
It is crucial that you have a way to refund your customers in case they can’t download/receive the products they purchased for whatever reason. I modified the customer edit screen to allow for a quick credit refund, show all credit-related history and display all e-commerce transactions from the selected account.
Happy coding! Let me know if you need any assistance, I will do my best to answer your questions. If you’d like a quote for your Zen Cart project that will use credits as currency, please email me at alex(at)branninggroup.com