Plugin Directory

Changeset 3336191


Ignore:
Timestamp:
07/29/2025 07:00:56 PM (7 months ago)
Author:
patternsinthecloud
Message:

version 2.9.3

Location:
autoship-cloud/trunk
Files:
2 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • autoship-cloud/trunk/autoship.php

    r3324496 r3336191  
    88 * Plugin URI: https://autoship.cloud
    99 * Description: Autoship Cloud for WooCommerce
    10  * Version: 2.9.2
     10 * Version: 2.9.3
    1111 * Author: Patterns In the Cloud LLC
    1212 * Author URI: https://qpilot.cloud
     
    1414 * Domain Path: /languages
    1515 * WC requires at least: 3.4.1
    16  * WC tested up to: 9.8.5
    17  */
    18 
    19 define( 'Autoship_Version', '2.9.2' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
     16 * WC tested up to: 10.0.4
     17 */
     18
     19define( 'Autoship_Version', '2.9.3' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    2020
    2121if ( ! defined( 'Autoship_Plugin_Dir' ) ) {
    2222    define( 'Autoship_Plugin_Dir', __DIR__ ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    2323}
     24
    2425if ( ! defined( 'Autoship_Plugin_File' ) ) {
    2526    define( 'Autoship_Plugin_File', __FILE__ ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    2627}
     28
    2729if ( ! defined( 'Autoship_Options_Count' ) ) {
    2830    define( 'Autoship_Options_Count', 5 ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    2931}
     32
    3033if ( ! defined( 'Autoship_Plugin_Folder_Name' ) ) {
    3134    define( 'Autoship_Plugin_Folder_Name', 'autoship-cloud' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    3235}
     36
    3337if ( ! defined( 'Autoship_Plugin_Url' ) ) {
    3438    define( 'Autoship_Plugin_Url', plugin_dir_url( __FILE__ ) ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
     
    5559 */
    5660function autoship_activate() {
    57 
    5861    // Set the flush rewrite rules if not set.
    5962    if ( ! get_option( 'autoship_flush_rewrite_rules_flag' ) ) {
     
    222225
    223226    // While we allow Autoship to be active when requirements fail, no functionality is included.
    224     if ( autoship_check_min_requirements() ) {
    225         autoship_load_includes();
    226         autoship_load_languages();
    227     }
     227    if ( ! autoship_check_min_requirements() ) {
     228        return;
     229    }
     230
     231    autoship_load_includes();
     232    autoship_load_languages();
    228233
    229234    // Initialize the new architecture if autoloader exists.
     
    252257
    253258add_action( 'plugins_loaded', 'autoship_init' );
    254 add_action( 'woocommerce_init', 'autoship_confirm_valid_payment_gateways', 99 );
     259
     260if ( function_exists( 'autoship_confirm_valid_payment_gateways' ) ) {
     261    add_action( 'woocommerce_init', 'autoship_confirm_valid_payment_gateways', 99 );
     262}
    255263
    256264if ( AUTOSHIP_FEATURE_PRODUCT_SYNC_ENABLED ) {
    257     // Register the hooks required for the product sync feature.
    258     add_action( 'init', array( 'Autoship_Synchronizers_Products_Synchronizer', 'init' ) );
    259 
    260     register_deactivation_hook( __FILE__, array( 'Autoship_Synchronizers_Products_Synchronizer', 'disable_sync' ) );
    261 }
     265    if ( class_exists( 'Autoship_Synchronizers_Products_Synchronizer' ) ) {
     266        // Register the hooks required for the product sync feature.
     267        add_action( 'init', array( 'Autoship_Synchronizers_Products_Synchronizer', 'init' ) );
     268
     269        register_deactivation_hook( __FILE__, array( 'Autoship_Synchronizers_Products_Synchronizer', 'disable_sync' ) );
     270    }
     271}
  • autoship-cloud/trunk/js/schedule-options.js

    r3043329 r3336191  
    5353      } else {
    5454        var $id = ( isSimpleProduct( $thisProduct ) ) ?
    55         $thisProduct.find(window.autoshipTemplateData.optionsCls).attr( 'data-autoship-id' ) :
    56         $thisProduct.find(window.autoshipTemplateData.optionsCls).attr( 'data-autoship-variation-id' );
     55            $thisProduct.find(window.autoshipTemplateData.optionsCls).attr( 'data-autoship-id' ) :
     56            $thisProduct.find(window.autoshipTemplateData.optionsCls).attr( 'data-autoship-variation-id' );
    5757      }
    5858
     
    143143
    144144        if ( window.autoshipProductData == undefined )
    145         window.autoshipProductData = [];
     145          window.autoshipProductData = [];
    146146
    147147        if ( window.autoshipProductData[id] == undefined ){
     
    152152
    153153          if ( autoshipProductData == undefined )
    154           return false;
     154            return false;
    155155
    156156          if ( isSimpleProduct( $thisProduct ) ){
     
    178178
    179179        if ( priceInfo != undefined )
    180         displayCustomPrice( $thisProduct, priceInfo.customized_price_enabled && !resetPrice ? priceInfo.autoship_price : priceInfo.original_price, priceInfo.original_price_selector );
     180          displayCustomPrice( $thisProduct, priceInfo.customized_price_enabled && !resetPrice ? priceInfo.autoship_price : priceInfo.original_price, priceInfo.original_price_selector );
    181181
    182182      }
     
    188188
    189189        if ( $priceWrapper.length )
    190         $priceWrapper.html( $priceHTML );
     190          $priceWrapper.html( $priceHTML );
    191191
    192192      }
     
    196196
    197197        if ( selectFrequency( $thisProduct, $autoshipOptions ) )
    198         $autoshipOptions.find(window.autoshipTemplateData.frequencyCls).addClass('active');
     198          $autoshipOptions.find(window.autoshipTemplateData.frequencyCls).addClass('active');
    199199
    200200      };
     
    204204
    205205        if ( show ) {
    206             $autoshipOptions.find('.autoship-discount-label').show();
    207             $autoshipOptions.find('.autoship-no-discount-label').hide();
     206          $autoshipOptions.find('.autoship-discount-label').show();
     207          $autoshipOptions.find('.autoship-no-discount-label').hide();
    208208        } else {
    209             $autoshipOptions.find('.autoship-discount-label').hide();
    210             $autoshipOptions.find('.autoship-no-discount-label').show();
     209          $autoshipOptions.find('.autoship-discount-label').hide();
     210          $autoshipOptions.find('.autoship-no-discount-label').show();
    211211        }
    212212
     
    235235
    236236        if ( option == undefined )
    237         return false;
     237          return false;
    238238
    239239        $autoshipOptions.find(window.autoshipTemplateData.frequencyTypeValCls).val(option.frequency_type);
     
    297297
    298298        if ( autoshipData == undefined )
    299         return;
     299          return;
    300300
    301301        // Grab the selector for the price field.
     
    372372
    373373        if( ( '' == variationId ) || ( variationId == 0 ) )
    374         return;
     374        {
     375
     376          return;
     377        }
     378
     379
    375380
    376381        var $autoshipOptions = $( variationForm ).find(window.autoshipTemplateData.optionsCls);
    377382        var autoshipDataValues = autoshipData( variationId, variationForm );
    378383
     384
    379385        if ( autoshipDataValues ){
    380 
    381386          initAutoshipData( variationForm, autoshipDataValues );
    382387          setVariationId( variationForm, variationId );
     
    389394
    390395          if ( 'yes' == autoshipDataValues.default_autoship_option )
    391           $autoshipYesRadio.prop('checked', true);
    392 
    393           if ( $autoshipYesRadio.is(':checked') )
    394           $autoshipYesRadio.trigger('click');
     396            $autoshipYesRadio.prop('checked', true);
     397
     398          if ( $autoshipYesRadio.is(':checked') ){
     399            setTimeout(function(){
     400              $autoshipYesRadio.trigger('click');
     401            }, 1000);
     402
     403          }
    395404
    396405        } else {
     
    399408        }
    400409
     410        hideDuplicatedPricesContainer();
     411      }
     412
     413      var hideDuplicatedPricesContainer = function(){
     414        if ($('.autoship-price-display').is(':visible') && $('.woocommerce-variation').is(':visible') && $('.woocommerce-variation .price').is(':visible'))
     415        {
     416          $('.autoship-price-display').hide();
     417
     418          // If we are selecting the variation on the first time. Hide the autoship price display and set it as the price. It will be reseted on clicking One Time Purchase.
     419          $('.woocommerce-variation .price').html($('.autoship-price-display').html());
     420        }
    401421      }
    402422
    403423      // Setup Event Handlers
    404424      var initEventHandlers = function( $autoshipOptions ){
    405 
    406425        var selectToggle = function(e){
    407426
     
    415434        var selectDisplayChange = function(e){
    416435
     436
     437
    417438          var $thisProduct              = findProduct( e.target ),
    418439              $autoshipOptions          = $thisProduct.find(window.autoshipTemplateData.optionsCls),
     
    420441              addClass                  = e.data.autoship ? 'autoship-active' : 'autoship-not-active';
    421442
    422               $thisProduct.removeClass( removeClass ).addClass( addClass );
    423 
    424               if ( e.data.autoship ){ selectDisplay( $thisProduct, $autoshipOptions ); }
    425               else { selectHide( $thisProduct, $autoshipOptions ); }
    426 
    427               togglePriceDisplay( $thisProduct, !e.data.autoship );
    428               $(document).trigger( 'autoship_option_change', [ $( this ), $thisProduct, $autoshipOptions ] );
    429 
     443          $thisProduct.removeClass( removeClass ).addClass( addClass );
     444
     445          if ( e.data.autoship ){ selectDisplay( $thisProduct, $autoshipOptions ); }
     446          else { selectHide( $thisProduct, $autoshipOptions ); }
     447
     448          togglePriceDisplay( $thisProduct, !e.data.autoship );
     449          $(document).trigger( 'autoship_option_change', [ $( this ), $thisProduct, $autoshipOptions ] );
     450
     451
     452          hideDuplicatedPricesContainer();
     453
     454          if (!e.data.autoship) {
     455            var variationForm = $(window.autoshipTemplateData.variationFormCls);
     456            var variation     = $(variationForm).data('autoship_woo_variation');
     457
     458            if (variation !== undefined) {
     459              $('.woocommerce-variation .price').html(variation.price_html);
     460            }
     461          }
     462          else{
     463            var priceInfo = priceData[ retrieveProductId( $thisProduct ) ];
     464            if (priceInfo !== undefined) {
     465              $('.woocommerce-variation .price').html(priceInfo.autoship_price);
     466            }
     467          }
    430468        }
    431469
     
    440478        $('body').on( 'found_variation', window.autoshipTemplateData.variationFormCls, function ( e, variation ){
    441479          triggerVariation( e.target, variation.variation_id );
     480
     481          $(e.target).data('autoship_woo_variation', variation);
    442482        });
     483
    443484
    444485      }
     
    461502
    462503      if ( $autoshipOptions.hasClass('is-init') )
    463       return;
     504        return;
    464505
    465506      $autoshipOptions.addClass('is-init');
     
    473514
    474515        if ( productId != undefined )
    475         var autoshipDatavalues = autoshipData( productId, $thisProduct );
     516          var autoshipDatavalues = autoshipData( productId, $thisProduct );
    476517
    477518        if ( !autoshipDatavalues )
    478         return;
     519          return;
    479520
    480521        initAutoshipPriceData( $thisProduct, autoshipDatavalues );
     
    528569      $(this).removeClass('open');
    529570      $( 'body' ).removeClass('autoship-modal-open');
    530    }
     571    }
    531572
    532573  });
  • autoship-cloud/trunk/readme.txt

    r3324496 r3336191  
    66Tags: woocommerce subscriptions, subscribe and save, repeat delivery, subscription box, subscriptions
    77Requires at least: 4.6
    8 Tested up to: 6.8.1
     8Tested up to: 6.8.2
    99WC requires at least: 3.4.1
    10 WC tested up to: 9.8.5
     10WC tested up to: 10.0.4
    1111Requires PHP: 7.4
    12 Stable tag: 2.9.2
     12Stable tag: 2.9.3
    1313License: GPLv2 or later
    1414License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    292292== Changelog ==
    293293
     294= 2.9.3 - 2025-07-29 =
     295
     296  - Fixed: Resolved an issue with the Autoship discounted price displaying twice on some product pages.
     297
     298  - Fixed: Resolved a site wide critical error when upgrading to WooCommerce version 10 through a file upload.
     299
     300  - Fixed: Resolved an issue with prices reflecting incorrectly when switching between one-time purchases and Autoship on product pages.
     301
    294302= 2.9.2 - 2025-07-08 =
    295303
    296  -  New! [FunnelKit Payment Gateway for Stripe WooCommerce](https://wordpress.org/plugins/funnelkit-stripe-woo-payment-gateway/) is now a supported payment integration for Autoship Cloud. Merchants using the FunnelKit Payment Gateway for WooCommerce can now use Autoship with the FunnelKit integration to securely save payment methods during an Autoship Checkout and for processing Autoship Scheduled Orders.
     304  -  New! [FunnelKit Payment Gateway for Stripe WooCommerce](https://wordpress.org/plugins/funnelkit-stripe-woo-payment-gateway/) is now a supported payment integration for Autoship Cloud. Merchants using the FunnelKit Payment Gateway for WooCommerce can now use Autoship with the FunnelKit integration to securely save payment methods during an Autoship Checkout and for processing Autoship Scheduled Orders.
    297305
    298306= 2.9.1 - 2025-06-30 =
Note: See TracChangeset for help on using the changeset viewer.