| Server IP : 5.129.245.98 / Your IP : 216.73.217.19 Web Server : Apache/2.4.66 (Debian) System : Linux 1b8c17c336b9 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/themes/rehub-theme/js/ |
Upload File : |
jQuery(document).ready(function($) {
'use strict';
$(document).on("click", ".rh-user-favor-shop", function(e){
e.preventDefault();
var heart = $(this);
var user_id = heart.data("user_id");
heart.find(".favorshop_like").html("<i class='rhicon rhi-spinner fa-spin'></i>");
$.ajax({
type: "post",
url: rhscriptvars.ajax_url,
data: "action=rh-user-favor-shop&favornonce="+wooscriptvars.favornonce+"&rh_user_favorite_shop=&user_id="+user_id
}).done(function(count){
if( count.indexOf( "already" ) !== -1 )
{
var lecount = count.replace("already","");
if (lecount == 0)
{
var lecount = "0";
}
heart.find(".favorshop_like").html("<i class='rhicon rhi-heart'></i>");
heart.removeClass("alreadyinfavor");
heart.find(".count").text(lecount);
}
else
{
heart.find(".favorshop_like").html("<i class='rhicon rhi-heart-solid'></i>");
heart.addClass("alreadyinfavor");
heart.find(".count").text(count);
}
});
return false;
});
});