Changeset 3284835
- Timestamp:
- 04/30/2025 11:13:44 AM (11 months ago)
- Location:
- multiple-sale-scheduler-for-woocommerce/trunk
- Files:
-
- 5 edited
-
README.md (modified) (2 diffs)
-
assets/js/sale-scheduler.js (modified) (5 diffs)
-
assets/js/sale-scheduler.min.js (modified) (1 diff)
-
multiple-sale-scheduler.php (modified) (3 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
multiple-sale-scheduler-for-woocommerce/trunk/README.md
r3233663 r3284835 1 # multiple-sale-scheduler 1 # Multiple Sale Scheduler for WooCommerce 2 3 Effortlessly schedule multiple sales for your WooCommerce products, ensuring timely discounts and seamless promotions. 4 5 # Description 6 7 Effortlessly schedule and manage multiple sales for your WooCommerce products—both single and grouped. Plan sales periods in advance to boost customer engagement and drive conversions with well-timed promotions. 8 9 Default WooCommerce sale functionality is in priority. If product is already on sale then 10 Multiple sale scheduler will not override it. 11 12 # Why Use Multiple Sale Scheduler? 13 14 Manually managing multiple sales can be time-consuming and prone to errors. Multiple Sale Scheduler simplifies the process by automating sales scheduling, ensuring they start and stop on time. Focus on growing your business while the plugin handles your promotions. 15 16 # Features 17 18 Schedule multiple sales for WooCommerce products. 19 20 Works seamlessly with the REST API, ideal for headless WooCommerce setups. 21 22 Set start and end dates for each sale. 23 24 Automatically apply sale prices during the scheduled period. 25 26 Easy-to-use interface within WooCommerce product settings. 27 28 Compatible with the latest WooCommerce and WordPress versions. 29 30 # Installation 31 32 From the WordPress admin panel, navigate to **Plugins > Add New**. Search for "Multiple Sale Scheduler for WooCommerce," then install and activate it. 33 34 Alternatively, upload the plugin files to the /wp-content/plugins/ directory and activate the plugin via the **Plugins** screen. 35 36 Activate the plugin through the 'Plugins' screen in WordPress. 37 38 Navigate to the product edit page in WooCommerce to start scheduling sales. 39 40 In general product data tab you can see new field if product type is simple or grouped. 41 42 # Frequently Asked Questions 43 44 Q 1): Is Multiple Sale Scheduler free? 45 46 A: Yes, the plugin is licensed under GPL-2.0 and is free to use and modify. 47 48 Q 2): Does this plugin support variable products? 49 50 A: No, this plugin curently supports only simple and grouped products. 51 52 Q 3): Can I use this plugin for headless WooCommerce? 53 54 A: Yes, this plugin is fully compatible with the WooCommerce REST API, making it ideal for headless setups. 55 56 Q 4): Does the plugin work with custom product types? 57 58 A: The plugin supports standard WooCommerce product types. For custom types, additional compatibility may be needed. 59 60 Q 5) My valid sale isn't working. 61 62 A: If your valid sale is not working and you have made changes to the timezone settings, you need to set all sales again, including the WooCommerce default sale. If this does not work, please ask in [the support forum](https://wordpress.org/support/plugin/multiple-sale-scheduler-for-woocommerce/) OR [GitHub Q&A](https://github.com/morivishal/multiple-sale-scheduler/discussions/categories/q-a). 63 64 # Note 65 - The default WooCommerce sale scheduler cannot be overridden in the following scenarios: 66 1. When a sale price is set, but the start and end dates are not specified. 67 2. When a sale price is set, and the start date, end date, or the entire date range includes the current date. 2 68 3 69 # Developer Note … … 7 73 8 74 - In contrast, wc_get_product_ids_on_sale() only retrieves product IDs set on sale via the default WooCommerce sale functionality. 75 76 Changelog 77 78 2.0.0 79 80 Major change in file structure. 81 - Removed entaire autoloader and its vendor folder, composer.json, composer.lock. 82 - Moved wrapper.php in new helpers folder. 83 - Introduce new autoload.php to load classes in mss plugin. 84 - Changed class file name PSR-4 autoloading standard to WordPress coding standards. 85 86 * Fix -Fix date conflict in msswc_display_scheduled_sale_prices(). 87 * Enhancement - msswc_get_product_ids_on_sale() no longer uses wc_get_product_ids_on_sale(). 88 * Enhancement - msswc_save_scheduled_sales() now executes only when the post type product is created/saved. 89 * Update - Added validation to check if the regular price is set or not. 90 91 License 92 93 Multiple Sale Scheduler for WooCommerce is licensed under the GNU General Public License v2.0 or later. See LICENSE for more details. -
multiple-sale-scheduler-for-woocommerce/trunk/assets/js/sale-scheduler.js
r3233663 r3284835 1 1 jQuery(document).ready(($) => { 2 const regularPrice = parseFloat($("#_regular_price").val());3 2 const scheduleContainer = $("#schedule_container"); 4 3 const addScheduleButton = $("#add-schedule"); … … 28 27 startDateField.datepicker({ 29 28 dateFormat: "yy-mm-dd", 30 onSelect: function (selectedDate) { ;29 onSelect: function (selectedDate) { 31 30 endDateField.datepicker("option", "minDate", selectedDate); 32 31 } 33 32 }); 34 endDateField.datepicker({ 33 endDateField.datepicker({ 35 34 dateFormat: "yy-mm-dd", 36 onSelect: function (selectedDate) { 35 onSelect: function (selectedDate) { 37 36 startDateField.datepicker("option", "maxDate", selectedDate); 38 37 } … … 46 45 scheduleContainer.append(clone); 47 46 toggleRemoveButtons(); 48 47 49 48 $(".start-date, .end-date").removeClass("hasDatepicker"); 50 49 $(".start-date, .end-date").attr("id", ""); … … 53 52 scheduleContainer.on("click", ".remove_sale", (e) => { 54 53 e.preventDefault(); 55 if ( scheduleContainer.children().length > 1) {54 if (scheduleContainer.children().length > 1) { 56 55 $(e.currentTarget).closest(".schedule-pricing-fields").remove(); 57 56 toggleRemoveButtons(); … … 59 58 }); 60 59 61 scheduleContainer.on("keyup change", ".schedule-sale-price", function() { 60 scheduleContainer.on("keyup change", ".schedule-sale-price", function () { 61 const regularPrice = parseFloat($("#_regular_price").val()); 62 console.log(regularPrice); 62 63 const salePrice = parseFloat($(this).val()); 63 64 // To remove the custom validation message set by the "focusout" event. 64 65 $(this)[0].setCustomValidity(""); 65 66 66 if ( salePrice >= regularPrice) {67 $( document.body ).triggerHandler("wc_add_error_tip", [68 $( this),67 if (!regularPrice || salePrice >= regularPrice) { 68 $(document.body).triggerHandler("wc_add_error_tip", [ 69 $(this), 69 70 "i18n_sale_less_than_regular_error", 70 ] );71 ]); 71 72 } else { 72 $( document.body ).triggerHandler("wc_remove_error_tip",73 [ $( this),74 "i18n_sale_less_than_regular_error"]73 $(document.body).triggerHandler("wc_remove_error_tip", 74 [$(this), 75 "i18n_sale_less_than_regular_error"] 75 76 ); 76 77 } 77 78 }); 78 79 79 scheduleContainer.on("focusout", ".schedule-sale-price", function() { 80 scheduleContainer.on("focusout", ".schedule-sale-price", function () { 81 const regularPrice = parseFloat($("#_regular_price").val()); 82 console.log(regularPrice); 80 83 const salePrice = parseFloat($(this).val()); 81 if ( !salePrice) {82 return; 84 if (!salePrice) { 85 return; 83 86 } 84 if ( salePrice >= regularPrice) {87 if (!regularPrice || salePrice >= regularPrice) { 85 88 $(this).val(""); 86 89 } else { -
multiple-sale-scheduler-for-woocommerce/trunk/assets/js/sale-scheduler.min.js
r3233663 r3284835 1 jQuery(document).ready( e=>{let t=parseFloat(e("#_regular_price").val()),a=e("#schedule_container"),i=e("#add-schedule");function d(){let t=a.children().length;e(".remove_sale").toggle(t>1)}d(),a.find(".start-date, .end-date").each(function(){let t=e(this),a=t.hasClass("start-date"),i=a?{dateFormat:"yy-mm-dd",minDate:t.val()}:{dateFormat:"yy-mm-dd",maxDate:t.val()};t.val()&&t.siblings(a?".end-date":".start-date").datepicker(i)}),a.on("focus change",".start-date, .end-date",function(){let t=e(this).hasClass("start-date"),a=t?e(this):e(this).siblings(".start-date"),i=t?e(this).siblings(".end-date"):e(this);a.datepicker({dateFormat:"yy-mm-dd",onSelect:function(e){i.datepicker("option","minDate",e)}}),i.datepicker({dateFormat:"yy-mm-dd",onSelect:function(e){a.datepicker("option","maxDate",e)}})}),i.on("click",()=>{let t=e(".schedule-pricing-fields").first().clone();t.find("input").val(""),t.find(".remove_sale").show(),a.append(t),d(),e(".start-date, .end-date").removeClass("hasDatepicker"),e(".start-date, .end-date").attr("id","")}),a.on("click",".remove_sale",t=>{t.preventDefault(),a.children().length>1&&(e(t.currentTarget).closest(".schedule-pricing-fields").remove(),d())}),a.on("keyup change",".schedule-sale-price",function(){let a=parseFloat(e(this).val());e(this)[0].setCustomValidity(""),a>=t?e(document.body).triggerHandler("wc_add_error_tip",[e(this),"i18n_sale_less_than_regular_error",]):e(document.body).triggerHandler("wc_remove_error_tip",[e(this),"i18n_sale_less_than_regular_error"])}),a.on("focusout",".schedule-sale-price",function(){let a=parseFloat(e(this).val());a&&(a>=t?e(this).val(""):e(this).val(parseFloat(a).toFixed(2)))})});1 jQuery(document).ready((e=>{const t=e("#schedule_container"),a=e("#add-schedule");function s(){const a=t.children().length;e(".remove_sale").toggle(a>1)}s(),t.find(".start-date, .end-date").each((function(){const t=e(this),a=t.hasClass("start-date"),s=a?".end-date":".start-date",r=a?{dateFormat:"yy-mm-dd",minDate:t.val()}:{dateFormat:"yy-mm-dd",maxDate:t.val()};t.val()&&t.siblings(s).datepicker(r)})),t.on("focus change",".start-date, .end-date",(function(){const t=e(this).hasClass("start-date"),a=t?e(this):e(this).siblings(".start-date"),s=t?e(this).siblings(".end-date"):e(this);a.datepicker({dateFormat:"yy-mm-dd",onSelect:function(e){s.datepicker("option","minDate",e)}}),s.datepicker({dateFormat:"yy-mm-dd",onSelect:function(e){a.datepicker("option","maxDate",e)}})})),a.on("click",(()=>{const a=e(".schedule-pricing-fields").first().clone();a.find("input").val(""),a.find(".remove_sale").show(),t.append(a),s(),e(".start-date, .end-date").removeClass("hasDatepicker"),e(".start-date, .end-date").attr("id","")})),t.on("click",".remove_sale",(a=>{a.preventDefault(),t.children().length>1&&(e(a.currentTarget).closest(".schedule-pricing-fields").remove(),s())})),t.on("keyup change",".schedule-sale-price",(function(){const t=parseFloat(e("#_regular_price").val()),a=parseFloat(e(this).val());e(this)[0].setCustomValidity(""),!t||a>=t?e(document.body).triggerHandler("wc_add_error_tip",[e(this),"i18n_sale_less_than_regular_error"]):e(document.body).triggerHandler("wc_remove_error_tip",[e(this),"i18n_sale_less_than_regular_error"])})),t.on("focusout",".schedule-sale-price",(function(){const t=parseFloat(e("#_regular_price").val()),a=parseFloat(e(this).val());a&&(!t||a>=t?e(this).val(""):e(this).val(parseFloat(a).toFixed(2)))}))})); -
multiple-sale-scheduler-for-woocommerce/trunk/multiple-sale-scheduler.php
r3233663 r3284835 2 2 /** 3 3 * Plugin name: Multiple Sale Scheduler for WooCommerce 4 *5 4 * Description: Plugin that enables you to easily schedule multiple sales in WooCommerce. It has been tested and works seamlessly with both simple and grouped product types. 6 5 * Author: Vishal Mori … … 10 9 * License: GPL v2 or later 11 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 * Version: 1.0.011 * Version: 2.0.0 13 12 * 14 13 * @package Multiple Sale Scheduler 15 14 */ 16 15 17 defined( 'ABSPATH' ) || exit; 16 if ( ! defined( 'ABSPATH' ) ) { 17 exit; 18 } 18 19 19 20 if ( ! defined( 'MSSWC_VERSION' ) ) { 20 define( 'MSSWC_VERSION', ' 1.0.0' );21 define( 'MSSWC_VERSION', '2.0.0' ); 21 22 } 22 23 … … 25 26 } 26 27 27 require_once __DIR__ . '/ vendor/autoload.php';28 require_once __DIR__ . '/ includes/wrapper.php';28 require_once __DIR__ . '/autoload.php'; 29 require_once __DIR__ . '/helpers/wrapper.php'; 29 30 30 31 if ( ! function_exists( 'msswc_plugin_activation' ) ) { -
multiple-sale-scheduler-for-woocommerce/trunk/readme.txt
r3233663 r3284835 1 1 === Multiple Sale Scheduler for WooCommerce === 2 Contributors: vishalmori 3 Tags: Sale, Sale Scheduler, Product Discounts, sale Schedulerfor WooCommerce4 Requires at least: 6. 05 Tested up to: 6. 72 Contributors: vishalmori, dhruval04, krishaweb 3 Tags: sale, sale scheduler, bulk sale, sale for WooCommerce 4 Requires at least: 6.1 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.0.07 Stable tag: 2.0.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 19 19 Multiple sale scheduler will not override it. 20 20 21 == Screenshots == 22 23 **Sale Fields** - This is how it looks. 24 **Multiple Fields** - Multiple sale price fields for product. 25 26 == Features == 27 28 1) Schedule multiple sales for WooCommerce products. 29 2) Works seamlessly with the REST API, ideal for headless WooCommerce setups. 30 3) Set start and end dates for each sale. 31 4) Automatically apply sale prices during the scheduled period. 32 5) Easy-to-use interface within WooCommerce product settings. 33 6) Compatible with the latest WooCommerce and WordPress versions. 34 35 == Why Use Multiple Sale Scheduler? == 36 37 Manually managing multiple sales can be time-consuming and prone to errors. Multiple Sale Scheduler simplifies the process by automating sales scheduling, ensuring they start and stop on time. Focus on growing your business while the plugin handles your promotions. 38 39 == Frequently Asked Questions == 40 41 = Is Multiple Sale Scheduler free? = 42 43 Yes, the plugin is licensed under GPL-2.0 and is free to use and modify. 44 45 = Does this plugin support variable products? = 46 47 No, this plugin curently supports only simple and grouped products. 48 49 = Can I use this plugin for headless WooCommerce? = 50 51 Yes, this plugin is fully compatible with the WooCommerce REST API, making it ideal for headless setups. 52 53 = Does the plugin work with custom product types? = 54 55 The plugin supports standard WooCommerce product types. For custom types, additional compatibility may be needed. 56 57 = My valid sale isn't working. = 58 59 If your valid sale is not working and you have made changes to the timezone settings, you need to set all sales again, including the WooCommerce default sale. If this does not work, please ask in [the support forum](https://wordpress.org/support/plugin/multiple-sale-scheduler-for-woocommerce/). 60 21 61 == Note == 22 62 - The default WooCommerce sale scheduler cannot be overridden in the following scenarios: … … 24 64 2. When a sale price is set, and the start date, end date, or the entire date range includes the current date. 25 65 26 - Ensure the use of msswc_get_product_ids_on_sale() instead of wc_get_product_ids_on_sale(). 66 - If any change hapen in timezone setting, please check product sale set by MSS( Multiple Sale Scheduler ) plugin. 67 - Developer ensure the use of **msswc_get_product_ids_on_sale()** instead of **wc_get_product_ids_on_sale()**. 27 68 - msswc_get_product_ids_on_sale() will return all product IDs on sale, including those 28 69 scheduled using the Multiple Sale Scheduler plugin. 29 70 - In contrast, wc_get_product_ids_on_sale() only retrieves product IDs set on sale via 30 71 the default WooCommerce sale functionality. 31 32 == Features ==33 34 Schedule multiple sales for WooCommerce products.35 36 Works seamlessly with the REST API, ideal for headless WooCommerce setups.37 38 Set start and end dates for each sale.39 40 Automatically apply sale prices during the scheduled period.41 42 Easy-to-use interface within WooCommerce product settings.43 44 Compatible with the latest WooCommerce and WordPress versions.45 46 == Why Use Multiple Sale Scheduler? ==47 48 Manually managing multiple sales can be time-consuming and prone to errors. Multiple Sale Scheduler simplifies the process by automating sales scheduling, ensuring they start and stop on time. Focus on growing your business while the plugin handles your promotions.49 72 50 73 == Installation == … … 60 83 In general product data tab you can see new field if product type is simple or grouped. 61 84 62 Frequently Asked Questions63 64 Q: Is Multiple Sale Scheduler free?65 66 A: Yes, the plugin is licensed under GPL-2.0 and is free to use and modify.67 68 Q: Does this plugin support variable products?69 70 A: No, this plugin curently supports only simple and grouped products.71 72 Q: Can I use this plugin for headless WooCommerce?73 74 A: Yes, this plugin is fully compatible with the WooCommerce REST API, making it ideal for headless setups.75 76 Q: Does the plugin work with custom product types?77 78 A: The plugin supports standard WooCommerce product types. For custom types, additional compatibility may be needed.79 80 85 Changelog 81 86 82 1.0.087 2.0.0 83 88 84 Initial release. 89 Major change in file structure. 90 - Removed entaire autoloader and its vendor folder, composer.json, composer.lock. 91 - Moved wrapper.php in new helpers folder. 92 - Introduce new autoload.php to load classes in mss plugin. 93 - Changed class file name PSR-4 autoloading standard to WordPress coding standards. 85 94 86 Schedule sales for products. 95 * Fix - Fix date conflict in msswc_display_scheduled_sale_prices(). 96 * Enhancement - msswc_get_product_ids_on_sale() no longer uses wc_get_product_ids_on_sale(). 97 * Enhancement - msswc_save_scheduled_sales() now executes only when the post type product is created/saved. 98 * Update - Added validation to check if the regular price is set or not. 87 99 88 100 License
Note: See TracChangeset
for help on using the changeset viewer.