Plugin Directory

Changeset 3284835


Ignore:
Timestamp:
04/30/2025 11:13:44 AM (11 months ago)
Author:
vishalmori
Message:

release 2.0.0.

Location:
multiple-sale-scheduler-for-woocommerce/trunk
Files:
5 edited

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
     3Effortlessly schedule multiple sales for your WooCommerce products, ensuring timely discounts and seamless promotions.
     4
     5# Description
     6
     7Effortlessly 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
     9Default WooCommerce sale functionality is in priority. If product is already on sale then
     10Multiple sale scheduler will not override it.
     11
     12# Why Use Multiple Sale Scheduler?
     13
     14Manually 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
     18Schedule multiple sales for WooCommerce products.
     19
     20Works seamlessly with the REST API, ideal for headless WooCommerce setups.
     21
     22Set start and end dates for each sale.
     23
     24Automatically apply sale prices during the scheduled period.
     25
     26Easy-to-use interface within WooCommerce product settings.
     27
     28Compatible with the latest WooCommerce and WordPress versions.
     29
     30# Installation
     31
     32From the WordPress admin panel, navigate to **Plugins > Add New**. Search for "Multiple Sale Scheduler for WooCommerce," then install and activate it.
     33
     34Alternatively, upload the plugin files to the /wp-content/plugins/ directory and activate the plugin via the **Plugins** screen.
     35
     36Activate the plugin through the 'Plugins' screen in WordPress.
     37
     38Navigate to the product edit page in WooCommerce to start scheduling sales.
     39
     40In general product data tab you can see new field if product type is simple or grouped.
     41
     42# Frequently Asked Questions
     43
     44Q 1): Is Multiple Sale Scheduler free?
     45
     46A: Yes, the plugin is licensed under GPL-2.0 and is free to use and modify.
     47
     48Q 2): Does this plugin support variable products?
     49
     50A: No, this plugin curently supports only simple and grouped products.
     51
     52Q 3): Can I use this plugin for headless WooCommerce?
     53
     54A: Yes, this plugin is fully compatible with the WooCommerce REST API, making it ideal for headless setups.
     55
     56Q 4): Does the plugin work with custom product types?
     57
     58A: The plugin supports standard WooCommerce product types. For custom types, additional compatibility may be needed.
     59
     60Q 5) My valid sale isn't working.
     61
     62A: 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.
    268
    369# Developer Note
     
    773
    874 - In contrast, wc_get_product_ids_on_sale() only retrieves product IDs set on sale via the default WooCommerce sale functionality.
     75
     76Changelog
     77
     782.0.0
     79
     80Major 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
     91License
     92
     93Multiple 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  
    11jQuery(document).ready(($) => {
    2   const regularPrice = parseFloat($("#_regular_price").val());
    32  const scheduleContainer = $("#schedule_container");
    43  const addScheduleButton = $("#add-schedule");
     
    2827    startDateField.datepicker({
    2928      dateFormat: "yy-mm-dd",
    30       onSelect: function (selectedDate) { ;
     29      onSelect: function (selectedDate) {
    3130        endDateField.datepicker("option", "minDate", selectedDate);
    3231      }
    3332    });
    34     endDateField.datepicker({ 
     33    endDateField.datepicker({
    3534      dateFormat: "yy-mm-dd",
    36       onSelect: function (selectedDate) { 
     35      onSelect: function (selectedDate) {
    3736        startDateField.datepicker("option", "maxDate", selectedDate);
    3837      }
     
    4645    scheduleContainer.append(clone);
    4746    toggleRemoveButtons();
    48    
     47
    4948    $(".start-date, .end-date").removeClass("hasDatepicker");
    5049    $(".start-date, .end-date").attr("id", "");
     
    5352  scheduleContainer.on("click", ".remove_sale", (e) => {
    5453    e.preventDefault();
    55     if ( scheduleContainer.children().length > 1 ) {
     54    if (scheduleContainer.children().length > 1) {
    5655      $(e.currentTarget).closest(".schedule-pricing-fields").remove();
    5756      toggleRemoveButtons();
     
    5958  });
    6059
    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);
    6263    const salePrice = parseFloat($(this).val());
    6364    // To remove the custom validation message set by the "focusout" event.
    6465    $(this)[0].setCustomValidity("");
    6566
    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),
    6970        "i18n_sale_less_than_regular_error",
    70       ] );
     71      ]);
    7172    } 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"]
    7576      );
    7677    }
    7778  });
    7879
    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);
    8083    const salePrice = parseFloat($(this).val());
    81     if ( !salePrice ) {
    82       return;   
     84    if (!salePrice) {
     85      return;
    8386    }
    84     if ( salePrice >= regularPrice ) {
     87    if (!regularPrice || salePrice >= regularPrice) {
    8588      $(this).val("");
    8689    } 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)))})});
     1jQuery(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  
    22/**
    33 * Plugin name: Multiple Sale Scheduler for WooCommerce
    4  *
    54 * 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.
    65 * Author: Vishal Mori
     
    109 * License:         GPL v2 or later
    1110 * License URI:     https://www.gnu.org/licenses/gpl-2.0.html
    12  * Version:         1.0.0
     11 * Version:         2.0.0
    1312 *
    1413 * @package Multiple Sale Scheduler
    1514 */
    1615
    17 defined( 'ABSPATH' ) || exit;
     16if ( ! defined( 'ABSPATH' ) ) {
     17    exit;
     18}
    1819
    1920if ( ! defined( 'MSSWC_VERSION' ) ) {
    20     define( 'MSSWC_VERSION', '1.0.0' );
     21    define( 'MSSWC_VERSION', '2.0.0' );
    2122}
    2223
     
    2526}
    2627
    27 require_once __DIR__ . '/vendor/autoload.php';
    28 require_once __DIR__ . '/includes/wrapper.php';
     28require_once __DIR__ . '/autoload.php';
     29require_once __DIR__ . '/helpers/wrapper.php';
    2930
    3031if ( ! function_exists( 'msswc_plugin_activation' ) ) {
  • multiple-sale-scheduler-for-woocommerce/trunk/readme.txt

    r3233663 r3284835  
    11=== Multiple Sale Scheduler for WooCommerce ===
    2 Contributors: vishalmori
    3 Tags: Sale, Sale Scheduler, Product Discounts, sale Scheduler for WooCommerce
    4 Requires at least: 6.0
    5 Tested up to: 6.7
     2Contributors: vishalmori, dhruval04, krishaweb
     3Tags: sale, sale scheduler, bulk sale, sale for WooCommerce
     4Requires at least: 6.1
     5Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.0
     7Stable tag: 2.0.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1919Multiple sale scheduler will not override it.
    2020
     21== Screenshots ==
     22
     23**Sale Fields** - This is how it looks.
     24**Multiple Fields** - Multiple sale price fields for product.
     25
     26== Features ==
     27
     281) Schedule multiple sales for WooCommerce products.
     292) Works seamlessly with the REST API, ideal for headless WooCommerce setups.
     303) Set start and end dates for each sale.
     314) Automatically apply sale prices during the scheduled period.
     325) Easy-to-use interface within WooCommerce product settings.
     336) Compatible with the latest WooCommerce and WordPress versions.
     34
     35== Why Use Multiple Sale Scheduler? ==
     36
     37Manually 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
     43Yes, the plugin is licensed under GPL-2.0 and is free to use and modify.
     44
     45= Does this plugin support variable products? =
     46
     47No, this plugin curently supports only simple and grouped products.
     48
     49= Can I use this plugin for headless WooCommerce? =
     50
     51Yes, 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
     55The plugin supports standard WooCommerce product types. For custom types, additional compatibility may be needed.
     56
     57= My valid sale isn't working. =
     58
     59If 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
    2161== Note ==
    2262 - The default WooCommerce sale scheduler cannot be overridden in the following scenarios:
     
    2464    2. When a sale price is set, and the start date, end date, or the entire date range includes the current date.
    2565
    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()**.
    2768 - msswc_get_product_ids_on_sale() will return all product IDs on sale, including those
    2869   scheduled using the Multiple Sale Scheduler plugin.
    2970 - In contrast, wc_get_product_ids_on_sale() only retrieves product IDs set on sale via
    3071   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.
    4972
    5073== Installation ==
     
    6083In general product data tab you can see new field if product type is simple or grouped.
    6184
    62 Frequently Asked Questions
    63 
    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 
    8085Changelog
    8186
    82 1.0.0
     872.0.0
    8388
    84 Initial release.
     89Major 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.
    8594
    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.
    8799
    88100License
Note: See TracChangeset for help on using the changeset viewer.