From 27135138ff0c79c92c9e21330a3a1dc0d26cc287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20K=C3=B6n=C3=B6nen?= Date: Mon, 27 Apr 2020 11:25:59 +0300 Subject: [PATCH 1/7] Add clear selection button support --- templates/sizeme-product.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/sizeme-product.php b/templates/sizeme-product.php index 1f81a49..c90b339 100644 --- a/templates/sizeme-product.php +++ b/templates/sizeme-product.php @@ -103,6 +103,14 @@ $el = '.variations select'; if ( $sizeme->get_ui_option( WC_SizeMe_for_WooCommerce::INVOKE_ELEMENT, '' ) ) $el = $sizeme->get_ui_option( WC_SizeMe_for_WooCommerce::INVOKE_ELEMENT, '' ); echo 'if (window.jQuery) { jQuery(function() { if (document.querySelector("'.$el.'")) document.querySelector("'.$el.'").addEventListener("sizemeChange", function(e) { jQuery("'.$el.'").trigger("change"); }) } ); }'; + + // + // Also add support for possible clear size selection button + // Includes a timeout to let Woo do it's thing (clear the selection) + // + // @since 2.1.2 + // + echo 'if (window.jQuery) jQuery(function() { jQuery(".reset_variations").click(function() { if (document.querySelector("'.$el.'")) { setTimeout(function() { document.querySelector("'.$el.'").dispatchEvent(new Event("change")); }, 200); } } ); } );'; ?> //]]> From c63e7fb4d2ba2ba43f1cbe9199d970224d0516af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20K=C3=B6n=C3=B6nen?= Date: Mon, 27 Apr 2020 11:34:58 +0300 Subject: [PATCH 2/7] Version hike to 2.1.2 --- readme.txt | 6 ++++-- sizeme-for-woocommerce.php | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/readme.txt b/readme.txt index a9cd36e..449422e 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === SizeMe for WooCommerce === Contributors: sizeme -Tags: sizeme, measurements, size guide, size recommendations +Tags: sizeme, measurements, sizeguide, size guide, size recommendations Requires at least: 3.8 Tested up to: 5.4 -Stable tag: 2.1.1 +Stable tag: 2.1.2 Requires PHP: 5.2.4 WC requires at least: 2.5 WC tested up to: 4.0.1 @@ -82,6 +82,8 @@ To install and take into use the SizeMe for WooCommerce plugin, follow the instr 4. Visualize the fit using the SizeMe Sizing Barâ„¢ and easy-to-understand illustrations == Changelog == += 2.1.2 = +* Added support for the clear size selection button. = 2.1.1 = * Fixed tracking of ajax-based add to cart events. Also improved SKU handling with simple products. diff --git a/sizeme-for-woocommerce.php b/sizeme-for-woocommerce.php index f2b1d24..c7f158a 100644 --- a/sizeme-for-woocommerce.php +++ b/sizeme-for-woocommerce.php @@ -9,12 +9,15 @@ * @wordpress-plugin * Plugin Name: SizeMe for WooCommerce * Description: SizeMe is a web store plugin that enables your consumers to input their measurements and get personalised fit recommendations based on actual product data. - * Version: 2.1.1 + * Version: 2.1.2 * Author: SizeMe Ltd * Author URI: https://www.sizeme.com/ * Text Domain: sizeme * License: GPLv2 or later * + * WC requires at least: 2.5 + * WC tested up to: 4.0.1 + * * SizeMe for WooCommerce is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or @@ -50,7 +53,7 @@ class WC_SizeMe_for_WooCommerce { * * @var string VERSION The plugin version. */ - const VERSION = '2.1.1'; + const VERSION = '2.1.2'; /** * Minimum WordPress version this plugin works with, used for dependency checks. From 2aa765236d42e7cbe6000faef92c4180a06a10cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20K=C3=B6n=C3=B6nen?= Date: Tue, 28 Apr 2020 08:56:57 +0300 Subject: [PATCH 3/7] Add default value for service status --- classes/class-wc-settings-sizeme-for-woocommerce.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/class-wc-settings-sizeme-for-woocommerce.php b/classes/class-wc-settings-sizeme-for-woocommerce.php index 52fda45..53750a1 100644 --- a/classes/class-wc-settings-sizeme-for-woocommerce.php +++ b/classes/class-wc-settings-sizeme-for-woocommerce.php @@ -141,6 +141,7 @@ public function get_settings() { self::SERVICE_STATUS_ON => 'On', self::SERVICE_STATUS_OFF => 'Off', ), + 'default' => get_option( WC_SizeMe_for_WooCommerce::SERVICE_STATUS_ID, self::SERVICE_STATUS_OFF ), 'id' => WC_SizeMe_for_WooCommerce::SERVICE_STATUS_ID, ), array( From 772d3ca2fad5fd3eaca43a5028e4e865f7adf3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20K=C3=B6n=C3=B6nen?= Date: Tue, 28 Apr 2020 08:57:17 +0300 Subject: [PATCH 4/7] Version hike to 2.2.0 --- readme.txt | 3 +++ sizeme-for-woocommerce.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 449422e..0095cb6 100644 --- a/readme.txt +++ b/readme.txt @@ -82,6 +82,9 @@ To install and take into use the SizeMe for WooCommerce plugin, follow the instr 4. Visualize the fit using the SizeMe Sizing Barâ„¢ and easy-to-understand illustrations == Changelog == += 2.2.0 = +* Options (finally) prefixed to avoid plugin conflicts and some significant code cleanup too. + = 2.1.2 = * Added support for the clear size selection button. diff --git a/sizeme-for-woocommerce.php b/sizeme-for-woocommerce.php index c7f158a..8ba44b2 100644 --- a/sizeme-for-woocommerce.php +++ b/sizeme-for-woocommerce.php @@ -9,7 +9,7 @@ * @wordpress-plugin * Plugin Name: SizeMe for WooCommerce * Description: SizeMe is a web store plugin that enables your consumers to input their measurements and get personalised fit recommendations based on actual product data. - * Version: 2.1.2 + * Version: 2.2.0 * Author: SizeMe Ltd * Author URI: https://www.sizeme.com/ * Text Domain: sizeme @@ -53,7 +53,7 @@ class WC_SizeMe_for_WooCommerce { * * @var string VERSION The plugin version. */ - const VERSION = '2.1.2'; + const VERSION = '2.2.0'; /** * Minimum WordPress version this plugin works with, used for dependency checks. From f483e5a67047aaa19bd3d3debc38becb1495517b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20K=C3=B6n=C3=B6nen?= Date: Tue, 28 Apr 2020 08:57:34 +0300 Subject: [PATCH 5/7] Change plugin version info --- templates/sizeme-product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/sizeme-product.php b/templates/sizeme-product.php index c90b339..5ab202f 100644 --- a/templates/sizeme-product.php +++ b/templates/sizeme-product.php @@ -34,8 +34,8 @@