Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为带有产品的客户自动创建购物车。然后客户可以登录网站并验证购物车。
我看到了如何在我的模块中创建购物车,但我不明白如何将购物车影响到客户?
将创建的购物车绑定到客户非常简单:
$cart = new Cart(); //Add products or what so ever $cart->id_customer = $my_customer_id; $cart->update();
或者只是更新您的ps_cart数据库表并设置适当的id_customer值。您可以使用此代码在一个函数中创建一个模块,并将钩子移植到 actionAuthentication,在客户成功登录您的网店后执行。
ps_cart
id_customer