How can I execute a custom script after purchase with Ubercart for Drupal

旧时模样 提交于 2019-12-25 04:39:15

问题


I hope I'm not using stackoverflow.com in the wrong way: asking this question!

Recently I ventured in to starting my own business to Sell software without realising the terrible implications that come with ecommerce - the only way to buy my software I offer. This would be fine if I was just selling the file downloads and/or shipping...But I'm not! I the hope that it would be easier (and alot cheaper) I am only offering digital downloads!

All this is fine, and I only have one hurdle to overcome - a big hurdle that is.. automating serial key disturbution!

By the way - the reason I'm using Drupal and Ubercart is, I wanted to make my business website look as professional as possible and I saw a CMS as the way to go. I picked drupal because its open source (free), flexible, very search engine freindly and I knew that lots of other sites with the same idea as me used it, among other reasons! AND I picked Ubercart because it seemed like there was more support for it and it seemed more up to date, etc. But I suppose I can turn to drupal ecommerce module if needs be.

Anyway. All I want is to be able to generate a serial key, add it to a MySQL database and sent it to the user via email as soon as I know that the payments gone through sucessfully - how ever they payed!

I've got the script for that!

I just don't know how to use it! How do execute it, when I some how know when the payments gone through? And How do I know the paying customers details like email, name and amount paid, etc...

Any advice or help appriciated...

Thanks in advance


回答1:


This is can be done with no problems, i want to tell you that Ubercart as a choice is very good , and more organized than ecommerce, just wanted to tell you that so you know you are on a good track.

I hope you are familiar with hooks, and if not , you can understand them easily in no time, in Ubercart there is a hook_order which gives you the ability to add a functionality when the order is being newly added , saved, updated , or any other state , check this link :

http://www.ubercart.org/docs/api/hook_order

I hope that was helpful enough.



来源:https://stackoverflow.com/questions/4353148/how-can-i-execute-a-custom-script-after-purchase-with-ubercart-for-drupal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!