Hello,
I am just wondering if it is possible ( and if so, how ) to post information to my MySQL database after a successful purchase.
On my website, I have "credits" that a user can buy. They come in three different sizes. Upon clicking the Add to Cart button next to a certain pack of Credits, and going through the payment process, I would like to update the user's credits total in my database. I'm just not really sure how I'm going to have to do this. Any help to get me started would be much appreciated.
Thanks.
Update Database After Successful Purchase
-
- Site Admin
- Posts: 4953
- Joined: Fri Aug 04, 2006 1:42 pm
- Location: Utah
Re: Update Database After Successful Purchase
You could use the Order Api feature which allows you to create a script that ShopSite calls when an order is completed. You configure this on Merchandising > Order Api. Help is at http://shopsite.com/help/11.2/en-US/sc/pro/order.api.html for the general configuration and http://shopsite.com/help/11.2/en-US/sc/pro/order.api.spec.html for the specification of how to write a script and what parameters will be passed to it. Note that this feature is only available in the Pro level of ShopSite.
-
- Posts: 2
- Joined: Sat Dec 15, 2012 11:48 am
Re: Update Database After Successful Purchase
Hmm.. I'm running this with iPage and their built-in ShopSite application. I can't seem to find the link to the Order API.
-
- Site Admin
- Posts: 4953
- Joined: Fri Aug 04, 2006 1:42 pm
- Location: Utah
Re: Update Database After Successful Purchase
Order api requires that a script be put in the shopping cart cgi directory. Unless you have your own install of ShopSite you probably will not be able to use the feature because hosts are reluctant to allow anyone to put something on the server that could impact others using the server.
The best solution would be to move to a host that does not share the cgis with multiple stores.
The best solution would be to move to a host that does not share the cgis with multiple stores.