WP Store Locator
[resolved] Conditional hyperlink for store url (3 posts)

  1. jambo135
    Posted 1 year ago #

    Hi I notice there is an option to use the store name as a link to their URL if one is provided. Please can you tell me if there is a way to make this conditional depending on if the user is logged in e.g. the code below. If so please can you help me find where to add the code.

    Kind Regards


    <a href="
    if ( is_user_logged_in() ) {
    $link = '/mylink/';
    echo $link;
    } else {
    $link = '/myotherlink/';
    echo $link;
    **STORE NAME ?**


  2. Tijmen Smit
    Plugin Author

    Posted 1 year ago #

    No not with php, whether the store is turned into an url or not is checked in the js file in the storeHtml function.

    What you could do is check if the body class 'logged-in' is set with js. If so, you could change the structure of the output.

  3. JFrankParnell
    Posted 1 year ago #

    axly, in wpsl_store_search(), instead of SELECT *, you could change it to SELECT [all fields except url] if ( is_user_logged_in() )...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Store Locator
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.