southafricanrob
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Store Locator] Caching options for WP Store LocatorThanks – I’ll give WP Rocket a try as have heard good things. I would appreciate if you send me your recommended settings.
Cheers,
RobForum: Plugins
In reply to: [WP Store Locator] Filter results by store metaOkay thanks for the info. Makes sense, I’ll try some other ideas and see 8f I can find a workaround.
Forum: Plugins
In reply to: [WP Store Locator] Filter results by store metaHi – I’ve tried many methods to restrict the page where the custom query is applied but nothing appears to work. Even if I try and modify the query in the class-frontend.php the query is not loaded.
Any suggestions how I could achieve this? I have tried to add the function and filter inside the theme page template as the functions.php is loaded before the page so I can’t use is_page() as far as I can tell?
Here is the mod I made to class-frontend.php but still can’t understand why I doesn’t work…
$page_id = get_queried_object_id(); if ($page_id == 2548){ $sql = "SELECT post_lat.meta_value AS lat, post_owner.meta_value AS owner, post_lng.meta_value AS lng, posts.ID, ( %d * acos( cos( radians( %s ) ) * cos( radians( post_lat.meta_value ) ) * cos( radians( post_lng.meta_value ) - radians( %s ) ) + sin( radians( %s ) ) * sin( radians( post_lat.meta_value ) ) ) ) AS distance FROM $wpdb->posts AS posts INNER JOIN $wpdb->postmeta AS post_lat ON post_lat.post_id = posts.ID AND post_lat.meta_key = 'wpsl_lat' INNER JOIN $wpdb->postmeta AS post_lng ON post_lng.post_id = posts.ID AND post_lng.meta_key = 'wpsl_lng' INNER JOIN $wpdb->postmeta AS post_owner ON post_owner.post_id = posts.ID AND post_owner.meta_key = 'wpsl_store_owner_id' WHERE posts.post_type = 'wpsl_stores' AND post_owner.meta_value = '1' AND posts.post_status = 'publish' $sql_sort"; }
Forum: Plugins
In reply to: [WP Store Locator] Filter results by store metaThanks for the info, I’m on the right track I think.
Forum: Plugins
In reply to: [WP Store Locator] Override global settings for specific map template?Hi,
Thanks – this will get the job done for now – I had not thought are hardcoding the template.
Cheers!Forum: Plugins
In reply to: [WP Store Locator] Something went wrong, please try again!Thanks, I’ll take a look at that js file. I agree fully it is pointless to have it offline bit I just want to create and offline message that fits my UI.
Thanks for the great support as always!Forum: Plugins
In reply to: [WP Store Locator] Display Meta Data in frontend@princekeshan I have experienced similar behaviour, try dragging the start marker a little too force location update (or manually enter location and press search). I started not getting meta displayed without changing any settings but it seems to be related to the results being generated without a start location being passed.
Out of interest when I disabled the “Load locations on page load:” setting the custom meta was loaded but I’m not able to understand why this is. Anyways, hope that helps with your debugging.
Forum: Plugins
In reply to: [WP Store Locator] Auto Zoom level settingThanks for the info – could you perhaps elaborate on what “Number of locations to show” does? I don’t really see any change in number of results when this is set or not – and not sure how it relates to the “Max search results” setting?
Thanks,
RobForum: Plugins
In reply to: [WP Store Locator] Get the distance for use in a custom functionThanks – this is very helpful – I didn’t realise I could just set the variable from the store meta.
Forum: Plugins
In reply to: [WP Store Locator] Load Custom Template CSS firstThanks – yes this solved the issue.
Forum: Plugins
In reply to: [WP Store Locator] Only show custom categories marker from a specific parentApologies – I just found a simple solution – here it is in case of use to someone else:
Simply use
$terms = wp_get_post_terms( $store_id, 'wpsl_store_category', array( 'parent' => 12 ) );
which will only populate the array of terms from the parent category/s specified, in my case parent with ID = 12.
Forum: Plugins
In reply to: [WP Store Locator] Where to add Javascript to add a class?Thanks – makes sense, much appreciated. What I’m trying to do is conditionally hide or show certain store meta fields. Is there perhaps a better way to do this than just hiding the element with Javascript?
Forum: Plugins
In reply to: [WP Store Locator] Get Array of category IDsHi again,
I realise I was going about this back to front and all the IDs can be obtained and used inside the custom_store_meta function, and then the result passed to the custom store template.Much simpler and it works.;-)
Forum: Plugins
In reply to: [WP Store Locator] Custom Dropdown Filter returning 500 errorHi @freemans98765 – did you figure it out? I am attempting much the same but also having errors.
ThanksForum: Plugins
In reply to: [WP Store Locator] Show driving distance instead of straight line distanceThanks – that makes sense…