Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    If there are performance issues then either enable the marker cluster option in settings -> markers, or disable the “Load locations on page load” option on the settings -> map.

    And for the other things, you would need to make some code modifications to make it work. People have asked for this before, and multiple topics exist with code examples in the forum, I just can’t find them back at the moment, but they do exist. Maybe you have more luck.

    Thread Starter Gorhaen

    (@gorhaen)

    Thnks, I’ve enabled the marker cluster option and I’ve disabled the “Load locations on page load” option. Works.

    But I’ve not found nothing about do I have to change for send the parameters to “Locator” page on my homepage. You can write me the link? please

    Thanks!!

    https://wordpress.org/support/topic/how-to-add-a-search-inputbutton-to-my-home-page?replies=9

    I found this thread described solution. But I do not understand what should be the very form of the home page.

    <div>
     <div class="wpsl-input"><input id="wpsl-search-input1" autocomplete="on" type="text" value=""></div>
     <div><a>Locate</a></div>
    </div>

    Example INPUT on the link does not work unfortunately.

    Thread Starter Gorhaen

    (@gorhaen)

    Thnks! this link has resolved my problem. The key is Jquery.

    // zip code search (home page)
    jQuery(function ( $ ){
    	$('#wpsl-search-button-home').click(function() {
    		var url = '/pages/location-search/?zip=';
    		var inputURL = $('#wpsl-search-input-home').val();
    		window.location.href = url + inputURL;
    		return false;
    	});
    });
    
    // get parameter and post on location search
    jQuery(function ( $ ){
    	$.urlParam = function(name){
    		var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
    		if (results==null) {
    			return null;
    		} else {
    			return results[1] || 0;
    		}
    	}
    
    	if ($.urlParam('zip')) {
    		// set the default value of a text input field
    		$('#wpsl-search-input').val(decodeURIComponent($.urlParam('zip')));
    
    		// delay and click button
    		setTimeout(function(){
    			$('#wpsl-search-btn').click();
    		},5000);  // In my case 5000 because I have many stores
    	}
    });

    Place this in default.js o main.js of your theme.

    Place this in default.js o main.js of your theme.

    But what code should be on the front page?

    Hi Tijmen Smit,
    I want to customize the search field.I want separate the search field for postal code,city,street.
    I mean there are three input fields postal code,city,street in search.How can i customize to make three fields.
    Please help me all these.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Search from another page’ is closed to new replies.