Store Locator Plus® for WordPress › Forums › Premier Support › Order by shortcode not working
Tagged: order_by, shortcodes
- This topic has 8 replies, 3 voices, and was last updated 6 years, 10 months ago by Lance Cleveland.
-
AuthorPosts
-
February 11, 2018 at 7:35 PM #56048DebbieParticipant
I am trying to order a list of locations by store, but it keeps sorting them by radius.
I am using the following shortcode:
[SLPLUS only_with_category=”member” immediately_show_locations=”true” order_by=”sl_store ASC” initial_results_returned=”300″ initial_radius=”5000″]This successfully returns a full list of member category locations, but they are not sorted by store name here:
https://www.amputee-coalition.org/healthcare-providers/membership/current-member-facilities/Plugin environment:
Store Locator Plus:4.9.7Experience:4.9.1 Version 4.9.7 in production
Power:4.9.2 Version 4.9.7 in production
Premier:4.9.2 Version 4.9.7 in production
Janitor:4.9
Site URL:https://www.amputee-coalition.org
This Info Cached:1518395097
Network Active:No
WordPress Version:4.9.3
PHP Version:5.4.45
MySQL Version:5.5.59
PHP Limit:3000M
WordPress General Limit:40M
WordPress Admin Limit:3000M
PHP Peak RAM:132 MB
PHP Post Max Size:2000M
February 12, 2018 at 10:21 AM #56049CiciKeymasterYou are showing the list from the Word press panels not the plugin environment.
As shown there are updates to the Add-ons. Since you are running SLP version 4.9.7 you should also update the Power and Experience add-ons to 4.9.7.
The shortcodes available are shown here and there is an order by store but I do not see the order by =sl_store=”__”
https://docs.storelocatorplus.com/blog/slplus-shortcode-options/I am not sure of your actual question:
Instead of using multiple shortcodes on your page is there a reason why you are just not using the settingss? What is it that you are trying to obtain? An alphabetical order or a category order or a name order?Are you using Pages and is that part of your Page template??
Also note you have an error . Using any browser tool you can inspect your page and see the error here.
JQMIGRATE: Migrate is installed, version 1.4.1
cse.google.com/cse/cse.js?cx= Failed to load resource: the server responded with a status of 404 ()February 12, 2018 at 10:33 AM #56050CiciKeymasterYou need to go to settings under Search, there is a setting under radius behavior. Select either Do not use or only use when entered.
February 13, 2018 at 10:24 AM #56067DebbieParticipantI am trying to achieve alphabetical order. The reason I am doing it with shortcodes is because we use the maps on other pages that utilize the radius search. I need a simple dynamic text listing on this page in alphabetical order.
The plugins you noted says “Version 4.9.7 in production” and it doesn’t show an option to update. I am certain that SLP offered an update to 4.9.7 or I wouldn’t have updated to that version. Am I supposed to manually update these plugins or should I wait until all version numbers match before updating in the future?
Under settings it is already set to “Use only when address is entered” but this doesn’t seem to work, even on our other map pages. It always uses radius to search, display and order the results, even if no address is given.
If you look at the shortcodes link you sent, you will find “order_by” but the name of the field shows “store” and it says it must match the database. I tried “sl_store” and “store” and neither worked – it always sorts by radius.
The error you noted is related to our Google Custom Search and should not impact SLP.
- This reply was modified 6 years, 10 months ago by Debbie.
February 13, 2018 at 10:55 AM #56069CiciKeymasterIf you deactivate the add-ons you should then see an update now and it will update to latest vrsion, if that does not work, yes you can up date manually.
As far as the multiple shortcodes being utilized The list of short codes available on the docs site and the results layout will impact the results.
You may need to select a different SLP plugin style. Check your results layout under Settings/results.
Do you want immediately show locations to show on all of the pages where you are using SLP or just the one page?
February 13, 2018 at 10:55 AM #56070CiciKeymasterIf you deactivate the add-ons you should then see an update now and it will update to latest vrsion, if that does not work, yes you can up date manually.
As far as the multiple shortcodes being utilized The list of short codes available on the docs site and the results layout will impact the results.
You may need to select a different SLP plugin style. Check your results layout under Settings/results.
Do you want immediately show locations to show on all of the pages where you are using SLP or just the one page?
February 13, 2018 at 11:12 AM #56072DebbieParticipantI will try deactivating to update. Thanks.
I will investigate the results layout to see if that is part of the issue. We have been using SLP for a long time and may have older styles that need to be updated, but I am afraid I might lose some things if I do, so I will test it in a staging site. The weird thing is, I think it was working fine a month ago, but this time when I updated our locations I noticed it wasn’t sorted alphabetically. Maybe it is just an update needed.
I only want to immediately show all locations on this one page. The other maps only display locations after the user searches.
Thanks for your support!
February 13, 2018 at 11:50 AM #56076CiciKeymasterNo Problem,
I do know there were some things changed in last WP update. It could have effected themes and plugins rendering styles. Let us know if this doesn’t work and I will have the developer address.
February 14, 2018 at 11:33 AM #56084Lance ClevelandKeymasterDebbie –
The order_by clause it not being sent along to the data query processor when set via the shortcode. It appears to only be processing the order set on the main settings page.
This is something I’ve added to the development task list for a future update. Not likely in SLP 4.9.8 as this is already in testing but a later release. No ETA yet.
Thanks for reporting this.
– Lance
-
AuthorPosts
- You must be logged in to reply to this topic.