Ubercart 添加到购物车触发器?

发布于 2024-08-26 08:48:35 字数 156 浏览 4 评论 0原文

我想跟踪添加到超级购物车的所有商品。即,每当有人单击“添加到购物车”时,我想:创建一个添加时间和项目的数据库条目。

这样我就可以看到哪些项目被点击最多。

将其添加到数据库等的逻辑很容易做到。我需要知道的是,如何插入“添加到购物车”部分。即我如何知道何时单击了此按钮?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

邮友 2024-09-02 08:48:35

您应该能够在自定义模块中实现 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.

烟雨凡馨 2024-09-02 08:48:35

在 Drupal 7 中,它更改为 hook_uc_add_to_cart

In Drupal 7 it changed to hook_uc_add_to_cart

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文