Version 1.6.0 of Cardinal Store Locator has been released, which includes a major new WooCommerce integration feature, a complete overhaul of the functionality when the “Over 1,000 Locations” setting is enabled, along with several other fixes and enhancements.
It makes a lot of sense to integrate a store locator plugin with an e-commerce solution and because WooCommerce has a strong market share and backing of Automattic, it made the most sense to start there. Additional e-commerce platforms may be considered in the future – if you have a request for one please send an email to firstname.lastname@example.org and it will be taken into consideration. WooCommerce products can now be connected to Cardinal locations, locator locations can be filtered by product categories and products themselves, a locator added to a single product post will automatically display locations that are connected to the product, and so on. Please see WooCommerce integration details to review all the related information on this new feature.
“Over 1,000 Locations” rewrite and setting rename
Cardinal has included a setting under the Primary Settings tab named Over 1,000 Locations and that setting has been renamed to High location count. It’s a manual setting because it hasn’t been quite as performant as the default functionality but there are a number of factors at play. Also, the 1,000 number is somewhat arbitrary. For example, it may be more performant to use this setting with 800 locations if there is a lot of extra custom meta data added to the location posts. There are a number of other items to consider as well including web host package and performance, etc.
Behind the scenes the previous functionality performed a traditional admin-ajax.php request and a back-end WP_Query was made to return the most relevant locations to the query. These requests weren’t cached, WordPress was bootstrapped in the request, and the performance was mediocre. It’s been tempting to switch this functionality to use the newer REST API but in testing, the performance difference wasn’t worth it and in some cases was even worse. After a lot of searching and testing it finally made sense to swap the functionality to use the Rewrite API. There are large performance benefits with this update if object caching, such as Redis or Memcached, is enabled on the server.
Filtering display updates
A smaller but notable feature is an update to the locator filters. With the default “inclusive” filtering enabled and a locator filter activated, filter options previously always displayed as active even if there were no locations remaining that support the filter value. In v1.6.0 this has been updated so that the filter values without supporting locations become deactivated as pictured below. It didn’t make sense to keep them activated since selecting them just returns no results. In the example below, when “Margaritas” is checked the remaining locations do not support the “Fresh Guacamole” value and the only remaining city available is Minneapolis.
- Added coordinate range check to exclude locations with invalid latitude and longitude values.
- Added country as a default option under Filter Settings and output support via shortcode.
- Added functionality to disable input and option fields that don’t have matching values in the current location set after filtering when inclusive filtering is used (default).
- Added map marker accessibility.
- Changed default submit button label from Submit to Search.
- Complete rewrite of Over 1,000 locations/High location count functionality now with object caching.
- Deprecated “Bounce marker” setting due to Google Charts API deprecation and poor animation results with Google marker labels.
- Fixed color contrast issue with default public styling.
- Fixed deprecated google.maps.event.addDomListener warnings.
- Fixed filter label output in shortcode output and changed h3 tags to label tags.
- Fixed location set length scenario when full map start is enabled, taxonomy filters are reset, and name search and origin are empty.
- Fixed marker letter labels not working with previous Charts API technique. Swapped to google.maps.Marker label parameter.
- Fixed potentially undefined bhStoreLocatorMapStyles error in single map block.
- Fixed “select( ‘core/edit-post’ ).getPreference is deprecated” admin console warnings.
- Renamed “Over 1,000 locations” setting to “High location count” under Primary Settings.
- Swapped out admin-ajax functionality for Rewrite API with “Over 1,000 locations/High location count” setting enabled for improved performance.