I’ve got a repeater that displays multiple products. Each product item has a button that goes to another webpage.
I want to have a counter under each product item’s button that counts the number of times the button has been clicked, similar to your typical “likes” button on Facebook etc.
The pseudocode I’ve got is:
-
Create a ‘Number’ type field in the repeater dataset e.g. called “count”
-
Upon website initialisation, set each repeater product item click counter text to its “count” field using getItemReady()
However, I’m having trouble figuring out how to do the following things:
-
Update a specific item’s counter when that item’s button is clicked (how do you access a specific item in a repeater, depending on which item button was clicked?)
-
How do you save the total clicks from one session back to the dataset, such that if the user refreshes the webpage, the total clicks from the previous session is still there? The updated # of clicks should also be shown for other users.