diff --git a/.gitignore b/.gitignore index 2822936..5c6def0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ todo.txt vendor .DS_Store dist -artifact +artifact-kikote lpac.zip logs .vscode diff --git a/admin-pointers.php b/admin-pointers.php index a9b80af..ef52570 100644 --- a/admin-pointers.php +++ b/admin-pointers.php @@ -21,29 +21,11 @@ function create_onboarding_pointers( $pointers, $prefix ) { $pointers_list = array_merge( $pointers, - array( - $prefix . '_woocommerce_settings' => array( - 'selector' => '#toplevel_page_woocommerce', - 'title' => __( 'Thanks for Installing LPAC!', 'map-location-picker-at-checkout-for-woocommerce' ), - 'text' => sprintf( __( 'Lets point you to the plugin settings page. Start by going to %1$sWooCommerce->Settings%2$s.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '', '
' ), - 'icon_class' => 'dashicons-plugins-checked', - 'width' => 350, - ), - ), - array( - $prefix . '_lpac_tab' => array( - 'selector' => '.woo-nav-tab-wrapper', - 'title' => __( 'Plugin Settings Tab', 'map-location-picker-at-checkout-for-woocommerce' ), - 'text' => sprintf( __( 'Click on %1$sLocation Picker at Checkout%2$s to access the plugin settings.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '', '
' ), - 'icon_class' => 'dashicons-admin-generic', - 'width' => 250, - ), - ), array( $prefix . '_lpac_submenu' => array( 'selector' => '#lpac-submenu', 'title' => __( 'Plugin Settings Menus', 'map-location-picker-at-checkout-for-woocommerce' ), - 'text' => sprintf( __( 'These are the different setting menus for the plugin. You can check them out %1$slater%2$s, to first get started with LPAC, you need to enter a %1$sGoogle Maps API Key%2$s on this %1$sGeneral Settings%2$s page.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '', '
' ), + 'text' => sprintf( __( 'These are the different setting menus for the plugin. You can check them out %1$slater%2$s, to first get started with Kikote, you need to enter a %1$sGoogle Maps API Key%2$s on this %1$sGeneral Settings%2$s page.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '', '
' ), 'icon_class' => 'dashicons-menu-alt3', 'width' => 350, 'next' => $prefix . '_google_maps_api_key', @@ -69,7 +51,7 @@ function create_onboarding_pointers( $pointers, $prefix ) { $prefix . '_google_maps_api_key' => array( 'selector' => '#lpac_google_maps_api_key', 'title' => __( 'Enter Your API Key', 'map-location-picker-at-checkout-for-woocommerce' ), - 'text' => sprintf( __( "The documentation for acquiring your Google Maps API Key can be found %1\$sHERE%2\$s. Once you've entered and saved your API Key; feel free to fine-tune LPAC's settings.%3\$s%3\$s %4\$sNOTE:%5\$s The plugin will NOT work without an API key.", 'map-location-picker-at-checkout-for-woocommerce' ), '', '', '
', '', '' ), + 'text' => sprintf( __( "The documentation for acquiring your Google Maps API Key can be found %1\$sHERE%2\$s. Once you've entered and saved your API Key; feel free to fine-tune Kikote's settings.%3\$s%3\$s %4\$sNOTE:%5\$s The plugin will NOT work without an API key.", 'map-location-picker-at-checkout-for-woocommerce' ), '', '', '
', '', '' ), 'icon_class' => 'dashicons-post-status', 'width' => 400, 'jsnext' => "button = jQuery('" . __( 'Finish' ) . "'); diff --git a/assets/admin/css/notices.css b/assets/admin/css/notices.css index ff16456..88ff1cc 100644 --- a/assets/admin/css/notices.css +++ b/assets/admin/css/notices.css @@ -5,9 +5,7 @@ .lpac-admin-notice { background: #fff; - border: 1px solid #fca503; - border-left-width: 4px; - box-shadow: 0 1px 1px rgb(0 0 0 / 4%); + box-shadow: 0 10px 10px rgb(0 0 0 / 4%); display: block; margin-bottom: 20px; margin-top: 30px; @@ -21,14 +19,13 @@ content: ""; display: block; background-image: url("../../img/logo.png"); - background-size: 110px 110px; - background-repeat: no-repeat; - background-position: 0 45%; + background-size: contain; + background-position: 0 50%; width: 130px; position: absolute; top: 0; bottom: 0; - left: 5px; + left: 0; } .lpac-notice-title { @@ -38,9 +35,8 @@ } .lpac-notice-body { - font-size: 14px; - font-weight: 500; - margin: 10px 0 30px 0; + font-size: 16px; + font-weight: 400; } li#lpac-notice-cta a { @@ -74,3 +70,9 @@ li#lpac-notice-dismiss a { margin-top: 25px; } } + +@media screen and (max-width: 782px) { + .lpac-notice-logo { + background-repeat: no-repeat; + } +} diff --git a/assets/admin/img/delivery-and-pickup-scheduling-rtl.png b/assets/admin/img/delivery-and-pickup-scheduling-rtl.png new file mode 100644 index 0000000..3ff80ec Binary files /dev/null and b/assets/admin/img/delivery-and-pickup-scheduling-rtl.png differ diff --git a/assets/admin/img/delivery-and-pickup-scheduling.png b/assets/admin/img/delivery-and-pickup-scheduling.png index 4d589e6..de398f1 100644 Binary files a/assets/admin/img/delivery-and-pickup-scheduling.png and b/assets/admin/img/delivery-and-pickup-scheduling.png differ diff --git a/assets/admin/js/lpac-admin.js b/assets/admin/js/lpac-admin.js index 8826bfd..3528aec 100644 --- a/assets/admin/js/lpac-admin.js +++ b/assets/admin/js/lpac-admin.js @@ -149,12 +149,18 @@ "select[name^=lpac_places_autocomplete_country_restrictions]" ); const placesAutoCompleteType = $("#lpac_places_autocomplete_type"); + const placesAutoCompleteSearchbox = $( + "#lpac_places_autocomplete_searchbox_in_map" + ); + const placesAutoCompleteForced = $("#lpac_force_places_autocomplete"); if (!placesAutoCompleteChecked) { placesAllowedFields.closest("tr").hide(); placesAutoCompleteHideMap.closest("tr").hide(); placesAutoCompleteCountryRestrictions.closest("tr").hide(); placesAutoCompleteType.closest("tr").hide(); + placesAutoCompleteSearchbox.closest("tr").hide(); + placesAutoCompleteForced.closest("tr").hide(); } placesAutoComplete.on("click", () => { @@ -163,11 +169,15 @@ placesAutoCompleteHideMap.closest("tr").show(); placesAutoCompleteCountryRestrictions.closest("tr").show(); placesAutoCompleteType.closest("tr").show(); + placesAutoCompleteSearchbox.closest("tr").show(); + placesAutoCompleteForced.closest("tr").show(); } else { placesAllowedFields.closest("tr").hide(); placesAutoCompleteHideMap.closest("tr").hide(); placesAutoCompleteCountryRestrictions.closest("tr").hide(); placesAutoCompleteType.closest("tr").hide(); + placesAutoCompleteSearchbox.closest("tr").hide(); + placesAutoCompleteForced.closest("tr").hide(); } }); } diff --git a/assets/img/logo.png b/assets/img/logo.png index 8d0d08e..49c4780 100644 Binary files a/assets/img/logo.png and b/assets/img/logo.png differ diff --git a/assets/js-modules/set-map.js b/assets/js-modules/set-map.js index 6332b8e..ec018e6 100644 --- a/assets/js-modules/set-map.js +++ b/assets/js-modules/set-map.js @@ -51,13 +51,14 @@ export function getNavigatorCoordinates() { /** * Bootstrap the functionality of the map. * - * @param mapOptions the Map options + * @param mapData the data for manipulating the map. * @returns latLng The latitude and longitude. * @since 1.7.0 */ -export async function bootstrapMapFunctionality(mapOptions) { +export async function bootstrapMapFunctionality(mapData) { const position = await getNavigatorCoordinates(); let latLng = ""; + if (position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; @@ -65,12 +66,22 @@ export async function bootstrapMapFunctionality(mapOptions) { console.log( "Location Picker At Checkout Plugin: Position object is empty. Navigator might be disabled or this site might be detected as insecure." ); - var latitude = mapOptions.lpac_map_default_latitude; - var longitude = mapOptions.lpac_map_default_longitude; + + const currentZoom = mapData.map.getZoom(); + if (currentZoom < 13) { + mapData.map.setZoom(13); + } + + // Make sure a user is able to select their location on the map when they have blocked access to their location. + listenToMapClicks(mapData); + listenToMapDrag(mapData); /** * We're setting this to '' so that we can force the user to make use of the map if the option is enabled. * So that if we do not receive a location, the user can enter one manually. + * + * Note that doing this means we have to be sure to add the event listeners for drag and click to the map when + * */ return (latLng = { lat: "", @@ -94,7 +105,7 @@ export async function bootstrapMapFunctionality(mapOptions) { * @param {object} mapData */ export async function bootstrapMapFunctionalityJQuery(mapData) { - const latLng = await bootstrapMapFunctionality(); + const latLng = await bootstrapMapFunctionality(mapData); if (latLng.lat !== "" && latLng.lng !== "") { const map = mapData.map; diff --git a/assets/public/js/maps/base-map.js b/assets/public/js/maps/base-map.js index a71a706..b1ded40 100644 --- a/assets/public/js/maps/base-map.js +++ b/assets/public/js/maps/base-map.js @@ -51,6 +51,16 @@ if ( clickableIcons: mapOptions.lpac_map_clickable_icons, backgroundColor: mapOptions.lpac_map_background_color, //loading background color mapId: google_map_id, + // If the option is in the array then that means we want to hide it. So we need to negate the outcome to get the correct behaviour. + mapTypeControl: mapOptions.disabled_map_controls + ? !mapOptions.disabled_map_controls.includes("maptype") + : true, + zoomControl: mapOptions.disabled_map_controls + ? !mapOptions.disabled_map_controls.includes("zoom") + : true, + fullscreenControl: mapOptions.disabled_map_controls + ? !mapOptions.disabled_map_controls.includes("fullscreen") + : true, }; /** diff --git a/assets/public/js/maps/checkout-page-map.js b/assets/public/js/maps/checkout-page-map.js index 90b5fd6..430e186 100644 --- a/assets/public/js/maps/checkout-page-map.js +++ b/assets/public/js/maps/checkout-page-map.js @@ -28,21 +28,21 @@ const find_location_btn = document.querySelector("#lpac-find-location-btn"); const places_autocomplete_used = document.querySelector( "#lpac_places_autocomplete" ); - if (typeof find_location_btn !== "undefined" && find_location_btn !== null) { find_location_btn.addEventListener("click", async () => { - const latLng = await bootstrapMapFunctionality(mapOptions); + let mapData = { + map, + mapOptions, + marker, + infowindow, + }; + + const latLng = await bootstrapMapFunctionality(mapData); if (latLng.lat !== "" && latLng.lng !== "") { const geocodeResults = await geocodeCoordinates(latLng, map); - const mapData = { - map, - mapOptions, - marker, - latLng, - infowindow, - geocodeResults, - }; + mapData["latLng"] = latLng; + mapData["geocodeResults"] = geocodeResults; setupMap(mapData); fillAllAddressFields(geocodeResults); } diff --git a/bin/freemius-prep.sh b/bin/freemius-prep.sh index 4069e4c..4b7bc42 100644 --- a/bin/freemius-prep.sh +++ b/bin/freemius-prep.sh @@ -4,12 +4,11 @@ # Start fresh rm -rf dist -rm -rf artifact -rm lpac.zip +rm -rf artifact-kikote # Make our directories mkdir -p dist -mkdir -p artifact +mkdir -p artifact-kikote # Remove vendor folder so we can redownload without dev dependencies. rm -rf vendor @@ -32,7 +31,7 @@ npm run build rsync -acvP --delete --exclude-from=".distignore" ./ "./dist" #Change to our dist folder and zip to artifact folder -(cd dist && zip -r ../artifact/lpac.zip .) +(cd dist && zip -r ../artifact-kikote/map-location-picker-at-checkout-for-woocommerce.zip .) # Delete dist folder rm -rf dist diff --git a/bin/github-lite-prep.sh b/bin/github-lite-prep.sh index 02ac37c..fdb2192 100644 --- a/bin/github-lite-prep.sh +++ b/bin/github-lite-prep.sh @@ -4,12 +4,12 @@ # Start fresh rm -rf dist -rm -rf artifact +rm -rf artifact-kikote rm lpac.zip # Make our directories mkdir -p dist -mkdir -p artifact +mkdir -p artifact-kikote # Remove dev dependencies composer install --no-dev @@ -26,7 +26,7 @@ npm run format rsync -acvP --delete --exclude-from=".distignore-github-lite" ./ "./dist" #Change to our dist folder and zip to artifact folder -(cd dist && zip -r ../artifact/lpac.zip .) +(cd dist && zip -r ../artifact-kikote/lpac.zip .) # Delete dist folder rm -rf dist diff --git a/class-lpac-uninstall.php b/class-lpac-uninstall.php index 751bb53..9b81b6c 100644 --- a/class-lpac-uninstall.php +++ b/class-lpac-uninstall.php @@ -80,6 +80,7 @@ public static function remove_plugin_settings() { 'lpac_view_order_page_map_id', 'lpac_checkout_page_map_id', 'lpac_checkout_page_map_default_view', + 'kikote_disabled_map_controls', // Store Locations 'lpac_store_locations_cords', 'lpac_store_locations_labels', diff --git a/includes/Bootstrap/Frontend_Enqueues.php b/includes/Bootstrap/Frontend_Enqueues.php index b5050a4..bb659c4 100644 --- a/includes/Bootstrap/Frontend_Enqueues.php +++ b/includes/Bootstrap/Frontend_Enqueues.php @@ -95,8 +95,8 @@ public function enqueue_scripts() // ------------- // Output plugin version to console // ------------- - $plugin_type = ( defined( 'LPAC_PLUGIN_PATH_URL_PRO' ) ? 'PRO' : 'Free' ); - wp_add_inline_script( $this->plugin_name, "\n\t\t\tconsole.log('Location Picker at Checkout version {$plugin_type}: {$this->version}');\n\t\t\t" ); + $plugin_type = ( LPAC_IS_PREMIUM_VERSION ? 'PRO' : 'Free' ); + wp_add_inline_script( $this->plugin_name, "\n\t\t\tconsole.log('Kikote - Location Picker at Checkout for WooCommerce {$plugin_type}: v{$this->version}');\n\t\t\t" ); // -------------- // -------------- /** diff --git a/includes/Bootstrap/Loader.php b/includes/Bootstrap/Loader.php index dc77bfc..8f987d0 100644 --- a/includes/Bootstrap/Loader.php +++ b/includes/Bootstrap/Loader.php @@ -27,7 +27,6 @@ class Loader { * The array of actions registered with WordPress. * * @since 1.0.0 - * @access protected * @var array $actions The actions registered with WordPress to fire when the plugin loads. */ protected $actions; @@ -36,7 +35,6 @@ class Loader { * The array of filters registered with WordPress. * * @since 1.0.0 - * @access protected * @var array $filters The filters registered with WordPress to fire when the plugin loads. */ protected $filters; diff --git a/includes/Bootstrap/Main.php b/includes/Bootstrap/Main.php index ff335bc..97ae4b7 100644 --- a/includes/Bootstrap/Main.php +++ b/includes/Bootstrap/Main.php @@ -297,9 +297,13 @@ private function define_public_hooks() /* * Output map on checkout page */ - $checkout_page_map_location = get_option( 'lpac_checkout_map_orientation', 'woocommerce_before_checkout_billing_form' ); - $checkout_page_map_location = apply_filters( 'lpac_checkout_map_orientation', $checkout_page_map_location ); - $this->loader->add_action( $checkout_page_map_location, $plugin_public_display, 'output_map_on_checkout_page' ); + add_action( 'plugins_loaded', function () { + $checkout_page_map_location = get_option( 'lpac_checkout_map_orientation', 'woocommerce_checkout_before_customer_details' ); + $checkout_page_map_location = apply_filters( 'lpac_checkout_map_orientation', $checkout_page_map_location ); + $class = new \Lpac\Views\Frontend\Frontend(); + $priority = apply_filters( 'kikote_checkout_map_orientation_filter_priority', 9 ); + add_action( $checkout_page_map_location, array( $class, 'output_map_on_checkout_page' ), $priority ); + } ); /* * Translated alert strings for checkout page. */ @@ -502,7 +506,7 @@ public function create_admin_menu() : void add_menu_page( __( 'SoaringLeads Plugins', 'map-location-picker-at-checkout-for-woocommerce' ), - 'SL Plugins', + 'SoaringLeads', 'manage_options', 'sl-plugins-menu', array( $this, 'output_root_submenu_upsells' ), @@ -521,8 +525,8 @@ public function create_submenu() : void { add_submenu_page( 'sl-plugins-menu', - 'Kikote- Location Picker at Checkout', - 'Kikote- Location Picker at Checkout', + 'Kikote - Location Picker at Checkout', + 'Kikote - Location Picker at Checkout', 'manage_options', 'lpac-menu', array( $this, 'menu_item_html' ), @@ -544,7 +548,7 @@ public function menu_item_html() } /** - * HTML for root SL Plugins page. + * HTML for root SoaringLeads page. * * Populate with upsell content. * diff --git a/includes/Compatibility/Caching/Siteground_Optimizer.php b/includes/Compatibility/Caching/Siteground_Optimizer.php index e465759..5ca3702 100644 --- a/includes/Compatibility/Caching/Siteground_Optimizer.php +++ b/includes/Compatibility/Caching/Siteground_Optimizer.php @@ -2,13 +2,12 @@ /** * Class responsible for adding compatibility with Siteground Optimizer. * - * https://wordpress.org/plugins/sg-cachepress/ - * * Author: Uriahs Victor * Created on: 01/02/2023 (d/m/y) * - * @link https://uriahsvictor.com - * @since 1.6.14 + * @link https://uriahsvictor.com + * @link https://wordpress.org/plugins/sg-cachepress/ + * @since 1.6.14 * @package Compatibility */ @@ -31,7 +30,7 @@ class Siteground_Optimizer { * * Setting the link as defer causes it to load(execute) when the page is done downloading, it should actually be executed immediately. * - * @param array $exclude_list + * @param array $exclude_list The list of handles to exclude. * @return array * @since 1.6.14 */ @@ -45,7 +44,7 @@ public function remove_defer_on_gmaps_script( array $exclude_list ) : array { * * They are already minified. * - * @param array $exclude_list + * @param array $exclude_list The list of handles to exclude. * @return array * @since 1.6.14 */ @@ -59,7 +58,7 @@ public function js_minify_exclude( array $exclude_list ) : array { /** * Exclude inline scripts from being combined. * - * @param array $exclude_list + * @param array $exclude_list The list of handles to exclude. * @return array * @since 1.6.14 */ @@ -72,7 +71,7 @@ public function js_combine_exclude_inline_script( array $exclude_list ) : array /** * Exclude scripts from being combined. * - * @param array $exclude_list + * @param array $exclude_list The list of handles to exclude. * @return array * @since 1.6.14 */ diff --git a/includes/Compatibility/Checkout_Provider.php b/includes/Compatibility/Checkout_Provider.php index c1db488..5cfa3bb 100644 --- a/includes/Compatibility/Checkout_Provider.php +++ b/includes/Compatibility/Checkout_Provider.php @@ -9,6 +9,7 @@ * @since 1.5.4 * @package Lpac */ + namespace Lpac\Compatibility; if ( ! defined( 'WPINC' ) ) { @@ -30,13 +31,16 @@ public function get_checkout_provider() { $provider = 'wc'; if ( class_exists( 'WFFN_Core', false ) || class_exists( 'WFACP_core', false ) ) { - // We need a better way to know when the checkout is actually overridden. - // $settings = get_option( '_wfacp_global_settings', array() ); - // $enable_custom_checkout = $settings['override_checkout_page_id'] ?? ''; - // When the option is turned on it sets the custom checkout ID, when it's not it sets it to 0 - // if ( ! empty( $enable_custom_checkout ) ) { - // $provider = 'funnelkit'; - // } + /** + * We need a better way to know when the checkout is actually overridden. + * $settings = get_option( '_wfacp_global_settings', array() ); + * $enable_custom_checkout = $settings['override_checkout_page_id'] ?? ''; + + * When the option is turned on it sets the custom checkout ID, when it's not it sets it to 0 + * if ( ! empty( $enable_custom_checkout ) ) { + * $provider = 'funnelkit'; + * } + */ $provider = 'funnelkit'; } diff --git a/includes/Compatibility/FunnelKit/FunnelKit.php b/includes/Compatibility/FunnelKit/FunnelKit.php index 9fcafeb..290529d 100644 --- a/includes/Compatibility/FunnelKit/FunnelKit.php +++ b/includes/Compatibility/FunnelKit/FunnelKit.php @@ -12,10 +12,11 @@ * @since 1.3.3 * @package Lpac */ + namespace Lpac\Compatibility\FunnelKit; if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly + exit; // Exit if accessed directly. } /** diff --git a/includes/Controllers/Checkout_Page/Controller.php b/includes/Controllers/Checkout_Page/Controller.php index a102f64..00adf95 100644 --- a/includes/Controllers/Checkout_Page/Controller.php +++ b/includes/Controllers/Checkout_Page/Controller.php @@ -52,10 +52,10 @@ public function get_map_options() { 'lpac_past_order_page_default_map_type' => $options['lpac_past_order_page_default_map_type'], 'lpac_admin_order_screen_default_map_type' => $options['lpac_admin_order_screen_default_map_type'], 'dissect_customer_address' => $options['dissect_customer_address'] === 'yes' ? true : false, + 'disabled_map_controls' => $options['disabled_map_controls'], ); return apply_filters( 'lpac_map_stored_public_settings', $data ); - } /** diff --git a/includes/Controllers/Emails_Controller.php b/includes/Controllers/Emails_Controller.php index 493311b..4705c22 100644 --- a/includes/Controllers/Emails_Controller.php +++ b/includes/Controllers/Emails_Controller.php @@ -95,10 +95,9 @@ private function create_delivery_location_link_button( $link ) { $a_styles = "background: $base_color; border-radius: 20px; color: $text_color; display: block; margin: 0 auto; padding: 10px; text-decoration: none; width: 150px;"; $a_styles = apply_filters( 'lpac_email_btn_a_styles', $a_styles ); - $button = <<$button_text

-HTML; - echo $button; + ?> +

+ get_resource_url( $folder_name, $order_id ); $delivery_location_text = __( 'Delivery Location', 'map-location-picker-at-checkout-for-woocommerce' ); $delivery_location_text = apply_filters( 'lpac_email_map_location_link_button_text', $delivery_location_text ); - - echo "
- -

{$delivery_location_text}

+ ?> +
+ +

"; - + "; - echo $image; - + ?> + +

- $label:

- - $store_origin_name
- $address
-
-



"; - echo $markup; + ?> +
+

+ : +
+
+ + +
+ +
+
+

+
+
+ $latitude, 'longitude' => $longitude, @@ -278,6 +280,7 @@ public static function set_map_options() { 'lpac_past_order_page_default_map_type' => $past_order_page_default_map_type, 'lpac_admin_order_screen_default_map_type' => $admin_order_screen_default_map_type, 'dissect_customer_address' => $dissect_customer_address, + 'disabled_map_controls' => $disabled_map_controls, ); return apply_filters( 'lpac_map_options', $options ); diff --git a/includes/Notices/Admin.php b/includes/Notices/Admin.php index 555c55c..8006145 100644 --- a/includes/Notices/Admin.php +++ b/includes/Notices/Admin.php @@ -14,30 +14,6 @@ class Admin { - /** - * Detect if WooCommerce is active. - * - * Plugin runs off WooCommerce so requires WooCommerce to be active. - * - * @since 1.1.0 - */ - public function lpac_wc_not_active_notice() { - - if ( ! class_exists( 'woocommerce' ) ) { - ?> - -
- HTML element 2: Opening HTML element 3: Closing HTML element 4: Closing

HTML element */ - echo sprintf( __( '%1$s%2$sLocation Picker at Checkout for WooCommerce(LPAC) NOTICE:%3$s WooCommerce is not activated, please activate it to use the plugin.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), '

', '', '', '

' ); - ?> -
- HTML element 2: Opening HTML element 3: Closing HTML element 4: Closing

HTML element */ - echo sprintf( __( '%1$s%2$sLocation Picker at Checkout for WooCommerce(LPAC) NOTICE:%3$s HTTPS not detected on this website. The plugin will not work. Please enable HTTPS on this website.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), '

', '', '', '

' ); - ?> -
- - -
- HTML element 2: Opening HTML element 3: Closing HTML element 4: Closing

HTML element */ - echo sprintf( __( '%1$s%2$sLocation Picker at Checkout for WooCommerce(LPAC) NOTICE:%3$s PHP version too low to use this plugin. Please change to at least PHP 7.4. You can contact your web host for assistance in updating your PHP version.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), '

', '', '', '

' ); + echo sprintf( esc_html__( '%1$s%2$sKikote - Location Picker at Checkout for WooCommerce NOTICE:%3$s HTTPS not detected on this website. The plugin will not work. Please enable HTTPS on this website.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), '

', '', '', '

' ); ?>
create_translators_needed_notice(); $this->create_saas_pilot_notice(); $this->create_dps_released_notice(); - $this->create_discord_server_notice(); + $this->create_ecommerce_community_notice(); + $this->createPrintusReleaseNotice(); } /** @@ -38,12 +39,12 @@ public function __construct() { * * @return void */ - public function create_translators_needed_notice() { + private function create_translators_needed_notice() { $days_since_installed = $this->get_days_since_installed(); - // Show notice after 4 weeks - if ( $days_since_installed < 30 ) { + // Show notice after 66 days + if ( $days_since_installed < 66 ) { return; } @@ -54,12 +55,12 @@ public function create_translators_needed_notice() { $content = array( 'title' => esc_html__( 'We Need Your Help', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🙏', - 'body' => esc_html__( 'Do you speak a language beside English? If so, then please help translate LPAC to your native language; this will help other users who know your native language, but speak little to no English, better navigate and set up the plugin. Plus, you will get a cool "Translation Contributor" badge on your WordPress.org profile', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', + 'body' => esc_html__( 'Do you speak a language beside English? If so, then please help translate Kikote to your native language; this will help other users who know your native language, but speak little to no English, better navigate and set up the plugin. Plus, you will get a cool "Translation Contributor" badge on your WordPress.org profile', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', 'cta' => esc_html__( 'I can help', 'map-location-picker-at-checkout-for-woocommerce' ), 'link' => esc_attr( 'https://translate.wordpress.org/projects/wp-plugins/map-location-picker-at-checkout-for-woocommerce/' ), ); - echo $this->create_notice_markup( 'help_translate_lpac', $content ); + $this->create_notice_markup( 'help_translate_lpac', $content ); } /** @@ -67,23 +68,23 @@ public function create_translators_needed_notice() { * * @return void */ - public function create_saas_pilot_notice() { + private function create_saas_pilot_notice() { $days_since_installed = $this->get_days_since_installed(); - // Show notice after 10 days - if ( $days_since_installed < 10 ) { + // Show notice after 30 days + if ( $days_since_installed < 30 ) { return; } $content = array( 'title' => esc_html__( 'Help Shape the Future', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 👀', - 'body' => sprintf( esc_html__( 'Want a more streamlined delivery/pickup workflow for you or your drivers? Signup for early access to the LPAC Web App pilot; quickly pull up orders and directions from one simplified dashboard. %1$1sLimited spots available%2$2s', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 👾', '', '' ), + 'body' => sprintf( esc_html__( 'Want a more streamlined delivery/pickup workflow for you or your drivers? Signup for early access to the Kikote Web App pilot; quickly pull up orders and directions from one simplified dashboard. %1$1sLimited spots available%2$2s', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 👾', '', '' ), 'cta' => esc_html__( 'Learn more', 'map-location-picker-at-checkout-for-woocommerce' ), 'link' => esc_attr( 'https://lpacwp.com/saas-pilot/' ), ); - echo $this->create_notice_markup( 'saas_pilot', $content ); + $this->create_notice_markup( 'saas_pilot', $content ); } /** @@ -91,22 +92,22 @@ public function create_saas_pilot_notice() { * * since 1.6.13 */ - public function create_dps_released_notice() { + private function create_dps_released_notice() { $days_since_installed = $this->get_days_since_installed(); - // Show notice after 5 days - if ( $days_since_installed < 5 ) { + // Show notice after 24 days + if ( $days_since_installed < 24 ) { return; } $content = array( 'title' => esc_html__( 'Say hello to Delivery & Pickup Scheduling for WooCommerce!', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', - 'body' => esc_html__( 'Hey! I\'ve just released a new plugin that helps you further optimize your store, by letting customers select the date and time they\'d like their Delivery or Pickup order. Give it a shot and let me know how it can be improved to better serve you!', 'map-location-picker-at-checkout-for-woocommerce' ), + 'body' => esc_html__( 'Hey! We have a new plugin that helps you further optimize your store— by letting customers select the date and time they\'d like their Delivery or Pickup order. Give it a shot and let me know how it can be improved to better serve you!', 'map-location-picker-at-checkout-for-woocommerce' ), 'link' => esc_attr( 'https://dpswp.com/' ), ); - echo $this->create_notice_markup( 'dps_released', $content ); + $this->create_notice_markup( 'dps_released', $content ); } /** @@ -115,16 +116,38 @@ public function create_dps_released_notice() { * @return void * @since 1.0.0 */ - public function create_discord_server_notice() { + private function create_ecommerce_community_notice() { + + $days_since_installed = $this->get_days_since_installed(); + + // Show notice after 3 days + if ( $days_since_installed < 3 ) { + return; + } $content = array( 'title' => esc_html__( 'Join our E-Commerce Support Discord Community', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', 'body' => sprintf( esc_html__( 'Meet E-commerce and chat with store owners like yourself from around the world and discuss on ways to help grow sales, plugin recommendations, tips and tricks and more. %1$1sGrow your store today.%2$2s', 'map-location-picker-at-checkout-for-woocommerce' ), '', '' ), - 'cta' => esc_html__( 'Let me in', 'map-location-picker-at-checkout-for-woocommerce' ), - 'link' => esc_attr( 'https://discord.gg/d8TsBv8D' ), + 'cta' => esc_html__( 'Learn more', 'map-location-picker-at-checkout-for-woocommerce' ), + 'link' => esc_attr( 'https://lpacwp.com/e-commerce-support-community/?utm_source=plugin-notice&utm_medium=wp-dashboard&utm_campaign=ecom-community' ), ); - echo $this->create_notice_markup( 'discord_server', $content ); + $this->create_notice_markup( 'discord_server', $content ); } + /** + * Create Printus released notice. + * + * @return void + */ + private function createPrintusReleaseNotice() { + + $content = array( + 'title' => esc_html__( '[NEW] Printus - Cloud Printing Plugin for WooCommerce', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', + 'body' => sprintf( esc_html__( 'Print WooCommerce receipts, invoices or package labels to ANY printer as soon as a new order comes in.', 'map-location-picker-at-checkout-for-woocommerce' ), '📈', '', '', '%' ), + 'link' => esc_attr( 'https://printus.cloud/?utm_source=banner&utm_medium=kikotenotice&utm_campaign=cross-sell' ), + ); + + $this->create_notice_markup( 'printus_launch_notice', $content ); + } } diff --git a/includes/Notices/Notice.php b/includes/Notices/Notice.php index e850fa1..17e6f18 100644 --- a/includes/Notices/Notice.php +++ b/includes/Notices/Notice.php @@ -90,23 +90,18 @@ protected function create_notice_markup( string $notice_id, array $content ) { $dismiss_url = esc_html( $this->create_dismiss_url( $notice_id ) ); $dismiss_text = esc_html__( 'Dismiss', 'map-location-picker-at-checkout-for-woocommerce' ); - - $markup = <<
-

$title

-

$body

+

+

-HTML; - - return $markup; - + get_days_since_installed(); - // Show notice after 3 weeks - if ( $days_since_installed < 21 ) { + // Show notice after 38 days + if ( $days_since_installed < 38 ) { return; } $content = array( - 'title' => esc_html__( 'Has LPAC Helped You?', 'map-location-picker-at-checkout-for-woocommerce' ), - 'body' => esc_html__( 'Hey! its Uriahs, Sole Developer working on Location Picker at Checkout for WooCommerce(LPAC). Has the plugin benefited your website? If yes, then would you mind taking a few seconds to leave a kind review? Reviews go a long way and they really help keep me motivated to continue working on the plugin and making it better', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🙏', + 'title' => esc_html__( 'Has Kikote Helped You?', 'map-location-picker-at-checkout-for-woocommerce' ), + 'body' => esc_html__( 'Hey! Has the plugin helped your website and/or business? If yes, then would you mind taking a few seconds to leave a kind review? Reviews go a long way and they really help keep me motivated to continue working on the plugin and making it better', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🙏', 'cta' => esc_html__( 'Sure', 'map-location-picker-at-checkout-for-woocommerce' ), 'link' => esc_attr( 'https://wordpress.org/support/plugin/map-location-picker-at-checkout-for-woocommerce/reviews/#new-post' ), ); - echo $this->create_notice_markup( 'leave_review_notice_1', $content ); + $this->create_notice_markup( 'leave_review_notice_1', $content ); } diff --git a/includes/Notices/Upsells_Notices.php b/includes/Notices/Upsells_Notices.php index 47266ea..3778daf 100644 --- a/includes/Notices/Upsells_Notices.php +++ b/includes/Notices/Upsells_Notices.php @@ -34,7 +34,6 @@ public function __construct() { } $this->create_pro_released_notice(); - $this->create_v160_release_notice(); } /** @@ -42,43 +41,23 @@ public function __construct() { * * @return void */ - public function create_pro_released_notice() { + private function create_pro_released_notice() { $days_since_installed = $this->get_days_since_installed(); - // Show notice after 4 days - if ( $days_since_installed < 10 ) { + // Show notice after 52 days + if ( $days_since_installed < 52 ) { return; } $content = array( - 'title' => esc_html__( 'Location Picker at Checkout PRO Released', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', + 'title' => esc_html__( 'Location Picker at Checkout PRO', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', /* translators: 1: Emoji 2: Opening HTML element 3: Closing HTML element 4: % symbol */ - 'body' => sprintf( esc_html__( 'Unlock the full potential of your pickups and deliveries %1$s The PRO version of LPAC is now live and available for purchase! Use Coupon code %2$sINIT10%3$s for a 10%4$s discount on your first year subscription! %2$sLimited time offer%3$s.', 'map-location-picker-at-checkout-for-woocommerce' ), '📈', '', '', '%' ), - 'link' => esc_attr( 'https://lpacwp.com/pricing/?utm_source=banner&utm_medium=lpacnotice&utm_campaign=proupsell' ), + 'body' => sprintf( esc_html__( 'Unlock the full potential of your pickups and deliveries %1$s The PRO version of Kikote is available for purchase! Use Coupon code %2$sDASHINIT10%3$s for a 10%4$s discount on your first year subscription! %2$sLimited time offer%3$s.', 'map-location-picker-at-checkout-for-woocommerce' ), '📈', '', '', '%' ), + 'link' => esc_attr( 'https://lpacwp.com/pricing/?utm_source=banner&utm_medium=kikotenotice&utm_campaign=proupsell' ), ); - echo $this->create_notice_markup( 'initial_pro_launch_notice', $content ); + $this->create_notice_markup( 'initial_pro_launch_notice', $content ); } - /** - * Create notice for what's new in v1.6.0 plugin. - * - * @since 1.6.0 - * @return void - */ - public function create_v160_release_notice() { - - if ( constant( 'LPAC_VERSION' ) !== '1.6.2' ) { - return; - } - - $content = array( - 'title' => esc_html__( 'Welcome to v1.6 of LPAC!', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', - 'body' => esc_html__( 'Some new features have been added to the PRO version of the plugin. These include: Orders Map, Cost by Store Location, Cost by Store Distance and more. Use coupon code INIT10 for a 10% discount at checkout.', 'map-location-picker-at-checkout-for-woocommerce' ), - 'link' => esc_attr( 'https://lpacwp.com/pricing/?utm_source=banner&utm_medium=lpacnotice&utm_campaign=proupsell' ), - ); - - echo $this->create_notice_markup( 'v160_release_notice', $content ); - } } diff --git a/includes/Traits/Upload_Folders.php b/includes/Traits/Upload_Folders.php index 2f12a5d..335ba37 100644 --- a/includes/Traits/Upload_Folders.php +++ b/includes/Traits/Upload_Folders.php @@ -50,7 +50,6 @@ private function create_upload_folder( string $folder_name ) { } return $folder_dir; - } /** @@ -62,7 +61,7 @@ private function create_upload_folder( string $folder_name ) { * @param string $ext * @return string The upload URL */ - private function get_resource_url( string $folder_name, int $order_id, string $ext = '.jpg' ) { + public function get_resource_url( string $folder_name, int $order_id, string $ext = '.jpg' ) { $upload_url = wp_upload_dir()['baseurl']; diff --git a/includes/Views/Admin/Admin.php b/includes/Views/Admin/Admin.php index aa143b8..fa15831 100644 --- a/includes/Views/Admin/Admin.php +++ b/includes/Views/Admin/Admin.php @@ -69,22 +69,25 @@ public function lpac_display_lpac_admin_order_meta( $order ) { $map_link = Functions::create_customer_directions_link( $latitude, $longitude ); - $markup = << +
-

$customer_location_meta_text:

-

-

$places_autocomplete_used_text

+

:

+

+

-HTML; + $store_origin_name_meta_text: $store_origin_name

-HTML; - } + ?> + +

:

+ + - echo "
" . $markup . '
'; +
+ + ?> +
-
-HTML; - - echo $map_container; - + + - $name - - -

$description

- - -HTML; - echo $markup; + ?> + + + + +

+ + + - $name - -
-

$description

- - -HTML; - echo $markup; - + ?> + + + +
+

+ + + - $name - -
- -

$description

- - -HTML; - echo $markup; - + ?> + + + +
+

+ + + - $name - -

$text

- - -HTML; - echo $markup; + ?> + + + +

+ + + $item_value"; + $options .= "'; } else { - $options .= ""; + $options .= "'; } } $hold_inputs .= " - + $options @@ -381,15 +373,15 @@ public function create_custom_wc_settings_repeater( $value ) { break; case 'checkbox': $checked = (bool) $current_saved_settings['should_calculate_per_distance_unit_checkbox'] ?? ''; - $hold_inputs .= "'; + $hold_inputs .= "'; break; default: - $hold_inputs .= ""; + $hold_inputs .= ""; break; } } - $hold_inputs .= ""; + $hold_inputs .= ""; $repeater_items .= '
' . $hold_inputs . ''; } @@ -442,29 +434,27 @@ public function create_custom_wc_settings_repeater( $value ) { $repeater_items = '
' . $hold_inputs . '
'; } - $markup = << - $name + ?> + + -
+
- $table_column_headings + - - $repeater_items + + - +
-
$description
+
-HTML; - - echo $markup; +
' ); + $signup_text = sprintf( esc_html__( 'Custom Maps, Custom Marker Icons, Saved Addresses, More Visibility Rules, Cost by Region, Cost by Distance, Cost by Store Location, Multi-Store Distance Pricing, Export Order Locations & More. %s Get the most out of LPAC with the PRO version.', 'map-location-picker-at-checkout-for-woocommerce' ), '

' ); /* translators: 1: Dashicons outbound link icon */ - $learn_more = sprintf( __( 'Learn More %s', 'map-location-picker-at-checkout-for-woocommerce' ), '' ); + $learn_more = sprintf( esc_html__( 'Learn More %s', 'map-location-picker-at-checkout-for-woocommerce' ), '' ); - $markup = <<
-

$signup_text

+


-

$learn_more

+

-HTML; - echo $markup; + + ?> + - -

$desc

+ +

-HTML; - echo $markup; +

- "; + ?> +

+ $store_name

- "; + ?> +

+ ' ; $array_keys = array_keys( $sections ); foreach ( $sections as $id => $label ) { - echo '
  • ' . $label . ' ' . (( end( $array_keys ) == $id ? '' : '|' )) . '
  • ' ; + echo '
  • ' . esc_html( $label ) . ' ' . (( end( $array_keys ) == $id ? '' : '|' )) . '
  • ' ; } echo '
    ' ; } @@ -131,16 +132,20 @@ public static function create_plugin_settings_banner() $no_api_key = ''; } - $title = __( "Use the Options Below to Change the Plugin's Settings", 'map-location-picker-at-checkout-for-woocommerce' ); - $issues = __( 'If you encounter any issues then please open a support ticket', 'map-location-picker-at-checkout-for-woocommerce' ); + $title = esc_html__( "Use the Options Below to Change the Plugin's Settings", 'map-location-picker-at-checkout-for-woocommerce' ); + $issues = esc_html__( 'If you encounter any issues then please open a support ticket', 'map-location-picker-at-checkout-for-woocommerce' ); $issues .= " {$here}"; - $documentation = __( 'Read the documentation', 'map-location-picker-at-checkout-for-woocommerce' ); + $documentation = esc_html__( 'Read the documentation', 'map-location-picker-at-checkout-for-woocommerce' ); $documentation .= " {$here}"; - $pro_demo = __( 'Try out the PRO version', 'map-location-picker-at-checkout-for-woocommerce' ); + $pro_demo = esc_html__( 'Try out the PRO version', 'map-location-picker-at-checkout-for-woocommerce' ); $pro_demo .= " {$here}"; - $dps_upsell = sprintf( __( 'Let customers choose their date and time for an order. Check out our %1$sDelivery & Pickup Scheduling Plugin%2$s.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '' ); - $dps_upsell .= " {$here}"; - $translate_plugin = __( 'Plugin settings not in your Language? Help translate it', 'map-location-picker-at-checkout-for-woocommerce' ); + $dps_upsell = sprintf( esc_html__( 'Let customers choose their date and time for an order. Check out our %1$sDelivery & Pickup Scheduling Plugin%2$s.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '' ); + $dps_upsell .= " {$here}"; + $printus_upsell = sprintf( esc_html__( 'Print Receipts, Invoices or Package labels as soon as an order happens. Check out %1$sPrintus - Cloud Printing Plugin for WooCommerce%2$s.', 'map-location-picker-at-checkout-for-woocommerce' ), '', '' ); + $printus_upsell .= " {$here}"; + $upsells = array( $dps_upsell, $printus_upsell ); + $rand_upsell_key = array_rand( $upsells ); + $translate_plugin = esc_html__( 'Plugin settings not in your Language? Help translate it', 'map-location-picker-at-checkout-for-woocommerce' ); $translate_plugin .= " {$here}"; $markup = << @@ -149,7 +154,7 @@ public static function create_plugin_settings_banner() \t\t

    {$no_api_key}

    \t\t

    📖   {$documentation}

    \t\t

    🌟   {$pro_demo}

    -\t\t

    🌟   {$dps_upsell}

    +\t\t

    🌟   {$upsells[$rand_upsell_key]}

    \t\t

    🌐   {$translate_plugin}

    \t\t

    ✋🏾   {$issues}

    \t\t
    @@ -216,6 +221,15 @@ public function create_general_setting_fields() 'class' => 'dashicons-before dashicons-admin-generic', 'type' => 'hr', ); + $lpac_settings[] = array( + 'name' => __( 'Map Region', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc_tip' => __( 'Select your country.', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc' => sprintf( __( 'It\'s fine if your country is not in this list. This feature helps better align the map with your country, but everything will still work fine without it.', 'map-location-picker-at-checkout-for-woocommerce' ) ), + 'id' => 'lpac_google_map_region', + 'type' => 'select', + 'options' => RegionList::createRegionList(), + 'css' => 'min-width:300px;', + ); $lpac_settings[] = array( 'name' => __( 'Detect Customer Location on Checkout Page Load', 'map-location-picker-at-checkout-for-woocommerce' ), 'desc' => __( 'Yes', 'map-location-picker-at-checkout-for-woocommerce' ), @@ -405,7 +419,7 @@ private function create_dummy_general_settings_fields() { $dummy_general_pro_settings = array(); $dummy_general_pro_settings[] = array( - 'name' => __( 'Show a searchbox inside the map', 'map-location-picker-at-checkout-for-woocommerce' ) . ' (PRO)', + 'name' => __( 'Show A Searchbox Inside the Map', 'map-location-picker-at-checkout-for-woocommerce' ) . ' (PRO)', 'desc' => __( 'Yes', 'map-location-picker-at-checkout-for-woocommerce' ), 'desc_tip' => sprintf( __( 'Enabling this option will add a searchbox inside the checkout page map. %s', 'map-location-picker-at-checkout-for-woocommerce' ), "" . self::$learn_more . '' ), 'type' => 'checkbox', @@ -501,14 +515,13 @@ private function create_display_settings_fields() 'css' => 'min-width:300px;', ); $lpac_settings[] = array( - 'name' => __( 'Default Zoom', 'map-location-picker-at-checkout-for-woocommerce' ), - 'desc_tip' => __( 'Recommended number is 16.', 'map-location-picker-at-checkout-for-woocommerce' ), - 'desc' => __( 'Enter the default zoom that will be used every time the map loads.', 'map-location-picker-at-checkout-for-woocommerce' ), - 'id' => 'lpac_general_map_zoom_level', - 'placeholder' => '16', - 'default' => 3, - 'type' => 'number', - 'css' => 'max-width:80px;', + 'name' => __( 'Default Zoom', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc_tip' => __( 'Recommended number is 16.', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc' => __( 'Enter the default zoom that will be used every time the map loads.', 'map-location-picker-at-checkout-for-woocommerce' ), + 'id' => 'lpac_general_map_zoom_level', + 'default' => 14, + 'type' => 'number', + 'css' => 'max-width:80px;', ); $lpac_settings[] = array( 'name' => __( 'Background Color (HEX)', 'map-location-picker-at-checkout-for-woocommerce' ), @@ -584,6 +597,17 @@ private function create_display_settings_fields() 'terrain' => __( 'Terrain', 'map-location-picker-at-checkout-for-woocommerce' ), ), ); + $lpac_settings[] = array( + 'name' => __( 'Disable Map Controls', 'map-location-picker-at-checkout-for-woocommerce' ), + 'class' => 'wc-enhanced-select', + 'id' => 'kikote_disabled_map_controls', + 'type' => 'multiselect', + 'options' => array( + 'zoom' => __( 'Zoom Button', 'map-location-picker-at-checkout-for-woocommerce' ), + 'maptype' => __( 'Map Type Buttons', 'map-location-picker-at-checkout-for-woocommerce' ), + 'fullscreen' => __( 'Fullscreen Button', 'map-location-picker-at-checkout-for-woocommerce' ), + ), + ); return $lpac_settings; } @@ -1596,9 +1620,9 @@ private function create_more_page() : array $lpac_settings[] = array( 'type' => 'lpac_image', 'src' => LPAC_PLUGIN_ASSETS_PATH_URL . 'admin/img/discord-banner.png', - 'desc' => __( 'Join E-Commerce store owners like yourself from around the world in a community tailored at helping your business grow.', 'map-location-picker-at-checkout-for-woocommerce' ) . " " . self::$learn_more . '', + 'desc' => __( 'Join E-Commerce store owners like yourself from around the world in a community tailored at helping your business grow.', 'map-location-picker-at-checkout-for-woocommerce' ) . " " . self::$learn_more . '', 'height' => '280px', - 'url' => 'https://discord.gg/d8TsBv8D', + 'url' => 'https://lpacwp.com/e-commerce-support-community/?utm_source=plugin-notice&utm_medium=wp-dashboard&utm_campaign=ecom-community', 'is_option' => false, ); $lpac_settings[] = array( @@ -1705,7 +1729,6 @@ public function create_plugin_settings_fields() } $lpac_settings = array(); - // TODO Change settings conditionals from if statement to switch statement if ( empty($current_section) || $current_section === 'general' ) { $lpac_settings = $this->create_general_setting_fields(); @@ -1753,19 +1776,6 @@ public function create_plugin_settings_fields() if ( $current_section === 'more' ) { $lpac_settings = $this->create_more_page(); } - // Custom attributes example - // https://woocommerce.github.io/code-reference/files/woocommerce-includes-admin-wc-meta-box-functions.html#source-view.146 - // $lpac_settings[] = array( - // 'name' => __( 'Test', 'map-location-picker-at-checkout-for-woocommerce' ), - // 'desc_tip' => __( 'Delete all plugin settings on uninstall.', 'map-location-picker-at-checkout-for-woocommerce' ), - // 'id' => 'lpac_delete_settings_on_uninstall', - // 'type' => 'text', - // 'custom_attributes' => array( - // 'disabled' => 'disabled', - // ) - // ); - // Default checkbox example - // https://wordpress.stackexchange.com/questions/390270/woocommerce-settings-api-set-checkbox-checked-by-default?noredirect=1#comment567330_390270 return apply_filters( 'woocommerce_get_settings_' . $this->id, $lpac_settings ); } @@ -1811,6 +1821,7 @@ private function get_possible_map_locations() 'woocommerce_after_checkout_shipping_form' => __( 'Shipping Address Area - Bottom', 'map-location-picker-at-checkout-for-woocommerce' ), 'woocommerce_before_checkout_billing_form' => __( 'Billing Address Area - Top', 'map-location-picker-at-checkout-for-woocommerce' ), 'woocommerce_after_checkout_billing_form' => __( 'Billing Address Area - Bottom', 'map-location-picker-at-checkout-for-woocommerce' ), + 'woocommerce_review_order_before_payment' => __( 'Before Payment Options', 'map-location-picker-at-checkout-for-woocommerce' ), ); /* * Fluid Checkout compatibility @@ -1863,6 +1874,7 @@ private function get_possible_map_locations() } } + $locations = apply_filters( 'kikote_possible_checkout_map_locations', $locations ); return $locations; } diff --git a/includes/Views/Admin/RegionList.php b/includes/Views/Admin/RegionList.php new file mode 100644 index 0000000..5eb9a45 --- /dev/null +++ b/includes/Views/Admin/RegionList.php @@ -0,0 +1,293 @@ + __( 'Select' ), + 'AF' => 'Afghanistan', + 'AL' => 'Albania', + 'DZ' => 'Algeria', + 'AS' => 'American Samoa', + 'AD' => 'Andorra', + 'AO' => 'Angola', + 'AI' => 'Anguilla', + 'AQ' => 'Antarctica', + 'AG' => 'Antigua & Barbuda', + 'AR' => 'Argentina', + 'AM' => 'Armenia', + 'AW' => 'Aruba', + 'AC' => 'Ascension Island', + 'AU' => 'Australia', + 'AT' => 'Austria', + 'AZ' => 'Azerbaijan', + 'BS' => 'Bahamas', + 'BH' => 'Bahrain', + 'BD' => 'Bangladesh', + 'BB' => 'Barbados', + 'BY' => 'Belarus', + 'BE' => 'Belgium', + 'BZ' => 'Belize', + 'BJ' => 'Benin', + 'BM' => 'Bermuda', + 'BT' => 'Bhutan', + 'BO' => 'Bolivia', + 'BA' => 'Bosnia & Herzegovina', + 'BW' => 'Botswana', + 'BV' => 'Bouvet Island', + 'BR' => 'Brazil', + 'IO' => 'British Indian Ocean Territory', + 'VG' => 'British Virgin Islands', + 'BN' => 'Brunei', + 'BG' => 'Bulgaria', + 'BF' => 'Burkina Faso', + 'BI' => 'Burundi', + 'KH' => 'Cambodia', + 'CM' => 'Cameroon', + 'CA' => 'Canada', + 'IC' => 'Canary Islands', + 'CV' => 'Cape Verde', + 'BQ' => 'Caribbean Netherlands', + 'KY' => 'Cayman Islands', + 'CF' => 'Central African Republic', + 'EA' => 'Ceuta & Melilla', + 'TD' => 'Chad', + 'CL' => 'Chile', + 'CN' => 'China', + 'CX' => 'Christmas Island', + 'CP' => 'Clipperton Island', + 'CC' => 'Cocos (Keeling) Islands', + 'CO' => 'Colombia', + 'KM' => 'Comoros', + 'CG' => 'Congo - Brazzaville', + 'CD' => 'Congo - Kinshasa', + 'CK' => 'Cook Islands', + 'CR' => 'Costa Rica', + 'HR' => 'Croatia', + 'CU' => 'Cuba', + 'CW' => 'Curaçao', + 'CY' => 'Cyprus', + 'CZ' => 'Czechia', + 'CI' => 'Côte d’Ivoire', + 'DK' => 'Denmark', + 'DG' => 'Diego Garcia', + 'DJ' => 'Djibouti', + 'DM' => 'Dominica', + 'DO' => 'Dominican Republic', + 'EC' => 'Ecuador', + 'EG' => 'Egypt', + 'SV' => 'El Salvador', + 'GQ' => 'Equatorial Guinea', + 'ER' => 'Eritrea', + 'EE' => 'Estonia', + 'SZ' => 'Eswatini', + 'ET' => 'Ethiopia', + 'FK' => 'Falkland Islands (Islas Malvinas)', + 'FO' => 'Faroe Islands', + 'FJ' => 'Fiji', + 'FI' => 'Finland', + 'FR' => 'France', + 'GF' => 'French Guiana', + 'PF' => 'French Polynesia', + 'TF' => 'French Southern Territories', + 'GA' => 'Gabon', + 'GM' => 'Gambia', + 'GE' => 'Georgia', + 'DE' => 'Germany', + 'GH' => 'Ghana', + 'GI' => 'Gibraltar', + 'GR' => 'Greece', + 'GL' => 'Greenland', + 'GD' => 'Grenada', + 'GP' => 'Guadeloupe', + 'GU' => 'Guam', + 'GT' => 'Guatemala', + 'GG' => 'Guernsey', + 'GN' => 'Guinea', + 'GW' => 'Guinea-Bissau', + 'GY' => 'Guyana', + 'HT' => 'Haiti', + 'HM' => 'Heard & McDonald Islands', + 'HN' => 'Honduras', + 'HK' => 'Hong Kong', + 'HU' => 'Hungary', + 'IS' => 'Iceland', + 'IN' => 'India', + 'ID' => 'Indonesia', + 'IR' => 'Iran', + 'IQ' => 'Iraq', + 'IE' => 'Ireland', + 'IM' => 'Isle of Man', + 'IL' => 'Israel', + 'IT' => 'Italy', + 'JM' => 'Jamaica', + 'JP' => 'Japan', + 'JE' => 'Jersey', + 'JO' => 'Jordan', + 'KZ' => 'Kazakhstan', + 'KE' => 'Kenya', + 'KI' => 'Kiribati', + 'XK' => 'Kosovo', + 'KW' => 'Kuwait', + 'KG' => 'Kyrgyzstan', + 'LA' => 'Laos', + 'LV' => 'Latvia', + 'LB' => 'Lebanon', + 'LS' => 'Lesotho', + 'LR' => 'Liberia', + 'LY' => 'Libya', + 'LI' => 'Liechtenstein', + 'LT' => 'Lithuania', + 'LU' => 'Luxembourg', + 'MO' => 'Macao', + 'MG' => 'Madagascar', + 'MW' => 'Malawi', + 'MY' => 'Malaysia', + 'MV' => 'Maldives', + 'ML' => 'Mali', + 'MT' => 'Malta', + 'MH' => 'Marshall Islands', + 'MQ' => 'Martinique', + 'MR' => 'Mauritania', + 'MU' => 'Mauritius', + 'YT' => 'Mayotte', + 'MX' => 'Mexico', + 'FM' => 'Micronesia', + 'MD' => 'Moldova', + 'MC' => 'Monaco', + 'MN' => 'Mongolia', + 'ME' => 'Montenegro', + 'MS' => 'Montserrat', + 'MA' => 'Morocco', + 'MZ' => 'Mozambique', + 'MM' => 'Myanmar (Burma)', + 'NA' => 'Namibia', + 'NR' => 'Nauru', + 'NP' => 'Nepal', + 'NL' => 'Netherlands', + 'NC' => 'New Caledonia', + 'NZ' => 'New Zealand', + 'NI' => 'Nicaragua', + 'NE' => 'Niger', + 'NG' => 'Nigeria', + 'NU' => 'Niue', + 'NF' => 'Norfolk Island', + 'KP' => 'North Korea', + 'MK' => 'North Macedonia', + 'MP' => 'Northern Mariana Islands', + 'NO' => 'Norway', + 'OM' => 'Oman', + 'PK' => 'Pakistan', + 'PW' => 'Palau', + 'PS' => 'Palestine', + 'PA' => 'Panama', + 'PG' => 'Papua New Guinea', + 'PY' => 'Paraguay', + 'PE' => 'Peru', + 'PH' => 'Philippines', + 'PN' => 'Pitcairn Islands', + 'PL' => 'Poland', + 'PT' => 'Portugal', + 'PR' => 'Puerto Rico', + 'QA' => 'Qatar', + 'RO' => 'Romania', + 'RU' => 'Russia', + 'RW' => 'Rwanda', + 'RE' => 'Réunion', + 'WS' => 'Samoa', + 'SM' => 'San Marino', + 'SA' => 'Saudi Arabia', + 'SN' => 'Senegal', + 'RS' => 'Serbia', + 'SC' => 'Seychelles', + 'SL' => 'Sierra Leone', + 'SG' => 'Singapore', + 'SX' => 'Sint Maarten', + 'SK' => 'Slovakia', + 'SI' => 'Slovenia', + 'SB' => 'Solomon Islands', + 'SO' => 'Somalia', + 'ZA' => 'South Africa', + 'GS' => 'South Georgia & South Sandwich Islands', + 'KR' => 'South Korea', + 'SS' => 'South Sudan', + 'ES' => 'Spain', + 'LK' => 'Sri Lanka', + 'BL' => 'St. Barthélemy', + 'SH' => 'St. Helena', + 'KN' => 'St. Kitts & Nevis', + 'LC' => 'St. Lucia', + 'MF' => 'St. Martin', + 'PM' => 'St. Pierre & Miquelon', + 'VC' => 'St. Vincent & Grenadines', + 'SD' => 'Sudan', + 'SR' => 'Suriname', + 'SJ' => 'Svalbard & Jan Mayen', + 'SE' => 'Sweden', + 'CH' => 'Switzerland', + 'SY' => 'Syria', + 'ST' => 'São Tomé & Príncipe', + 'TW' => 'Taiwan', + 'TJ' => 'Tajikistan', + 'TZ' => 'Tanzania', + 'TH' => 'Thailand', + 'TL' => 'Timor-Leste', + 'TG' => 'Togo', + 'TK' => 'Tokelau', + 'TO' => 'Tonga', + 'TT' => 'Trinidad & Tobago', + 'TA' => 'Tristan da Cunha', + 'TN' => 'Tunisia', + 'TR' => 'Turkey', + 'TM' => 'Turkmenistan', + 'TC' => 'Turks & Caicos Islands', + 'TV' => 'Tuvalu', + 'UM' => 'U.S. Outlying Islands', + 'VI' => 'U.S. Virgin Islands', + 'UG' => 'Uganda', + 'UA' => 'Ukraine', + 'AE' => 'United Arab Emirates', + 'GB' => 'United Kingdom', + 'US' => 'United States', + 'UY' => 'Uruguay', + 'UZ' => 'Uzbekistan', + 'VU' => 'Vanuatu', + 'VA' => 'Vatican City', + 'VE' => 'Venezuela', + 'VN' => 'Vietnam', + 'WF' => 'Wallis & Futuna', + 'EH' => 'Western Sahara', + 'YE' => 'Yemen', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', + 'AX' => 'Åland Islands', + ); + } + +} diff --git a/includes/Views/Frontend/Frontend.php b/includes/Views/Frontend/Frontend.php index 6934349..c3bbc18 100644 --- a/includes/Views/Frontend/Frontend.php +++ b/includes/Views/Frontend/Frontend.php @@ -28,8 +28,8 @@ class Frontend /** * Exposes map settings to be used in client-side javascript. * - * @since 1.0.0 - * @param string $additional Additional settings to pass to JS. + * @param string $additional Additional settings to pass to JS. + * @since 1.0.0 */ private function setup_global_js_vars( $additional = array() ) { @@ -231,7 +231,7 @@ public function output_map_on_checkout_page()
    -\t\t

    {$store_origin_name_label}

    -\t\t

    {$store_origin_name}

    -HTML; - echo $markup ; + $store_origin_name_label = apply_filters( 'lpac_order_details_deliver_from_text', esc_html__( 'Order origin', 'map-location-picker-at-checkout-for-woocommerce' ) ); + ?> +
    +

    +

    +

    -\t\t\t.lpac-map{ -\t\t\t\t{$style} -\t\t\t} - -\t\t\t@media screen and (max-width: 960px ){ -\t\t\t\t.lpac-map{ -\t\t\t\t\t{$style_mobile} -\t\t\t\t} -\t\t\t} -\t\t -\t\t -HTML; - echo $output ; + ?> + + + {$learn_more} >>" ); - $no_api_key_markup = << -\t\t\t

    Location Picker at Checkout: -\t\t\t\t{$no_api_key} -\t\t\t

    -\t\t\t
    -HTML; - echo $no_api_key_markup ; + ?> +
    +

    Location Picker at Checkout: + +

    +
    + -\t\t\t

    Location Picker at Checkout: -\t\t\t\t{$notice_text} -\t\t\t

    -\t\t\t

    -\t\t\t\t{$additional} -\t\t\t

    -\t\t
    -HTML; - echo $markup ; + ?> +
    +

    Location Picker at Checkout: + +

    +

    + +

    +
    + __( 'Geolocation is not possible on this web browser. Please switch to a different web browser to use our interactive map.', 'map-location-picker-at-checkout-for-woocommerce' ), - 'manually_select_location' => __( 'Please select your location manually using the map.', 'map-location-picker-at-checkout-for-woocommerce' ), + 'manually_select_location' => __( 'Please select your location manually by clicking on the map then moving the marker to your desired location.', 'map-location-picker-at-checkout-for-woocommerce' ), 'no_results_found' => __( 'No address results found for your location.', 'map-location-picker-at-checkout-for-woocommerce' ), 'moving_too_quickly' => __( 'Slow down, you are moving too quickly, use the zoom out button to move the marker across larger distances.', 'map-location-picker-at-checkout-for-woocommerce' ), 'generic_error' => __( 'An error occurred while trying to detect your location. Please try again after the page has refreshed.', 'map-location-picker-at-checkout-for-woocommerce' ), diff --git a/index.php b/index.php index 3c379e1..2064c65 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,10 @@ \n" "Language-Team: \n" @@ -1464,7 +1464,9 @@ msgid "Please select the store location you would like to order from." msgstr "" #: includes/Views/Frontend/Frontend.php:707 -msgid "Please select your location manually using the map." +msgid "" +"Please select your location manually by clicking on the map then moving the " +"marker to your desired location." msgstr "" #: includes/Controllers/Checkout_Page/Validate.php:73 diff --git a/lpac.php b/lpac.php index 540d324..0a1b044 100644 --- a/lpac.php +++ b/lpac.php @@ -1,7 +1,7 @@ " ; + /* translators: 1: Opening

    HTML element 2: Opening HTML element 3: Closing HTML element 4: Closing

    HTML element */ + echo sprintf( + esc_html__( '%1$s%2$sKikote - Location Picker at Checkout for WooCommerce NOTICE:%3$s PHP version too low to use this plugin. Please change to at least PHP 7.4. You can contact your web host for assistance in updating your PHP version.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), + '

    ', + '', + '', + '

    ' + ) ; + echo '' ; + } ); + return; } } /** - * The code that runs during plugin deactivation. - * This action is documented in includes/class-lpac-deactivator.php + * Check PHP versions */ -if ( !function_exists( 'deactivate_lpac' ) ) { - /** - * Code that runs when the plugin is deactivated. - * - * @return void - * @since 1.0.0 - */ - function deactivate_lpac() - { - require_once plugin_dir_path( __FILE__ ) . 'includes/class-lpac-deactivator.php'; - Lpac_Deactivator::deactivate(); +if ( defined( 'PHP_VERSION' ) ) { + + if ( version_compare( PHP_VERSION, '7.4', '<' ) ) { + add_action( 'admin_notices', function () { + echo "
    " ; + /* translators: 1: Opening

    HTML element 2: Opening HTML element 3: Closing HTML element 4: Closing

    HTML element */ + echo sprintf( + esc_html__( '%1$s%2$sKikote - Location Picker at Checkout for WooCommerce NOTICE:%3$s PHP version too low to use this plugin. Please change to at least PHP 7.4. You can contact your web host for assistance in updating your PHP version.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), + '

    ', + '', + '', + '

    ' + ) ; + echo '
    ' ; + } ); + return; } } -register_activation_hook( __FILE__, 'activate_lpac' ); -register_deactivation_hook( __FILE__, 'deactivate_lpac' ); +/** + * Check that WooCommerce is active. + * + * This needs to happen before freemius does any work. + * + * @since 1.0.0 + */ + +if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { + add_action( 'admin_notices', function () { + echo "
    " ; + /* translators: 1: Opening

    HTML element 2: Opening HTML element 3: Closing HTML element 4: Closing

    HTML element */ + echo sprintf( + esc_html__( '%1$s%2$sKikote - Location Picker at Checkout for WooCommerce NOTICE:%3$s WooCommerce is not activated, please activate it to use the plugin.%4$s', 'map-location-picker-at-checkout-for-woocommerce' ), + '

    ', + '', + '', + '

    ' + ) ; + echo '
    ' ; + } ); + return; +} + if ( function_exists( 'lpac_fs' ) ) { lpac_fs()->set_basename( false, __FILE__ ); @@ -128,21 +158,52 @@ function lpac_fs() do_action( 'lpac_fs_loaded' ); } - // Composer autoload. - require dirname( __FILE__ ) . '/vendor/autoload.php'; /** - * Check that WooCommerce is active. - * - * This needs to happen before freemius does any work. + * Composer autoload. DO NOT PLACE THIS LINE BEFORE FREEMIUS SDK RUNS. * - * @since 1.0.0 + * Doing that will cause the plugin to throw an error when trying to activate PRO when the Free version is active or vice versa. + * This is because both PRO and Free are generated from the same codebase, meaning composer autoloader file would already be + * present and throw an error when trying to be redefined. */ + require_once dirname( __FILE__ ) . '/vendor/autoload.php'; + /** + * The code that runs during plugin activation. + * This action is documented in includes/class-lpac-activator.php + */ + if ( !function_exists( 'activate_lpac' ) ) { + /** + * Code that runs when the plugin is activated. + * + * @return void + * @since 1.0.0 + */ + function activate_lpac() + { + require_once plugin_dir_path( __FILE__ ) . 'includes/class-lpac-activator.php'; + Lpac_Activator::activate(); + } - if ( !in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { - add_action( 'admin_notices', array( new Lpac\Notices\Admin(), 'lpac_wc_not_active_notice' ) ); - return; } + /** + * The code that runs during plugin deactivation. + * This action is documented in includes/class-lpac-deactivator.php + */ + if ( !function_exists( 'deactivate_lpac' ) ) { + /** + * Code that runs when the plugin is deactivated. + * + * @return void + * @since 1.0.0 + */ + function deactivate_lpac() + { + require_once plugin_dir_path( __FILE__ ) . 'includes/class-lpac-deactivator.php'; + Lpac_Deactivator::deactivate(); + } + } + register_activation_hook( __FILE__, 'activate_lpac' ); + register_deactivation_hook( __FILE__, 'deactivate_lpac' ); /** * Move this code to the main plugin file and then run it in an action hook when the SDK is initialized: lpac_fs_loaded. */ @@ -154,37 +215,11 @@ function lpac_redirect_to_map_builder() require __DIR__ . '/class-lpac-uninstall.php'; require __DIR__ . '/admin-pointers.php'; - - if ( function_exists( 'lpac_fs' ) ) { - lpac_fs()->add_action( 'after_uninstall', array( new Lpac_Uninstall(), 'remove_plugin_settings' ) ); - lpac_fs()->add_filter( 'show_deactivation_subscription_cancellation', '__return_false' ); - lpac_fs()->add_filter( 'plugin_icon', function () { - return dirname( __FILE__ ) . '/assets/img/logo.png'; - } ); - } - - /** - * Check PHP version - */ - if ( function_exists( 'phpversion' ) ) { - - if ( version_compare( phpversion(), '7.4', '<' ) ) { - add_action( 'admin_notices', array( new Lpac\Notices\Admin(), 'output_php_version_notice' ) ); - return; - } - - } - /** - * Check PHP versions - */ - if ( defined( 'PHP_VERSION' ) ) { - - if ( version_compare( PHP_VERSION, '7.4', '<' ) ) { - add_action( 'admin_notices', array( new Lpac\Notices\Admin(), 'output_php_version_notice' ) ); - return; - } - - } + lpac_fs()->add_action( 'after_uninstall', array( new Lpac_Uninstall(), 'remove_plugin_settings' ) ); + lpac_fs()->add_filter( 'show_deactivation_subscription_cancellation', '__return_false' ); + lpac_fs()->add_filter( 'plugin_icon', function () { + return dirname( __FILE__ ) . '/assets/img/logo.png'; + } ); define( 'LPAC_BASE_FILE', basename( plugin_dir_path( __FILE__ ) ) ); define( 'LPAC_PLUGIN_NAME', 'lpac' ); define( 'LPAC_PLUGIN_DIR', __DIR__ . '/' ); @@ -192,6 +227,7 @@ function lpac_redirect_to_map_builder() define( 'LPAC_PLUGIN_ASSETS_PATH_URL', plugin_dir_url( __FILE__ ) . 'assets/' ); define( 'LPAC_PLUGIN_PATH_URL', plugin_dir_url( __FILE__ ) ); define( 'LPAC_INSTALLED_AT_VERSION', get_option( 'lpac_installed_at_version', constant( 'LPAC_VERSION' ) ) ); + define( 'LPAC_IS_PREMIUM_VERSION', lpac_fs()->is_premium() ); define( 'LPAC_GOOGLE_MAPS_API_LINK', 'https://maps.googleapis.com/maps/api/js?key=' ); define( 'LPAC_GOOGLE_MAPS_API_KEY', get_option( 'lpac_google_maps_api_key', '' ) ); define( 'LPAC_GOOGLE_MAPS_DIRECTIONS_LINK', 'https://maps.google.com/maps?daddr=' ); @@ -217,6 +253,11 @@ function lpac_redirect_to_map_builder() array_push( $google_params, "libraries={$libraries}" ); } + // Map Region. + $region = get_option( 'lpac_google_map_region' ); + if ( !empty($region) ) { + $google_params[] = "region={$region}"; + } // Callback parameter is required even though we're not making use of it. $google_params[] = 'callback=GMapsScriptLoaded'; // Bring our parameters together. diff --git a/phpcs.xml b/phpcs.xml index 676175b..1d82999 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -5,6 +5,7 @@ . vendor/* + bin/* dist/* *.js *.css diff --git a/readme.txt b/readme.txt index c6e8c3a..665e2ac 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ -=== Location Picker at Checkout - WooCommerce Checkout Map - Google Address AutoFill Plugin - Kikote === +=== Kikote - Location Picker at Checkout & Google Address AutoFill Plugin for WooCommerce === Contributors: uriahs-victor Tags: woocommerce, location picker, checkout map, geolocation, google map, map, delivery map Requires at least: 5.5 Requires PHP: 7.4 -Tested up to: 6.1 -Stable tag: 1.7.0 +Tested up to: 6.2 +Stable tag: 1.7.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -16,13 +16,13 @@ https://www.youtube.com/watch?v=vDlIxPeBs1M Do you run a WooCommerce store where you need more detailed location information from a customer? If so, then why not let them choose their exact location on Google Maps? -Kikote is a Location Picker At Checkout plugin for WooCommerce which allows store owners to add more flexibility to their WooCommerce store by letting their customers choose exactly where they'd like their product(s) delivered. +Kikote (pronounced Key-Ko-tay) is a Location Picker At Checkout plugin for WooCommerce which allows store owners to add more flexibility to their WooCommerce store by letting their customers choose exactly where they'd like their product(s) delivered. This plugin is excellent for stores with delivery personnel that ship products to customers within a moderate geographical area. It can also work for websites which offer Pickup services such as Private Taxi websites. -Kikote- Location Picker At Checkout for WooCommerce enables store owners to get more precise location details without having to contact customers via other means for location information or directions. With this plugin, lots of time can be saved by allowing customers to select their exact location on Google Maps at checkout with WooCommerce. +Kikote - Location Picker At Checkout for WooCommerce enables store owners to get more precise location details without having to contact customers via other means for location information or directions. With this plugin, lots of time can be saved by allowing customers to select their exact location on Google Maps at checkout with WooCommerce. -> Works Great with DPS! +> Works Great with Delivery & Scheduling WooCommerce Plugin! > > The plugin works great with [Delivery & Pickup Scheduling for WooCommerce](https://wordpress.org/plugins/delivery-and-pickup-scheduling-for-woocommerce/). Feel free to try them both out! @@ -30,7 +30,7 @@ Kikote- Location Picker At Checkout for WooCommerce enables store owners to get Kikote is a Checkout Location Picker plugin for WooCommerce that is suitable for any website that offers Delivery or Pickups for their customers. A Delivery website example would be an online restaurant, a Pickup website example would be a private taxi website. The plugin adds a Google map on the WooCommerce checkout page that customers can use to select their desired location. Alternatively, the plugin can be set up to also allow it to automatically detect the customer's location on checkout page load and allow them to make any corrections -Kikote- Location Picker at Checkout makes use of the Google Maps API to carry out it's functions; it can work as any of the following: +Kikote - Location Picker at Checkout makes use of the Google Maps API to carry out it's functions; it can work as any of the following: ### WooCommerce Checkout Map Plugin @@ -90,11 +90,15 @@ Kikote comes with multiple features to fine tune where you deliver to and how mu The plugin comes with a Map Builder feature that allows store owners to create custom Google Maps with their store locations and shipping regions and add those maps anywhere on their website using a shortcode. +> Works Great with Printus - Cloud Printing Plugin for WooCommerce! +> +> The plugin works great with [Printus - Cloud Printing Plugin for WooCommerce](https://wordpress.org/plugins/printus-cloud-printing-for-woocommerce/). A remote cloud printing plugin that allows you to print receipts, invoices and package labels for WooCommerce. Feel free to try them both out! + ### Below are a few types of stores that would benefit tremendously from this plugin: -- Online Food Delivery websites -- Online Supermarkets -- Online Furniture websites +- Online food delivery websites +- Online supermarkets +- Online furniture websites - Restaurants offering delivery via their website - Hardware Rental & Delivery websites - Car Rental websites @@ -153,15 +157,12 @@ Have a feature in mind? Feel free to submit it on the support forum. - Online Ordering System For Restaurants & Local Retail by Orderable - CheckoutWC custom checkout plugin -**_Kikote- Location Picker at Checkout is the last WooCommerce checkout map plugin you'll need._** +**_Kikote - Location Picker at Checkout is the last WooCommerce checkout map plugin you'll need._** -> -> Join our E-commerce Support Discord community to meet E-commerce store owners like yourself from around the world and discuss on ways to help grow sales, plugin recommendations, tips and tricks and more. [Here >>>](https://discord.gg/d8TsBv8D) -> ### Configuring Plugin: -- The plugin settings are located in **WordPress Admin Dashboard->SL Plugins->Location Picker At Checkout**. +- The plugin settings are located in **WordPress Admin Dashboard->SoaringLeads->Location Picker At Checkout**. ### Plugin Documentation @@ -179,8 +180,9 @@ Have a feature in mind? Feel free to submit it on the support forum. ### Misc - Learn more about Location Picker at Checkout for WooCommerce or Purchase the PRO version [Here >>>](https://lpacwp.com) -- Join our E-commerce Support Discord community. Meet E-commerce store owners like yourself to discuss on ways to help grow your E-commerce store. [Here >>>](https://discord.gg/d8TsBv8D) -- Checkout our other plugin Delivery & Pickup Scheduling for WooCommerce [Here >>>](https://dpswp.com) +- Meet E-commerce store owners like yourself to discuss on ways to help grow your E-commerce store [Here >>>](https://lpacwp.com/e-commerce-support-community/) +- Checkout our other plugin to help further manage your store: Delivery & Pickup Scheduling for WooCommerce [Here >>>](https://dpswp.com) +- Checkout [Printus](https://printus.cloud), a remote cloud printing plugin for WooCommerce that prints your orders as soon as they come in [Here >>>](https://printus.cloud). - Assets [Attribution](https://lpacwp.com/attribution/) This plugin is free software, and the most important features have been kept free and open to use so that all can benefit. If you like the plugin and believe that it's helped grow your business, then please consider [leaving a review](https://wordpress.org/support/plugin/map-location-picker-at-checkout-for-woocommerce/reviews/#new-post). @@ -190,7 +192,7 @@ This plugin is free software, and the most important features have been kept fre 1. Extract the downloaded zip file and upload the `location-picker-at-checkout-for-woocommerce` folder to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress -3. Configure the plugin in WordPress Dashboard->SL Plugins->Location Picker At Checkout +3. Configure the plugin in WordPress Dashboard->SoaringLeads->Location Picker At Checkout Alternatively, install this plugin by searching for it from the plugins area of your WordPress website. @@ -211,10 +213,20 @@ Please ensure that both WooCommerce and Kikote are NOT activated Network-wide. B These sorts of issues are usually due to a JavaScript issue on the website. Check your [browser console](https://balsamiq.com/support/faqs/browserconsole/) for any errors that might point to the cause. Feel free to post those errors in the support forum and include a full screenshot of your browser console. += What happens if customer denies access to their location = + +An alert will be shown informing the customer to select their location manually on the google map. + = Map says "For development purposes only" = This message shows when you have not finished setting up the map correctly inside the Google Cloud Console. Please make sure you've followed all the steps from the [setup guide](https://lpacwp.com/docs/getting-started/google-cloud-console/getting-your-google-maps-api-key/) including the "Setting up Billing & Google Monthly Credit" section. += Map shows "Oops! Something went wrong." = + +This is usually shown when the domain you restricted inside google cloud console is wrong. Make sure you've restricted the correct domain. [See here for instructions](https://lpacwp.com/docs/getting-started/google-cloud-console/getting-your-google-maps-api-key/#important-restricting-your-api-key). + +This message shows when you have not finished setting up the map correctly inside the Google Cloud Console. Please make sure you've followed all the steps from the [setup guide](https://lpacwp.com/docs/getting-started/google-cloud-console/getting-your-google-maps-api-key/) including the "Setting up Billing & Google Monthly Credit" section. + = Do I need to pay to use this plugin? = No! The plugin is free to use. The Google Maps APIs it uses, however, do require you to setup an account on Google's Cloud Console. The process is easy and requires you also attaching a billing method to your account. Google provides a $200 monthly credit for usage of their APIs so you don't have to worry about paying anything unless you receive alot of orders on your store (upwards of 15,000 orders in a month). See [this step](https://lpacwp.com/docs/getting-started/google-cloud-console/getting-your-google-maps-api-key/#important-setting-up-billing-google-monthly-credit) in the setup guide for more details about how this works. @@ -254,20 +266,44 @@ Always take a backup before updating your plugins! == Changelog == += 1.7.4 = +* [New] Display option to show map before payment options on checkout page. +* [New] Option to disable various map controls such as fullscreen and map type. +* [New] Option to set map region. +* [Fix PRO] Cost by Store Location feature was not working. +* [Improvement] Logic for outputting map on the checkout page. It's now easier to change the location with the supplied `lpac_checkout_map_orientation` filter. +* [Improvement PRO] Display of searchbox on map feature. +* [Change] Plugin's menu item is now called "SoaringLeads". +* [Dev PRO] It's now possible to filter the calculated shipping cost of all shipping cost workflows to add any additional markup of changes. `kikote_distance_range_shipping_cost`, `kikote_distance_shipping_cost`, `kikote_region_shipping_cost`, `kikote_store_shipping_cost`. +* [Dev] Added `kikote_possible_checkout_map_locations` filter for the list of checkout locations shown in Kikote's display settings. +* [Info] Tested on WC 7.5. +* [Info] Tested on WP 6.2. + += 1.7.3 = +* [Fix] Console error when customers denied access to their location and then clicked the get current location button. +* [Fix] Plugin redirecting to inexistent dashboard page after activation when WooCommerce is not active on website. +* [Improvement] Updated some plugin logos. +* [Info] Tested on WP 6.2-beta5. + += 1.7.2 = +* [Dev] Version bump. + += 1.7.1 = +* [Fix] Map not being usable when customers denied access to their location. + = 1.7.0 = Location Picker at Checkout for WooCommerce is now called Kikote! Meaning "Where" in Saint Lucian French Creole. * [New PRO] Map Builder feature for building custom Google Maps using plugin settings. [Learn more](https://lpacwp.com/docs/map-builder/) * [New PRO] Option to add an autocomplete seachbox inside the map display on the checkout page. [Learn more](https://lpacwp.com/docs/getting-started/google-cloud-console/places-autocomplete-feature/#show-a-searchbox-inside-the-map) -* [New] Option to add an AutoComplete searchbox on the checkout page map. * [New] Option stop the plugin from dissecting the address it receives from the Google API before adding it into the Street Address 1 field. -* [New] E-commerce Support Discord community - Meet fellow store owners from around the world to discuss ways to grow your E-Commerce business. [Join Here >>>](https://discord.gg/d8TsBv8D). +* [New] E-commerce Support Discord community - Meet fellow store owners from around the world to discuss ways to grow your E-Commerce business. [Join Here >>>](https://discord.gg/U85vKcjsqZ). * [Fix] Shipping Cost by Region restriction features was not showing the available shipping regions dropdown if the plugin settings was firstly saved with no created shipping regions. * [Fix] Rare instances where lat and long array values for Shipping Cost by Distance feature would overwrite itself. * [Fix] Plugin settings link was not redirecting to the correct subsite on multisite installs. * [Improvement] Refactored JavaScript code for quicker and more modular future development of plugin. * [Change] Store Selector shortcode has been changed from `[lpac-store-selector]` to `[kikote_store_selector]`. -* [Dev] Tested on WC 7.4. +* [Info] Tested on WC 7.4. = 1.6.14 = * [Improvement] Don't enforce use of autocomplete feature when the customer has selected a Local Pickup shipping method. @@ -278,16 +314,16 @@ Location Picker at Checkout for WooCommerce is now called Kikote! Meaning "Where * [New] It's now possible to update the map's instruction text from the plugin Display Settings area. * [Fix] Console error when callback method not set on Google Maps script. * [Improvement] The Street Address 1 field will no longer populate with the entire customer address. It will now attempt to only place the street address into the field. To return to the original functionality, please [see this doc](https://lpacwp.com/docs/custom-code-samples/checkout-map/how-to-add-full-address-to-address1-field/). -* [Improvement] Improvements to plugin's menu item. Plugin submenus are now under the "SL Plugins" menu item. -* [Dev] Tested on WC 7.3. +* [Improvement] Improvements to plugin's menu item. Plugin submenus are now under the "SoaringLeads" menu item. +* [Info] Tested on WC 7.3. = 1.6.12 = * [Fix] Map marker would sometimes appear as a white box on some websites. * [Improvement] Add "Location" label on WooCommerce Thank You and Past Order view pages. * [Improvement] Add Location Picker at Checkout Menu item. * [Compatibility] Improved compatibility with FunnelKit (previously WooFunnels). -* [Dev] Tested on WC 7.2. * [Dev] Update Freemius SDK. +* [Info] Tested on WC 7.2. = 1.6.11 = * [Dev] Update Freemius SDK. @@ -296,7 +332,7 @@ Location Picker at Checkout for WooCommerce is now called Kikote! Meaning "Where * [New] Added an option to the plugin's Display Settings to choose the default map type that loads on the checkout page (Road Map, Satellite etc.). * [New] Add-ons tab in plugin settings. * [Dev] Code improvements. -* [Dev] Tested on WC 7.1. +* [Info] Tested on WC 7.1. = 1.6.9 = * [New PRO] Added a new option to the Cost by Distance Range feature for calculating distance per unit if using flat rates aren't ideal. @@ -318,7 +354,7 @@ Location Picker at Checkout for WooCommerce is now called Kikote! Meaning "Where * [Fix] Address would not show in marker info window if no shipping zones exist on the website. * [Dev] You can now change the map locale using the `lpac_map_locale` filter. * [Dev] Customer's last order will no longer be their full formatted addresses, it will instead be the address line 1. This behavior can be changed using the `lpac_last_order_address` filter. -* [Dev] Tested on WC v7.0-rc.2. +* [Info] Tested on WC v7.0-rc.2. = 1.6.7 =