search

Home  >  Q&A  >  body text

tp3.2 implements adding to shopping cart without login

How to add items to the shopping cart when not logged in, and retain the items in the shopping cart after logging in.

How to determine whether the user who added the shopping cart before logging in and the user who retained the shopping cart after logging in are the same user?

TAOTAO2384 days ago1757

reply all(5)I'll reply

  • 捂耳听风。

    捂耳听风。2018-06-26 20:58:25

    This has nothing to do with any framework. You can save the data added to the shopping cart when you are not logged in, and just merge the data directly after logging in. As for how to determine whether it is the same user, I know that there is a plug-in for js that can generate data based on the browser and device. A unique identifier, the others are unknown

    reply
    0
  • TAO

    Okay, thank you. What plug-in is it? I just don’t know how to determine whether the products put into the shopping cart before logging in are the same user after logging in.

    TAO · 2018-06-28 10:17:28
  • apologize

    apologize2018-06-22 12:00:01

    IP address

    reply
    0
  • 无忌哥哥

    无忌哥哥2018-06-21 13:43:43

    My understanding is that adding a shopping cart means adding a session, and logging in also adds a session, so it should not matter if you are logged in or not.

    reply
    0
  • TAO

    What I mean is that users can add items to the shopping cart even if they are not logged in. After logging in, the items added when not logged in are retained in the shopping cart, but I don’t know how to determine whether it is the same user before and after.

    TAO · 2018-06-21 17:00:00
  • Cancelreply