I've implemented a means of only loading maps if users give consent (following 'Approach 2' provided here https://toolset.com/forums/topic/toolset-maps-and-gdpr-cookie-consent-plugin-seems-to-conflict/#post-1326825).
I'm now looking to implement the method for the 'Use My Location' button in distance searches but the View doesn't show any code I can wrap inside the wpv-conditional shortcode. How do I achieve this please?
Hello,
The "Use my location" button is outputted from shortcode [wpv-control-distance], so you just need to use that shortcode [wpv-conditional] to wrap the shortcode [wpv-control-distance], for example:
[wpv-conditional if="( '[ts-generic-get-cookie-value]' eq 'yes' )"]
[wpv-control-distance compare_field="test-addr" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit"]
[/wpv-conditional]
Hi Luo
If I do that, it takes out the 'compare_field' too rendering it impossible to search by distance altogether. I just want to remove the use My Location button but still allow Users to search with X miles of a town that they enter.
There isn't such kind of built-in feature within Toolset plugins, since the "Use my location" button is integrated into shortcode [wpv-control-distance], there isn't such a independent shortcode for "Use my location" button, so you will need to use [wpv-conditional] shortcode to wrap the entire [wpv-control-distance] shortcode.
Even if you use CSS codes to hide the "Use my location" button, it will load Google JS file in client browser too, it will break GDPR policy too.
If I wrap the entire View in the [wpv-conditional] shortcode, will that stop Google's JS file from loading in the user's browser?
It should be able to prevent Google's JS file from loading, this is Beda's custom codes solution:
https://toolset.com/forums/topic/toolset-maps-and-gdpr-cookie-consent-plugin-seems-to-conflict/#post-1326825
If it still can not prevent Google's JS file from loading, then that still violate GDPR policy.
You can test it, check if it works.
My issue is resolved now. Thank you!