Remove "All" category from the dropdown menu

New home Forums Pro Add-on General queries Remove "All" category from the dropdown menu

This topic contains 10 replies, has 2 voices, and was last updated by  Gabor 1 year, 4 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #38939

    Gabor
    Member

    Dear Support Team,

    I am using Pro plugin version 7.10.03. I spent hours to find out how NOT to display all markers when map is loading, only a certain category “2”, but did not find any working answer.

    Please help me to get it solved. I am not talking about Store locator, but only imported markers. I would like to let them visible only when the user select one of the available categories and not to sho them by default.

    Thank you so much for any support!

    Best regards,
    Gabor

    #38944

    SupportTeam
    Moderator

    Hi Gabor,

    Thank you so much for getting in touch with us.

    This isn’t support by default, but you can use some custom JavaScript in Maps -> Settings -> Advanced in the Custom JS field:

    var wpgmza_default_category = "1";
    jQuery(document).ready(function($){
    $('.wpgmza_map').on('wpgooglemaps_loaded',function(){
    $('#wpgmza_filter_select').val(wpgmza_default_category).change();
    });
    });

    Change the number in var wpgmza_default_category = “1”; to be the ID of whichever category you’d like selected and shown by default. You can find the category ID in Maps -> Categories in the first column of the listings.

    Thanks so much for your time, hope this helps?

    Kind Regards,
    Trevor Anderson

    #38951

    Gabor
    Member

    Dear Trevor,

    First of all, huge thank you for your fast reply! I implemented the code you sent me, but only half success; The second category appears in the drop down menu first (not “ALL”), but still all other markers are visible.

    This is very strange, because there is no content in category 2, I just did it to try to make all other marker invisible.

    Do you have any idea what I should do? I am very grateful for any help.

    Best regards,
    Gabor

    #38952

    SupportTeam
    Moderator

    Hi Gabor,

    Sorry for that, it seems it needs to wait a second to change the dropdown value, try the following instead:

    var wpgmza_default_category = "1";
    jQuery(document).ready(function($){
    $('.wpgmza_map').on('wpgooglemaps_loaded',function(){
    setTimeout(function(){$('#wpgmza_filter_select').val(wpgmza_default_category).change();},1000);
    });
    });

    Thanks so much, hope this helps?

    Kind Regards,
    Trevor Anderson

    #38965

    Gabor
    Member

    Dear Trevor,

    Thank you very-very much! It functions, I just need to find out anyhow how to hide “All” option, because that is just a bit disturbing at this phase of map usage.

    I am not sure if this setting killed the direction function, but DIRECTIONS are not appearing on the map, only the step by step guide above. However that is essential to show of course.

    Could you please have a look at that? Without drowing the route on the map, it is almost worthless :((

    Thank you,
    Gabor

    #38966

    Gabor
    Member
    This reply has been marked as private.
    #39060

    SupportTeam
    Moderator

    Hi Gabor,

    Sorry for the issue.

    I can’t see the map you linked to, when I enter in the password it tries to redirect to wp-login.php which returns a 403 Forbidden error.

    In any case we have just released updates to fix several bugs, could you please try updating and seeing if that fixes the problem?

    Basic (7.10.10)
    Pro (7.10.06)

    Please try this code which should also remove the All option:

    var wpgmza_default_category = "1";
    jQuery(document).ready(function($){
    $('#wpgmza_filter_select option[value="0"]').remove();
    $('.wpgmza_map').on('wpgooglemaps_loaded',function(){
    setTimeout(function(){$('#wpgmza_filter_select').val(wpgmza_default_category).change();},1000);
    });
    });

    Thanks so much, hope this helps?

    Kind Regards,
    Trevor Anderson

    #39076

    Gabor
    Member
    This reply has been marked as private.
    #39178

    SupportTeam
    Moderator

    Hi Gabor,

    Sorry for the issue.

    Unfortunately whenever I try to enter the password it gives me this error:

    Forbidden
    You don’t have permission to access /wp-login.php on this server.

    Possible causes of this error include:

    The request was forbidden by rules in the .htaccess file.
    The directory you requested does not have an index.html or index.php file.
    The permissions on the file or directory are incorrect.
    For details about why the request was forbidden, see the Apache error log at:

    /srv/users/SYSUSER/log/APPNAME/APPNAME_apache.error.log

    Can you see if there are any browser console errors when getting directions? To check this right click anywhere on the page and select Inspect. Then click the Console tab in the popup window.

    Thanks so much,

    Kind Regards,
    Trevor Anderson

    #39194

    Gabor
    Member
    This reply has been marked as private.
    #39195

    SupportTeam
    Moderator

    Hi there,

    Sorry for the issue.

    It seems you are running another maps plugin that’s causing Google Maps API to be loaded twice.

    You can either deactivate that plugin for adjust our setting for the options Load Maps Engine API or Prevent other plugins and theme loading API in Maps -> Settings.

    I’m also seeing this error in the browser console window which is preventing some things from working:

    You have exceeded your daily request quota for this API. For more information on usage limits and the Google Maps Javascript API services please see: https://developers.google.com/maps/documentation/javascript/usage

    Thanks so much, hope this helps?

    Kind Regards,
    Trevor Anderson

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.