Virtuemart - 结账时绑定 API 功能
我想做的是,一旦用户结帐,假设他购买了价值 25 美元的积分;我需要向 API 发送一条消息,告知用户购买了价值 25 美元的商品。
我找到了 checkout.thankyou.tpl.php
文件,一切顺利后会在其中给出确认消息。这就是我要连接 API 函数的地方。
我的问题是如何获取用户刚刚购买的金额?从上面提到的页面中,我需要访问用户刚刚花费的总金额。它存储在全局变量中吗?还可以访问吗?我将不胜感激您的任何想法。
What I am trying to do is once the user checks out, say he buy's $25 worth of points; I need to send a message to an API that the user made purchases worth $25 dollars.
I found the file, checkout.thankyou.tpl.php
, where the confirmation message is given after all goes well. This is where I am going to tie in the API function.
My question is how do I get the amount that the user just purchased? From the page mentioned above, I need to access the total amount that the user just spent. Is it stored in a global variable? Is it still accessible? I will appreciate any ideas that you may have.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在结帐的最后一步中,调用 ps_checkout->add() 将购物车项目添加到数据库中,但相同的函数会发送通知电子邮件并从会话中清除购物车。您可以做的是:
On this last step of the checkout ps_checkout->add() is called to add the shopping cart items into the database, but the same function sends the notification email and clears the cart from the session. What you could do is: