diff --git a/assets/admin/js/lpac-admin.js b/assets/admin/js/lpac-admin.js index 1dd8c13..ec9d6ea 100644 --- a/assets/admin/js/lpac-admin.js +++ b/assets/admin/js/lpac-admin.js @@ -68,6 +68,24 @@ } // hideSaveButtonOnExportTab(); + /** + * Check if the Google Maps API Key has been entered on the settings page. + */ + function checkAPIKeyPresence() { + const field = $("#lpac_google_maps_api_key"); + + if (field.length < 1) { + return; + } + + if (field.val().length > 10) { + return; + } + + field.css("box-shadow", "1px 1px 10px 5px red"); + } + checkAPIKeyPresence(); + /** * Toggle AutoDetect customer location option on Generals Settings page. */ diff --git a/assets/admin/js/repeater-setup.js b/assets/admin/js/repeater-setup.js index 8adf63f..93625e8 100644 --- a/assets/admin/js/repeater-setup.js +++ b/assets/admin/js/repeater-setup.js @@ -59,7 +59,7 @@ // to the server, etc. If a hide callback is not given the item // will be deleted. hide: function (deleteElement) { - if (confirm("Are you sure you want to delete this element?")) { + if (confirm("Are you sure you want to delete this entry?")) { $(this).slideUp(deleteElement); } }, diff --git a/assets/public/js/maps/checkout-page-map.js b/assets/public/js/maps/checkout-page-map.js index 7f62f55..bc8fcf2 100644 --- a/assets/public/js/maps/checkout-page-map.js +++ b/assets/public/js/maps/checkout-page-map.js @@ -749,13 +749,16 @@ function lpacSetLastOrderLocationCords() { */ function lpacSetLastOrderForAutocompleteWithoutMap() { const hideMapForAutocomplete = mapOptions.lpac_places_autocomplete_hide_map; + const enablePlacesAutoComplete = mapOptions.lpac_enable_places_autocomplete; - if (!hideMapForAutocomplete) { + if (enablePlacesAutoComplete === false && hideMapForAutocomplete === false) { return; } const field = document.querySelector("#lpac_order__origin_store_field"); - field.classList.remove("hidden"); + if (field) { + field.classList.remove("hidden"); + } lpacSetLastOrderLocationCords(); } @@ -1012,8 +1015,13 @@ addPlacesAutoComplete(); */ const hideMapForAutocomplete = mapOptions.lpac_places_autocomplete_hide_map; + const enablePlacesAutoComplete = + mapOptions.lpac_enable_places_autocomplete; - if (!hideMapForAutocomplete) { + if ( + enablePlacesAutoComplete === false && + hideMapForAutocomplete === false + ) { return; } @@ -1079,9 +1087,10 @@ addPlacesAutoComplete(); * Weird bug with fluid checkout causing field to disappear if we try to move it too early. */ if (checkoutProvider === "fluidcheckout") { - setTimeout(() => { + $(document.body).on("updated_checkout", function () { + let field = $("#lpac_order__origin_store_field"); field.insertAfter("#shipping_address_1_field"); - }, "1500"); + }); } } moveStoreSelector(); @@ -1094,7 +1103,13 @@ addPlacesAutoComplete(); // In those cases we have no need to wait until a location is found from the map to show the field. const hideMapForAutocomplete = mapOptions.lpac_places_autocomplete_hide_map; - if (hideMapForAutocomplete) { + const enablePlacesAutoComplete = + mapOptions.lpac_enable_places_autocomplete; + + if ( + enablePlacesAutoComplete === true && + hideMapForAutocomplete === true + ) { return; } diff --git a/class-lpac-uninstall.php b/class-lpac-uninstall.php index 9ed22a5..ac7445b 100644 --- a/class-lpac-uninstall.php +++ b/class-lpac-uninstall.php @@ -108,6 +108,7 @@ public static function remove_plugin_settings() { 'lpac_export_date_to', 'lpac_places_autocomplete_country_restrictions', 'lpac_places_autocomplete_type', + 'lpac_enable_shipping_cost_by_distance_feature', 'lpac_distance_matrix_api_key', 'lpac_distance_matrix_store_origin_cords', 'lpac_distance_matrix_cost_per_unit', @@ -139,6 +140,9 @@ public static function remove_plugin_settings() { 'lpac_enable_cost_by_store_location', 'lpac_cost_by_store_distance_delivery_prices', 'lpac_cost_by_store_location_delivery_prices', + 'lpac_cost_by_store_location_shipping_methods', + 'lpac_migrated__add_address_to_store_locations', + 'lpac_show_selected_store_in_emails', ); foreach ( $option_keys as $key ) { diff --git a/includes/Bootstrap/Main.php b/includes/Bootstrap/Main.php index b970161..9cf55b2 100644 --- a/includes/Bootstrap/Main.php +++ b/includes/Bootstrap/Main.php @@ -27,6 +27,9 @@ */ namespace Lpac\Bootstrap; +if ( !defined( 'WPINC' ) ) { + die; +} use Lpac\Bootstrap\Loader ; use Lpac\Bootstrap\I18n ; use Lpac\Bootstrap\Admin_Enqueues ; @@ -42,6 +45,7 @@ use Lpac\Views\Frontend as Frontend_Display ; use Lpac\Compatibility\WooFunnels\WooFunnels ; use Lpac\Models\Location_Details ; +use Lpac\Models\Migrations ; use Lpac\Controllers\API\Order as API_Order ; /** * Class Main. @@ -152,6 +156,11 @@ private function define_admin_hooks() $admin_settings_controller = new Admin_Settings_Controller(); $controller_map_visibility = new Map_Visibility_Controller(); $api_orders = new API_Order(); + $migrations = new Migrations(); + /** + * Plugin settings migrations + */ + $this->loader->add_action( 'admin_init', $migrations, 'add_address_field_to_store_locations' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); // Notices @@ -200,21 +209,12 @@ private function define_admin_hooks() 10, 3 ); - /** - * Migrate old way of saving store locations to new array structure. Added @1.6.0 - */ - $this->loader->add_action( - 'admin_init', - $admin_settings_controller, - 'migrate_old_store_locations', - 10, - 3 - ); /* Custom elements created for WooCommerce settings */ $this->loader->add_action( 'woocommerce_admin_field_button', $plugin_admin_view, 'create_custom_wc_settings_button' ); $this->loader->add_action( 'woocommerce_admin_field_hr', $plugin_admin_view, 'create_custom_wc_settings_hr' ); $this->loader->add_action( 'woocommerce_admin_field_div', $plugin_admin_view, 'create_custom_wc_settings_div' ); $this->loader->add_action( 'woocommerce_admin_field_repeater', $plugin_admin_view, 'create_custom_wc_settings_repeater' ); + $this->loader->add_action( 'woocommerce_admin_field_info_text', $plugin_admin_view, 'create_custom_wc_settings_info_text' ); $this->loader->add_filter( 'plugin_action_links', $this, @@ -338,8 +338,18 @@ private function define_public_hooks() 2 ); } + /** + * Validate that a customer has selected a store location from the drop down selector. + */ + $this->loader->add_action( + 'woocommerce_after_checkout_validation', + $controller_checkout_page, + 'validate_store_location_selector_dropdown', + 10, + 2 + ); /* - * Display map button link or qr code link in email. + * Display map button link, static map or qr code link in order emails email. */ $enable_map_link_in_email = get_option( 'lpac_enable_delivery_map_link_in_email' ); @@ -355,6 +365,16 @@ private function define_public_hooks() ); } + /** + * Add selected store location to order emails. + */ + $this->loader->add_action( + 'woocommerce_email_customer_details', + $controller_emails, + 'add_store_location_to_email', + 20, + 4 + ); /* * Adds a notice for admin to checkout page */ diff --git a/includes/Compatibility/Checkout_Provider.php b/includes/Compatibility/Checkout_Provider.php index 24c612f..7475df9 100644 --- a/includes/Compatibility/Checkout_Provider.php +++ b/includes/Compatibility/Checkout_Provider.php @@ -42,6 +42,10 @@ public function get_checkout_provider() { $provider = 'fluidcheckout'; } + if ( defined( 'CFW_NAME' ) ) { + $provider = 'checkoutwc'; + } + if ( class_exists( 'Orderable_Pro', false ) ) { $settings = get_option( 'orderable_settings', array() ); $enable_custom_checkout = $settings['checkout_general_override_checkout'] ?? ''; diff --git a/includes/Controllers/Admin_Settings_Controller.php b/includes/Controllers/Admin_Settings_Controller.php index dea44d3..6d023a5 100644 --- a/includes/Controllers/Admin_Settings_Controller.php +++ b/includes/Controllers/Admin_Settings_Controller.php @@ -87,40 +87,4 @@ public function generate_store_id( array $values, array $option, array $raw_valu return $values; } - /** - * Migrate Store Locations from the old settings array to the new settings array. - * @return void - */ - public function migrate_old_store_locations() : void { - - $installed_at_version = LPAC_INSTALLED_AT_VERSION; - $migrated = get_option( 'lpac_migrated_store_locations' ); - - // Only perform this migration prior to v1.6.0 when we had the old method of adding store locations. - if ( $installed_at_version >= '1.6.0' || ! empty( $migrated ) ) { - return; - } - - $location_coordinates = get_option( 'lpac_store_locations_cords', array() ); - $location_names = get_option( 'lpac_store_locations_labels', array() ); - $location_icons = get_option( 'lpac_store_locations_icons', array() ); - - $location_coordinates_array = explode( '|', $location_coordinates ); - $location_names_array = explode( '|', $location_names ); - $location_icons_array = explode( '|', $location_icons ); - - $new_array_structure = array(); - - foreach ( $location_coordinates_array as $key => $cords ) { - $new_array_structure[] = array( - 'store_location_id' => sanitize_text_field( 'store_location_' . $key ), - 'store_name_text' => sanitize_text_field( $location_names_array[ $key ] ?? 'Branch Name' ), - 'store_cords_text' => sanitize_text_field( $cords ), - 'store_icon_text' => sanitize_text_field( $location_icons_array[ $key ] ?? '' ), - ); - } - - update_option( 'lpac_store_locations', $new_array_structure ); - update_option( 'lpac_migrated_store_locations', true ); - } } diff --git a/includes/Controllers/Checkout_Page_Controller.php b/includes/Controllers/Checkout_Page_Controller.php index 40dddc5..efc2204 100644 --- a/includes/Controllers/Checkout_Page_Controller.php +++ b/includes/Controllers/Checkout_Page_Controller.php @@ -138,10 +138,41 @@ public function get_last_order_location() { * * @since 1.5.7 * @since 1.6.0 use new store locations array + * @see setup_global_js_vars() * @return array */ public function get_store_locations() { return get_option( 'lpac_store_locations', array() ); } + /** + * Check if the origin store dropdown has a selected value for Store location selector feature in Shipping Locations settings. + * + * @since 1.6.0 + * @param array $fields The fields array. + * @param object $errors The errors object. + * + * @return void + */ + public function validate_store_location_selector_dropdown( array $fields, object $errors ) : void { + + $enable_store_location_selector = get_option( 'lpac_enable_store_location_selector' ); + $enable_store_location_selector = filter_var( $enable_store_location_selector, FILTER_VALIDATE_BOOL ); + + if ( empty( $enable_store_location_selector ) ) { + return; + } + + $origin_store = $_POST['lpac_order__origin_store'] ?? ''; + + $error_msg = '' . __( 'Please select the store location you would like to order from.', 'map-location-picker-at-checkout-for-woocommerce' ) . ''; + + $error_msg = apply_filters( 'lpac_checkout_empty_origin_store_msg', $error_msg ); + + if ( empty( $origin_store ) ) { + $errors->add( 'validation', $error_msg ); + } + + } + } diff --git a/includes/Controllers/Emails_Controller.php b/includes/Controllers/Emails_Controller.php index 23194cf..b2218bd 100644 --- a/includes/Controllers/Emails_Controller.php +++ b/includes/Controllers/Emails_Controller.php @@ -13,7 +13,6 @@ namespace Lpac\Controllers; -use Lpac\Helpers\Functions as Functions_Helper; use Lpac\Helpers\QR_Code_Generator; use Lpac\Traits\Upload_Folders; @@ -28,10 +27,14 @@ class Emails_Controller { /** * Outputs a Button or QR Code inside order emails. - * + * @param object $order + * @param bool $sent_to_admin + * @param bool $plain_text + * @param object $email * @since 1.1.0 + * @return void */ - public function add_delivery_location_link_to_email( $order, $sent_to_admin, $plain_text, $email ) { + public function add_delivery_location_link_to_email( object $order, bool $sent_to_admin, bool $plain_text, object $email ) { $allowed_emails = get_option( 'lpac_email_delivery_map_emails', array() ); @@ -183,4 +186,57 @@ private function create_delivery_location_static_map( $order_id, $map_link, $lat } + /** + * Adds store location to order email + * + * @param object $order + * @param bool $sent_to_admin + * @param bool $plain_text + * @param object $email + * @since 1.6.2 + * @return void + */ + public function add_store_location_to_email( object $order, bool $sent_to_admin, bool $plain_text, object $email ): void { + + $show_in_emails = get_option( 'lpac_show_selected_store_in_emails', 'yes' ); + + if ( $show_in_emails !== 'yes' ) { + return; + } + + $label = get_option( 'lpac_store_select_label' ) ?: esc_html( 'Deliver from', 'map-location-picker-at-checkout-for-woocommerce' ); + $label = rtrim( $label, ':' ); + $store_origin_name = get_post_meta( $order->get_id(), '_lpac_order__origin_store_name', true ); + + if ( empty( $store_origin_name ) ) { + return; + } + + $store_locations = get_option( 'lpac_store_locations', array() ); + $address = ''; + + if ( empty( $store_locations ) ) { + return; + } + + $store_names = array_column( $store_locations, 'store_name_text' ); + $key = array_search( $store_origin_name, $store_names ); + + if ( $key !== false ) { + $address = $store_locations[ $key ]['store_address_text'] ?? ''; + $cords = $store_locations[ $key ]['store_cords_text'] ?? ''; + } + + $link = ( ! empty( $cords ) ) ? "https://www.google.com/maps/search/?api=1&query=$cords" : '#'; + + $markup = "

+ $label:

+ + $store_origin_name
+ $address
+
+



"; + echo $markup; + } + } diff --git a/includes/Models/Migrations.php b/includes/Models/Migrations.php new file mode 100644 index 0000000..a8bc870 --- /dev/null +++ b/includes/Models/Migrations.php @@ -0,0 +1,81 @@ +installed_at = get_option( 'lpac_installed_at_version', '1.0.0' ); + } + + /** + * Add new address field to store locations array. + * + * @since 1.6.2 + * @return void + */ + public function add_address_field_to_store_locations() { + + if ( version_compare( $this->installed_at, '1.6.2', '>=' ) ) { + return; + } + + $migrated = get_option( 'lpac_migrated__add_address_to_store_locations' ); + if ( $migrated ) { + return; + } + + $store_locations = get_option( 'lpac_store_locations', array() ); + if ( empty( $store_locations ) ) { + return; + } + + foreach ( $store_locations as $key => &$store ) { + $store = array_merge( + array_slice( $store, 0, 3, true ), + array( 'store_address_text' => '' ), + array_slice( $store, 3, null, true ) + ); + } + unset( $store ); + + update_option( 'lpac_store_locations', $store_locations ); + update_option( 'lpac_migrated__add_address_to_store_locations', true ); + } + + +} diff --git a/includes/Notices/Upsells_Notices.php b/includes/Notices/Upsells_Notices.php index 17eeaf0..d13a00e 100644 --- a/includes/Notices/Upsells_Notices.php +++ b/includes/Notices/Upsells_Notices.php @@ -69,12 +69,12 @@ public function create_pro_released_notice() { */ public function create_v160_release_notice() { - if ( constant( 'LPAC_VERSION' ) !== '1.6.0' ) { + if ( constant( 'LPAC_VERSION' ) !== '1.6.2' ) { return; } $content = array( - 'title' => esc_html__( 'Welcome to v1.6.0 of LPAC!', 'map-location-picker-at-checkout-for-woocommerce' ) . ' 🚀', + '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.' ), 'link' => esc_attr( 'https://lpacwp.com/pricing/?utm_source=banner&utm_medium=lpacnotice&utm_campaign=proupsell' ), ); diff --git a/includes/Views/Admin.php b/includes/Views/Admin.php index b801143..79b3d9d 100644 --- a/includes/Views/Admin.php +++ b/includes/Views/Admin.php @@ -247,6 +247,32 @@ public function create_custom_wc_settings_div( $value ) { } + /** + * Create a custom info p element that can be used on the plugin's settings page. + * + * @param array $value + * @return void + */ + public function create_custom_wc_settings_info_text( $value ) { + + $name = $value['name']; + $id = $value['id']; + $row_class = $value['row_class'] ?? ''; + $class = $value['class']; + $text = $value['text']; + $css = $value['css']; + + $markup = << + $name + +

$text

+ + +HTML; + echo $markup; + } + /** * Create a custom repeater element that can be used on the plugin's settings page. * diff --git a/includes/Views/Admin_Settings.php b/includes/Views/Admin_Settings.php index f98a5bb..15424df 100644 --- a/includes/Views/Admin_Settings.php +++ b/includes/Views/Admin_Settings.php @@ -191,7 +191,7 @@ public function create_general_setting_fields() $lpac_settings[] = array( 'name' => __( 'Google Maps API Key', 'map-location-picker-at-checkout-for-woocommerce' ), 'desc_tip' => __( 'Enter the API key from Google cloud console.', 'map-location-picker-at-checkout-for-woocommerce' ), - 'desc' => __( 'Enter the API key you copied from the Google Cloud Console. Learn More ', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc' => __( 'Enter the API key you copied from the Google Cloud Console. Without the Google Maps API key the plugin will not function as expected. Learn More ', 'map-location-picker-at-checkout-for-woocommerce' ), 'id' => 'lpac_google_maps_api_key', 'placeholder' => 'AIzaSyD8seU-lym435g...', 'type' => ( LPAC_DEBUG ? 'text' : 'password' ), @@ -518,24 +518,29 @@ private function create_store_locations_settings_fields() $dashicon = ( lpac_fs()->is_not_paying() ? "" : '' ); $lpac_settings[] = array( 'name' => __( 'Store Locations', 'map-location-picker-at-checkout-for-woocommerce' ), - 'desc' => sprintf( __( 'Create your different store locations. A "store" in this context simply means the locations where you do business. Separate coordinates latitude and longitude with a commar. %s', 'map-location-picker-at-checkout-for-woocommerce' ), "" . self::$learn_more . '' ), + 'desc' => sprintf( __( 'Create your different store locations. A "store" in this context simply means the locations where you do business. Separate latitude and longitude coordinates with a comma. %s', 'map-location-picker-at-checkout-for-woocommerce' ), "" . self::$learn_more . '' ), 'id' => 'lpac_store_locations', 'type' => 'repeater', 'current_saved_settings' => get_option( 'lpac_store_locations' ), 'entity_name' => __( 'location', 'map-location-picker-at-checkout-for-woocommerce' ), 'id_field' => 'store_location_id', 'table_columns' => array( - 'store_name_text' => array( + 'store_name_text' => array( 'name' => __( 'Name', 'map-location-picker-at-checkout-for-woocommerce' ), 'readonly' => false, 'placeholder' => __( 'Enter a store name', 'map-location-picker-at-checkout-for-woocommerce' ), ), - 'store_cords_text' => array( + 'store_cords_text' => array( 'name' => __( 'Coordinates', 'map-location-picker-at-checkout-for-woocommerce' ), 'readonly' => false, 'placeholder' => '13.856098,-61.057016', ), - 'store_icon_text' => array( + 'store_address_text' => array( + 'name' => __( 'Address', 'map-location-picker-at-checkout-for-woocommerce' ), + 'readonly' => false, + 'placeholder' => '#9 LPAC Street', + ), + 'store_icon_text' => array( 'name' => $dashicon . __( 'Icon URL', 'map-location-picker-at-checkout-for-woocommerce' ) . $this->pro_label, 'readonly' => ( lpac_fs()->is_not_paying() ? true : false ), 'placeholder' => 'https://example.com/wp-content/.../icon.png', @@ -565,6 +570,15 @@ private function create_store_locations_settings_fields() 'default' => __( 'Deliver from', 'map-location-picker-at-checkout-for-woocommerce' ), 'css' => 'max-width:200px;', ); + $lpac_settings[] = array( + 'name' => __( 'Show Selected Store in Order Emails', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc' => __( 'Yes', 'map-location-picker-at-checkout-for-woocommerce' ), + 'desc_tip' => __( 'Checking this option will add the Store name and address inside the WooCommerce order emails.', 'map-location-picker-at-checkout-for-woocommerce' ), + 'id' => 'lpac_show_selected_store_in_emails', + 'type' => 'checkbox', + 'default' => 'yes', + 'css' => 'max-width:200px;', + ); $lpac_settings[] = array( 'type' => 'sectionend', 'id' => 'lpac_store_location_settings_section_end', @@ -1634,6 +1648,19 @@ private function get_possible_map_locations() } } + + if ( defined( 'CFW_NAME' ) ) { + $locations = array( + '' => __( 'Select', 'map-location-picker-at-checkout-for-woocommerce' ), + 'cfw_start_shipping_address_container' => __( 'Shipping Address Area - Top (CheckoutWC)', 'map-location-picker-at-checkout-for-woocommerce' ), + 'cfw_end_shipping_address_container' => __( 'Shipping Address Area - Bottom (CheckoutWC)', 'map-location-picker-at-checkout-for-woocommerce' ), + ); + $current_set_location = get_option( 'lpac_checkout_map_orientation' ); + if ( !array_key_exists( $current_set_location, $locations ) ) { + update_option( 'lpac_checkout_map_orientation', 'cfw_start_shipping_address_container' ); + } + } + return $locations; } diff --git a/includes/Views/Frontend.php b/includes/Views/Frontend.php index d89b4a1..a0df2ae 100644 --- a/includes/Views/Frontend.php +++ b/includes/Views/Frontend.php @@ -150,8 +150,12 @@ private function get_store_selector_label_setting() */ private function maybe_create_store_location_selector_fields() : void { + /** + * Checking for get_cost_by_distance_setting() instead of get_cost_by_store_distance_setting because + * the latter can be turned on while the former is turned off resulting in unexpected results. + */ - if ( $this->get_cost_by_store_distance_setting() === false && $this->get_cost_by_store_location_setting() === false && $this->get_store_location_selector_setting() === true ) { + if ( $this->get_cost_by_distance_setting() === false && $this->get_cost_by_store_location_setting() === false && $this->get_store_location_selector_setting() === true ) { $store_locations = array_merge( array( '' => '--' . __( 'Please choose an option', 'map-location-picker-at-checkout-for-woocommerce' ) . '--', ), $this->get_store_locations() ); @@ -227,6 +231,7 @@ public function lpac_output_map_on_checkout_page() } // TODO these filters do not work as expected...split up map area markup and ensure all filters/actions are working as expected + // TODO These should actually be actions $before_map_filter = apply_filters( 'lpac_before_map', '', $user_id ); $before_map_filter = wp_kses_post( $before_map_filter ); $after_map_filter = apply_filters( 'lpac_after_map', '', $user_id ); @@ -447,7 +452,7 @@ public function add_admin_checkout_notice() $additional = esc_html__( 'Only Admins on your website can see this notice. You can turn it off in the plugin settings from the "Debug" submenu if everything works fine.' ); if ( empty($api_key) ) { - $no_api_key = sprintf( esc_html__( 'You have not entered a Google Maps API Key! The plugin will not function how it should until you have entered the key. Please read the following doc for instructions on obtaining a Google Maps API Key %s' ), "{$learn_more} >>" ); + $no_api_key = sprintf( esc_html__( 'You have not entered a Google Maps API Key! The plugin will not function how it should until you have entered the key. Please read the following doc for instructions on obtaining a Google Maps API Key %s' ), "{$learn_more} >>" ); $no_api_key_markup = << \t\t\t

Location Picker at Checkout: diff --git a/lpac.php b/lpac.php index 02e9ce6..2f16770 100644 --- a/lpac.php +++ b/lpac.php @@ -1,12 +1,6 @@ false, 'has_paid_plans' => true, 'menu' => array( - 'first-path' => 'admin.php?page=wc-settings&tab=lpac_settings', + 'first-path' => ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ? 'admin.php?page=wc-settings&tab=lpac_settings' : '' ), ), 'is_live' => true, ) ); diff --git a/readme.txt b/readme.txt index 3209288..9b42fe0 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: woocommerce, location picker, checkout map, geolocation, google map, map, Requires at least: 5.5 Requires PHP: 7.3 Tested up to: 6.1 -Stable tag: 1.5.7 +Stable tag: 1.6.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -209,6 +209,20 @@ Post it on the [support forum](https://wordpress.org/support/plugin/map-location == Upgrade Notice == == Changelog == += 1.6.2 = +* [New] Option to show selected store location in order emails. +* [New] New address field when creating Store Locations. +* [Fix] JS error when Store Location selector is not present on checkout page. +* [Fix] Store Location selector was always being moved below shipping address even when map was being shown on checkout. +* [Fix] Store Location validation was not being enforced in the free version of the plugin. +* [Fix] Default Store Location selector would not display on checkout page unless "Cost by Store Distance" feature was explicitly disabled. +* [Fix] Prevent plugin from trying to redirect to its settings if WooCommerce is not active. +* [Compatibility] Support for CheckoutWC - WooCommerce custom checkout plugin. + + += 1.6.1 = +* [Fix] Migration error for old store location settings to new store location feature. + = 1.6.0 = * [New PRO] Cost by Store Distance - Set order shipping price based on the customer's distance relative to your store location. * [New PRO] Cost by Store Location - Set order shipping price based on the store that the customer selects at checkout.