how to add a like button without any kind of log in. ?
like ,anyone who visits the website can like a product and likes should be displayed
Hey
Create a Data Collection with product id inside and a number field called “likes”.
When someone clicks the like button query the data collection, get the correct record for the product and update the value of the field “likes” to be increased by 1.
Then connect a dataset to your page and filter on the product id you have in your data collection.
Be aware that this means that one person can like one product several times because you do not check who the user is.
You could use the local storage and set a cookie when they have clicked the Like button using local.setItem(productId, true); and then when then visit a product page check if there is a cookie stored with the correct product id and if that happens they have liked this product. Not the most thought through and secure solution but it works.
I hope you get some ideas where to start. There is also videos on Youtube, search for Wix and Wix Show and you will find lots of great videos to learn to do this.
can you please give us any link for the videos you mentioned ?
I was referring to the general Wix Channel because there are lots of stuff there usable for this
If you want Wix Show to make a tutorial for this please go to https://www.wixshow.com/today and write that to us.
@andreas-kviby okay wix show work ur magic
Is there any video or is it possible that someone help step by step to create a like button with a counter? Thank
These two examples will help:
-
Ratings (allows rating/likes without requiring a login)
-
Ratings by User (allows logged in users to rate/like an item)