开发者 |
gellum
venywest |
---|---|
更新时间 | 2025年6月1日 15:34 |
捐献地址: | 去捐款 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.8 |
版权: | GPL v2 or later |
版权网址: | 版权信息 |
[gellumdcw_map]
shortcode.[gellumdcw_map]
shortcode where you want the interactive map to appear.You need to create a project in the Google Cloud Console, generate an API key, and enable the "Maps JavaScript API" and "Geocoding API" for that key. Remember to restrict your key for security (e.g., by HTTP referrers).
Use a free online tool like geojson.io. Use the drawing tools (Polygon) to outline your delivery area on the map. Copy the generated GeoJSON code from the right-hand panel and paste it into the plugin settings. Ensure it's a valid GeoJSON FeatureCollection
or Polygon
/MultiPolygon
.
The plugin uses standard WooCommerce hooks and AJAX calls. It's designed to be compatible with most themes. The [gellumdcw_map]
shortcode allows you to place the map flexibly. Some highly customized checkouts might require minor CSS adjustments.
Currently, the JavaScript focuses on updating the billing address fields. If your checkout uses separate shipping fields, you might need to adjust the gellumdcw-frontend.js
or implement a filter if you need both updated automatically.
Yes, there are a couple of ways to customize the map's appearance:
gellumdcw-frontend.css
provides basic styling for the map container and related elements. You can override these CSS styles in your theme's style.css
file or via the WordPress Customizer's "Additional CSS" section for a more integrated look with your site. This primarily affects the elements around the map (like the info text, error messages).self.map.data.setStyle({…})
section within the drawDeliveryArea
function in the assets/js/gellumdcw-frontend.js
file.Gellum Delivery Calculator is designed to be fully compatible with WordPress Multisite installations. To configure: Simply activate the plugin on each subsite where you intend to offer Gellum Delivery, and then set up its specific settings within the WooCommerce Shipping Zone configuration for that particular subsite.
readonly
when Gellum Delivery is selected.google.maps.marker.AdvancedMarkerElement
when a Google Maps Map ID is provided, addressing deprecation warnings for google.maps.Marker
.google.maps.Marker
if no Map ID is configured, ensuring the map remains functional even without advanced marker features. This includes conditionally loading the marker
library.fillOpacity
.async
and defer
attributes for the Google Maps API script tag via a WordPress filter, addressing performance warnings and improving page load behavior.is_available
logic to be more permissive, relying primarily on calculate_shipping
(based on session data) to add/remove the rate dynamically.[gdc_map]
shortcode.