HEX
Server: LiteSpeed
System: Linux premium221.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: madepabj (2566)
PHP: 8.3.26
Disabled: NONE
Upload Files
File: //home/madepabj/public_html/wp-content/themes/rehub-theme/js/shoplike.js
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;
    }); 

});