Plugin Directory

Changeset 3337514


Ignore:
Timestamp:
07/31/2025 10:03:51 PM (7 months ago)
Author:
patternsinthecloud
Message:

version 2.9.4

Location:
autoship-cloud/trunk
Files:
182 added
7 edited

Legend:

Unmodified
Added
Removed
  • autoship-cloud/trunk/app/Core/FeatureManager.php

    r3303202 r3337514  
    3232        'quicklaunch_reset'                    => false,
    3333        'quicklaunch_display_beacon'           => true,
     34        'quicklaunch_phone_required'           => true,
    3435    );
    3536
  • autoship-cloud/trunk/app/Modules/Quicklaunch/SetupStepHandler.php

    r3299545 r3337514  
    1010
    1111use Autoship\Core\Environment;
     12use Autoship\Core\FeatureManager;
    1213
    1314/**
     
    3031    }
    3132
    32 
    33 
    3433    /**
    3534     * Handles the quicklaunch steps.
     
    244243            'autoship_quicklauncher',
    245244            array(
    246                 'ajax_url'  => admin_url( 'admin-ajax.php' ),
    247                 'admin_url' => admin_url( 'admin.php?page=dashboard' ),
     245                'ajax_url'       => admin_url( 'admin-ajax.php' ),
     246                'admin_url'      => admin_url( 'admin.php?page=dashboard' ),
     247                'phone_required' => FeatureManager::is_enabled( 'quicklaunch_phone_required' ),
    248248            )
    249249        );
     250
     251        wp_enqueue_style( 'autoship_intl_tel_utils_styles', $plugin_url . 'assets/libs/intl-tel-input/css/intlTelInput.min.css', array(), $version );
     252        wp_enqueue_script( 'autoship_intl_tel_utils_script', $plugin_url . 'assets/libs/intl-tel-input/js/intlTelInputWithUtils.min.js', array(), $version, true );
    250253    }
    251254
  • autoship-cloud/trunk/autoship.php

    r3336191 r3337514  
    88 * Plugin URI: https://autoship.cloud
    99 * Description: Autoship Cloud for WooCommerce
    10  * Version: 2.9.3
     10 * Version: 2.9.4
    1111 * Author: Patterns In the Cloud LLC
    1212 * Author URI: https://qpilot.cloud
     
    1717 */
    1818
    19 define( 'Autoship_Version', '2.9.3' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
     19define( 'Autoship_Version', '2.9.4' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    2020
    2121if ( ! defined( 'Autoship_Plugin_Dir' ) ) {
  • autoship-cloud/trunk/js/quicklaunch.js

    r3299545 r3337514  
    9292        }
    9393
     94        const iti = window.intlTelInput.getInstance(document.querySelector("#autoship-registration-phone-local"));
     95
    9496        let account = {
    9597            action:   'autoship_quicklaunch_registration_handler',
    9698            email:    $('#autoship-registration-email').val().trim(),
    9799            password: $('#autoship-registration-password').val(),
    98             phone:    $('#autoship-registration-phone').val().trim()
     100            phone:    ''
    99101        };
    100102
     103        // Up to this point, the phone number is valid or empty if it's not required.
     104        account.phone = iti.getNumber();
    101105        if (account.phone === '') {
    102106            account.phone = '0000000000';
    103107        }
     108
     109        // Remove the '+' sign from the phone number.
     110        account.phone = account.phone.replace(/\+/g, '');
    104111
    105112        $.ajax({
     
    515522        $.post(autoship_quicklauncher.ajax_url, data, function(response) {
    516523            $('#autoship-quicklaunch-content').html(response);
     524
     525            enablePhoneInput();
    517526        });
    518527    }
     
    596605
    597606        const confirmation = $('#autoship-registration-confirmation').val();
    598         if (confirmation === '' || !isValidPassword(password)) {
     607        if (confirmation === '' || !isValidPassword(confirmation)) {
    599608            showFieldErrorLabel($('#autoship-registration-confirmation'));
    600609            showFormErrorMessage('The password must be between 10 and 16 characters.');
     
    607616
    608617            valid = false;
     618        }
     619
     620        // Check if the phone number is required.
     621        autoship_quicklauncher.phone_required = autoship_quicklauncher.phone_required ?? true;
     622       
     623        const iti = window.intlTelInput.getInstance(document.querySelector("#autoship-registration-phone-local"));
     624        let phone = iti.getNumber();
     625
     626        if (autoship_quicklauncher.phone_required || (phone !== '')) {
     627           
     628            if (valid && iti && !iti.isValidNumber()) {
     629                $('#autoship-registration-phone-local-label').addClass('autoship-invalid-field');
     630                showFormErrorMessage('The phone number must be valid.');
     631
     632                valid = false;
     633            }
    609634        }
    610635
     
    833858    }
    834859
     860    const enablePhoneInput = function() {
     861        const phoneNumberInput = document.querySelector('#autoship-registration-phone-local');
     862        if (phoneNumberInput != null) {
     863            const iti = window.intlTelInput(phoneNumberInput, {
     864                separateDialCode: false,
     865                initialCountry: 'us',
     866                preferredCountries: ['us']
     867            });
     868
     869            phoneNumberInput.addEventListener('input', function(event) {
     870                this.value = this.value.replace(/[^0-9]/g, '');
     871            });
     872        }
     873    }
     874
     875    enablePhoneInput();
    835876});
  • autoship-cloud/trunk/readme.txt

    r3336191 r3337514  
    1010WC tested up to: 10.0.4
    1111Requires PHP: 7.4
    12 Stable tag: 2.9.3
     12Stable tag: 2.9.4
    1313License: GPLv2 or later
    1414License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    292292== Changelog ==
    293293
     294= 2.9.4 - 2025-07-31 =
     295
     296  - Improved! The plugin onboarding "Quicklaunch" now requires a Merchant's phone number, enabling merchants to receive faster support and timely updates.
     297
    294298= 2.9.3 - 2025-07-29 =
    295299
     
    362366= 2.8.4 - 2025-03-24 =
    363367
    364 - Fixed: Improved the customer experience when adding and updating Items in My Account > Scheduled Orders when using the Native Ui. This is due to corrected HTML properties verfication when loading products in the Native Ui over JS.
     368- Fixed: Improved the customer experience when adding and updating Items in My Account > Scheduled Orders when using the Native Ui. This is due to corrected HTML properties verification when loading products in the Native Ui over JS.
    365369 
    366370- New! Added a new bulk utility in Autoship Cloud > Settings >> Utilities that enable wholesale suite customers to sync wholesale pricing rules to existing Scheduled Orders
  • autoship-cloud/trunk/styles/quicklaunch.css

    r3299545 r3337514  
    468468    margin-top: 10px !important; display:block;
    469469}
     470
     471.iti {
     472    width: 100% !important;
     473}
  • autoship-cloud/trunk/templates/quicklaunch/step-register.php

    r3299545 r3337514  
    77 */
    88
     9use Autoship\Core\FeatureManager;
     10
    911defined( 'ABSPATH' ) || exit;
    1012
    11 $wizard_user = wp_get_current_user();
    12 $username    = $wizard_user->user_login;
    13 $email       = $wizard_user->user_email;
     13$wizard_user    = wp_get_current_user();
     14$username       = $wizard_user->user_login;
     15$email          = $wizard_user->user_email;
     16$phone_required = FeatureManager::is_enabled( 'quicklaunch_phone_required' );
    1417?>
    1518
     
    4346
    4447        <div class="autoship-mb-20">
    45             <label for="autoship-registration-phone" class="autoship-quicklaunch-field-label">
    46                 <?php echo esc_html( __( 'Phone Number', 'autoship' ) ); ?> <small><?php echo esc_html( __( '(optional)', 'autoship' ) ); ?>
    47             </label>
    48             <input type="text" minlength="10" maxlength="16" id="autoship-registration-phone" name="autoship-registration-phone" class="autoship-quicklaunch-field-text" placeholder="<?php echo esc_attr( __( 'Enter your phone number', 'autoship' ) ); ?>"/>
     48            <div class="autoship-mb-20">
     49                <label id="autoship-registration-phone-local-label" for="autoship-registration-phone-local" class="autoship-quicklaunch-field-label">
     50                    <?php echo esc_html( __( 'Phone Number', 'autoship' ) ); ?>
     51                    <?php if ( ! $phone_required ) : ?>
     52                        <small><?php echo esc_html( __( '(optional)', 'autoship' ) ); ?></small>
     53                    <?php endif; ?>
     54                </label>
     55                <input type="text" id="autoship-registration-phone-local" class="autoship-quicklaunch-field-text" placeholder="<?php echo esc_attr( __( 'Enter your phone number', 'autoship' ) ); ?>" inputmode="numeric" pattern="\d{7,15}" maxlength="15" />
     56            </div>
    4957        </div>
    5058
Note: See TracChangeset for help on using the changeset viewer.