• Resolved George

    (@quantum_leap)


    Tried it with Chrome and Firefox already. I have selected the “Save Favorite in Cookie” option in the settings. When I favorite a post as an unregisterd user the coounter goes up, that’s ok. When I clear the browser and reload the page, the counter not only has it not been reduced by one but it allows me to favorite the post once more thus further increasing the count!

    https://www.ads-software.com/plugins/favorites/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Its just not possible for website to knows when user clears its cache, and tho to reduce number of favorites. You could be without internet when clearing cache, or on another website etc…but even on same, just not possible.

    Thread Starter George

    (@quantum_leap)

    I see your point, it seems that when you enable favorites for anonymous users and check the ‘Include in Post Favorite Count’, it writes the count on the database so there is no way to delete that count if the cookie is not there on refresh. Unchecking the above option saves the favorite on the cookie, highlights the button but does not increase the count. Clearing the cookie this way and refreshing the page unhilights the button.

    I have thus implemented a solution to show the button to logged in users only and show a note for anonymous users to log in if they want to favorite a post, similar to this:

    function add_bookmarks() {
      if ( is_user_logged_in()  ) :
        the_favorites_button();
      else :
      $siteurl = get_site_url();
    ?>
    <p class="bookmark-login"><a href="<?php echo $siteurl; ?>/my-account" class="popup-trigger-ajax">Log In</a> to save bookmarks</p>
    <?php endif;
    }
    add_action( 'listify_content_job_listing_footer', 'add_bookmarks', 25 );

    Thanks again for clarifying this!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Favorite count not reduced when cookie cleared’ is closed to new replies.