i used ajax for that , my item is being added in wishlist and remved also but color is not being changed . page is refreshing and color is set to default again.
i have passed data and fetching it from database.
success: function (data) {
var heartIcon = $('a[data-data="' + linkData + '"] > i.fa.fa-heart');
if (data === '1') {
heartIcon.addClass("red-heart");
} else {
heartIcon.removeClass("red-heart");
}
console.log(data);