• Resolved serbaneski

    (@serbaneski)


    Is there any way to let unregistered users add listings to favorite and be able to see that page? Thank you and congratulations for such a nice plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author RadiusTheme

    (@techlabpro1)

    Hello,

    Sorry, sir this functionality need login cause the user needs to manage his favorite ads. Guest user activity can not count.

    Thanks

    Thread Starter serbaneski

    (@serbaneski)

    Can you hide the add to favorites function for unregistered users?

    Plugin Author RadiusTheme

    (@techlabpro1)

    Hello,

    We don’t have control for this. You need to customize the code to do this.

    Thanks

    Plugin Author RadiusTheme

    (@techlabpro1)

    You can try this code

    For listing details page override this plugin file plugins/classified-listing/templates/listing/actions.php using child theme.
    copy the file and paste it in following location child-theme/classified-listing/listing/actions.php then add this condition in line no 22 is_user_logged_in()
    line 22 to 24 full code –

    <?php if ($can_add_favourites && is_user_logged_in()): ?>
    	<li class="list-group-item" id="rtcl-favourites"><?php echo Functions::get_favourites_link($listing_id); ?></li>
    <?php endif; ?>

    For the listing archive page, add below code in child theme functions.php file

    remove_action('rtcl_listing_meta_buttons', [\Rtcl\Controllers\Hooks\TemplateHooks::class, 'add_favourite_button'], 10);
    add_action('rtcl_listing_meta_buttons', function() {
        global $listing;
        if (\Rtcl\Helpers\Functions::is_enable_favourite() && is_user_logged_in()) { ?>
            <div class="rtcl-btn"
                 data-tooltip="<?php esc_html_e("Add to favourite", "classified-listing") ?>"
                 data-listing_id="<?php echo absint($listing->get_id()) ?>">
                <?php echo \Rtcl\Helpers\Functions::get_favourites_link($listing->get_id()) ?>
            </div>
        <?php }
    }, 10);
    

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unregistered users adding to favorites’ is closed to new replies.