Ordog
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Store Locator] Toggle Featured StoresHi @tijmensmit
I just wanted to follow up on this to let you know that I’ve now done what I needed thanks to your help.
In the end I went with the data attribute as you suggested. One for distance and one that tracks the original order. Then I had a function that when the dropdown changes it either sorts by distance or sorts stores back into their original order.
Your support has been very much appreciated, thank you once again.
Forum: Plugins
In reply to: [WP Store Locator] Toggle Featured StoresOhhh I see why you mentioned adding classes now. That’s a far better solution compared to the overengineered one I was trying to do.
Thank you very much for your time and help with this.
Forum: Plugins
In reply to: [WP Store Locator] Toggle Featured StoresThank you @tijmensmit and don’t worry about the delay – I appreciate you taking the time to come on here and help.
All of what you’ve said makes absolute sense however I don’t think I explained it very well.
I don’t want to toggle the style of featured stores. I’d like a dropdown box on the frontend that will show featured stores at the top of the results list by default and then the option of changing the results to be distance only.
So going off what you’ve said, inside my ajaxComplete function I’d need something like:
$(document).ajaxComplete(function () { $("#dropdown").change(function () { if($(this).val() == 'featured_first'){ // Put featured stores at the top } else { // Sort by distance (featured stores appear in normal distance order) } }); });
—
I can see that the function for sorting by featured first is as follows, so I just need a way of merging the two together somehow.
add_filter( 'wpsl_store_data', 'custom_store_data_sort' ); function custom_store_data_sort( $stores ) { $premium_list = array(); foreach ( $stores as $k => $store ) { // Check if the location is a premium one. if ( isset( $store['featured'] ){ // Move the premium location to a new array $premium_list[] = $store; // Remove it from the existing $stores array unset( $stores[$k] ); } } /** * Merge the list of premium locations with the existing list. * This will make sure the premium location show up before the normal locations. */ $results = array_merge( $premium_list, $stores ); return $results; }
I hope this makes sense.
Forum: Plugins
In reply to: [WP Store Locator] Toggle Featured StoresHi @tijmensmit
Apologies for pushing for this but it has been over 2 weeks now and I can see you’ve been helping others (as recent as 2 hours ago) but there has been no update on this from your last comment.
Your help would be very much appreciated.
Kind regards
Forum: Plugins
In reply to: [WP Store Locator] Toggle Featured StoresHi @tijmensmit,
I just wondered if you’ve managed to find the time to take a look at this for me please.
Much appreciated
Forum: Plugins
In reply to: [WP Store Locator] Toggle Featured StoresHi Tijmen,
Yeah I have a reasonable understanding. I implemented your code from your well written guide that I linked to in my first post and then modified this to work with the Advanced Custom Fields instead.
So hopefully I should be ok with this too ??
Many thanks
Forum: Plugins
In reply to: [WP Store Locator] Checkbox filters AND instead of ORI figured this out. Thank you and apologies for this.
Forum: Plugins
In reply to: [Advanced Woo Search] Excluding hidden productsIgnore me!
Just needed to clear the search results cache and it now works as expected. Apologies for this.
Forum: Plugins
In reply to: [Advanced Woo Search] Showing empty categoriesThat’s spot on and works a treat – thank you very much!
I’ve just realised that I haven’t reviewed your plugin so I’ll do that now which is the least I can do to show my gratitude.
Perhaps you could use manners and be a little more polite when asking for some help? You might find people are more willing to help ??
Thanks @vasyl for the explanation, I understand.
On the site we have 1,000’s of posts so understandably it will slow it down if it is checking each one individually.
I will test the new experimental feature when I get some free time but for the time being everything is working and this isn’t a feature that is needed.
Many thanks
Sorry for the delay with this.
I tried all of your suggestions @vasyltech but in the end it was @lamary who fixed it for me.
on “Content Settings” I have disabled “Check Post Visibility”
Thanks for the help both of you ??
Yep I already looked at that, this was the error:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /public_html/wp-content/plugins/advanced-access-manager/Application/Core/Object/Cache.php on line 58
I unrestricted that user and the error still remains.
As mentioned this only effects users with the shop manager role and nobody else. Disabling advanced access manager fixes the issue.
Hope this helps
Forum: Plugins
In reply to: [All-In-One Security (AIOS) – Security and Firewall] iFrame protectionI’ve since added the below to my .htaccess file which seems to work.
Header append X-FRAME-OPTIONS “DENY”
It would still be good to know why the option in the plugin doesn’t work and what I can do to change this.
Thanks
Fantastic thank you.
I noticed there was an update yesterday that addressed a few issues however this was not one of them. Should I now expect this in the next release?
Sorry to be a pain, it’s stressful having the site get hammered by spammers in this one area when everywhere else is secure. Woocommerce don’t seem to want to help either.