How do i access the wid of the Wishlist Products ?

Pit_La_QuillePit_La_Quille Member Posts: 22

Hello !

I added a button on every product of the page so the customer can add to his wishlist or remove the product from it.

I had no problem with the 'add' functionality but the delete one is different. It doesn't use the same id and i can't find a way to get this new one.


I thinks it's using a 'wid' wich is only reachable on the wishlist page but i need it on the category page.

So my question is, how can i get this 'wid' where i need it ?


Thanks in advance and have a nice day !

Best Answer

Answers

  • Pit_La_QuillePit_La_Quille Member Posts: 22

    I added a button on every product of the page so the customer can add to his wishlist or remove the product from it.

    I had no problem with the 'add' functionality but the delete one is different. It doesn't use the same id and i can't find a way to get this new one.


    I thinks it's using a 'wid' wich is only reachable on the wishlist page but i need it on the category page.

    So my question is, how can i get this 'wid' where i need it ?

  • Pit_La_QuillePit_La_Quille Member Posts: 22

    ok ! thank you for your answer ! i find another way to do what i wanted !

  • TradingboTradingbo Member Posts: 36

    Hey,

    Just curious, how did you manage to retrieve the Wid in the end?

    We're trying something similar,

    Best,

  • Pit_La_QuillePit_La_Quille Member Posts: 22

    Hey,

    the only way i find to retrieve those 'wid' is to use an httpRequest in JS so i can take all the items that are in the wishlist and use them.

    I really don't think this is an optimize solution but Lightspeed never respond to me when i wanted to be a 'partner' and the wids are not free access soo...


    Hope this helps ! Feel free to ask more questions if you want to do like i did !

  • AndyVAndyV Member Posts: 2

    Just as a follow up, since I had to do the same thing, here's a code sample of how you can get the wishlist using Javascript:

    const result = await fetch('/account/wishlist/?format=json')

    const data = await result.json()

    console.log(data.wishlist)

Sign In or Register to comment.