PluginProbe
MakeCommerce for WooCommerce / 4.0.1
MakeCommerce for WooCommerce v4.0.1
4.1.0 4.0.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 All 96 releases
makecommerce / shipping / method / parcelmachine / map.php

map.php in MakeCommerce for WooCommerce 4.0.1, at shipping/method/parcelmachine/map.php

48 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MakeCommerce\Shipping\Method\ParcelMachine;
4
5 /**
6 * Google maps functionality for parcel machines
7 *
8 * @since 3.3.0
9 */
10
11 trait Map {
12
13 /**
14 * Initializes the map
15 *
16 * @since 3.3.0
17 */
18 public static function initialize_map( $vars ) {
19
20 $vars['path'] = plugin_dir_url(__FILE__) . '/images';
21
22 \MakeCommerce::mc_enqueue_script( 'MC_PARCELMACHINE_MAP_JS', dirname(__FILE__) . '/js/parcelmachinemap.js', $vars, [ 'jquery' ] );
23
24 wp_enqueue_style( "mc_parcelmachinemap", plugin_dir_url(__FILE__) . 'css/parcelmachinemap.css', array(), MAKECOMMERCE_VERSION );
25 }
26
27 /**
28 * Checks if map is enabled in admin settings
29 *
30 * @since 3.3.0
31 */
32 public static function map_enabled() {
33
34 return !empty( get_option( 'mc_google_api_key', '' ) )
35 && get_option( 'mc_parcel_machine_map', '' ) === 'yes';
36 }
37
38 /**
39 * Checks if secret key is enabled in admin settings
40 *
41 * @since 3.3.0
42 */
43 public static function geocoding_enabled() {
44 return !empty( get_option( 'mc_map_geocoding_api_key', '' ) )
45 && get_option( 'mc_map_geocoding', '' ) === 'yes';
46 }
47 }
48