1

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.

4

1 回答 1

0

在结帐的最后一步中,调用 ps_checkout->add() 将购物车项目添加到数据库中,但相同的函数会发送通知电子邮件并从会话中清除购物车。你可以做的是:

  • 使用系统插件 onAfterInitialise 查找触发最后结帐步骤的选项/任务
  • 从 $_SESSION 重新计算购物车总数,您还需要初始化美德玛特会话,看看美德玛特.php
  • 将结果临时存储在不同的 $_SESSION 变量中
  • 相同的插件,检查感谢页面的加载并检查会话中的变量。然后触发您的 API。
于 2011-07-10T00:05:47.860 回答