Skip Navigation

[Resolved] Display a map on a WooCommerce product, showing the product's location.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2623729
Captura de pantalla 2023-07-13 a las 18.13.17.png
Captura de pantalla 2023-07-13 a las 18.14.36.png

I have installed WooCommerce, and I have created a custom field called "City" using Toolset. This custom field is of the "Address" type and is placed within a group called "Vehicle location". I input the product's location in the custom field. I want to display a map with the product's location on the frontend of the product. I am working with DIVI.

#2623979

Hi,

Thank you for contacting us and I'd be happy to assist.

In your Divi template for the product post, you can include the 'wpv-map-render' shortcode generate a map:
( ref: https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-render )


[wpv-map-render map_id="map-1"][/wpv-map-render]

And to draw a map marker on this map from the 'city' address field, you can include the shortcode 'wpv-map-marker':
( ref: https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker )


[wpv-map-marker map_id='map-1' marker_id='marker-1' marker_field='wpcf-city'][/wpv-map-marker]

I hope this helps and please let me know if you need further assistance.

regards,
Waqar