Ubercart 添加到购物车触发器?
我想跟踪添加到超级购物车的所有商品。即,每当有人单击“添加到购物车”时,我想:创建一个添加时间和项目的数据库条目。
这样我就可以看到哪些项目被点击最多。
将其添加到数据库等的逻辑很容易做到。我需要知道的是,如何插入“添加到购物车”部分。即我如何知道何时单击了此按钮?
I want to keep track of all items added to uber cart. I.e. Whenever someone clicks ADD TO CART, I want to: create a database entry of the time and item added.
This way I can see which items are most clicked on.
The logic to add it to a db etc is easy to do. What I need to know is, how do I plug into the "add to cart" part. I.e. How do I know when this has been clicked?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够在自定义模块中实现 hook_add_to_cart ,它将被完全调用你上面描述的。
You should be able to implement hook_add_to_cart in a custom module, which will get called exactly as you describe above.
在 Drupal 7 中,它更改为 hook_uc_add_to_cart
In Drupal 7 it changed to hook_uc_add_to_cart