Plugin Directory

Changeset 3101422


Ignore:
Timestamp:
06/11/2024 09:17:50 PM (21 months ago)
Author:
agechecker
Message:
  • After-Payment verification will no longer initiate on order status page if order status is set to "Failed" (This behavior can be reversed if needed by setting the plugin setting "Trigger Popup on Order Failed" to "Enable popup if order status is failed")
Location:
agecheckernet
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • agecheckernet/trunk/agechecker.php

    r3091123 r3101422  
    44Plugin URI:  https://agechecker.net
    55Description: AgeChecker.Net seamlessly and securely verifies the age of your customers directly on your website during the checkout process. Keep your site up to date on the latest age regulations for your industry while ensuring that purchasing is frustration-free for your site users.
    6 Version:     1.17.0
     6Version:     1.18.0
    77Author:      AgeChecker.Net
    88Author URI:  https://agechecker.net
  • agecheckernet/trunk/class-wc-integration-agechecker-integration.php

    r3091123 r3101422  
    3535        public $role_find_account;
    3636        public $customer_info;
     37        public $trigger_afterpayment_on_failed;
    3738
    3839        public function __construct() {
     
    120121            $this->role_find_account   = $this->get_option('role_find_account');
    121122            $this->customer_info       = $this->get_option('customer_info');
     123            $this->trigger_afterpayment_on_failed = $this->get_option('trigger_afterpayment_on_failed');
    122124
    123125            if($this->get_option('tag_order_setting_updated') != 'true') {
     
    196198                    'description' => 'Element selector to attach the popup event to when using the "Before Payment" workflow. You may need to change this if you use a custom theme/template. Please contact us if the popup is not showing when the element is clicked. The default element is the final checkout button.',
    197199                    'default'     => '#place_order,.wc-block-components-checkout-place-order-button',
     200                    'desc_tip'    => false,
     201                ),
     202                'trigger_afterpayment_on_failed' => array(
     203                    'title'       => 'Trigger Popup on Order Failed',
     204                    'type'        => 'radio',
     205                    'description' => 'Determines whether or not to trigger the verification popup if order status is failed.',
     206                    'default'     => 'disable',
    198207                    'desc_tip'    => false,
    199208                ),
     
    480489                "#woocommerce_integration-agechecker_form_trigger_value", "#woocommerce_integration-agechecker_form_trigger_mode"];
    481490                const afterPaymentFields = ["[for='woocommerce_integration-agechecker_secret']", "#order_status_pendingInput", "#order_status_acceptedInput", "#order_status_deniedInput",
    482                 "#order_status_disabledInput", "#order_status_blockedInput"];
     491                "#order_status_disabledInput", "#order_status_blockedInput","[for='woocommerce_integration-agechecker_trigger_afterpayment_on_failed']"];
    483492
    484493                function changeWorkflow(sel) {
     
    589598                                    <input type="radio" id="<?php echo esc_attr($field); ?>" name="<?php echo esc_attr($field); ?>" value="after_payment" <?php if($workflow_type_choice == "after_payment") echo 'checked'; ?> onclick="changeWorkflow(this.value);"> After Payment - Customers will be prompted with AgeChecker after completing their order. All orders will be submitted, with a status of the verification added to the order custom fields.<br>
    590599                            <?php
    591                                 } else if($key == "enable_noscript") {
     600                                } else if($key == "enable_noscript") { 
    592601                                        $enable_noscript = $this->get_option($key);
    593602                                    ?>
    594603                                        <input type="radio" id="<?php echo esc_attr($field); ?>" name="<?php echo esc_attr($field); ?>" value="enable_noscript" <?php if($enable_noscript == "enable_noscript") echo 'checked'; ?>> Enable Redirection<br>
    595604                                        <input type="radio" id="<?php echo esc_attr($field); ?>" name="<?php echo esc_attr($field); ?>" value="dont_enable_noscript" <?php if($enable_noscript == "dont_enable_noscript") echo 'checked'; ?>> Disable Redirection<br>
     605                                <?php
     606                                    } else if($key == "trigger_afterpayment_on_failed") {
     607                                        $trigger_afterpayment_on_failed = $this->get_option($key);
     608                                    ?>
     609                                        <input type="radio" id="<?php echo esc_attr($field); ?>" name="<?php echo esc_attr($field); ?>" value="enable" <?php if($trigger_afterpayment_on_failed == "enable") echo 'checked'; ?>> Enable popup if order status is failed<br>
     610                                        <input type="radio" id="<?php echo esc_attr($field); ?>" name="<?php echo esc_attr($field); ?>" value="disable" <?php if($trigger_afterpayment_on_failed == "disable") echo 'checked'; ?>> Disable popup if order status is failed<br>
    596611                                <?php
    597612                                } else if($key == "form_trigger_mode") {
     
    18401855
    18411856            $order = new WC_Order($order_id);
     1857            $orderStatus = $order->get_status();
     1858
     1859            if($orderStatus == "failed" && $this->trigger_afterpayment_on_failed == "disable") return;
    18421860
    18431861            $status = $order->get_meta('AgeChecker Status');
  • agecheckernet/trunk/readme.txt

    r3091123 r3101422  
    44Requires at least: 4.4
    55Tested up to: 6.5
    6 Stable tag: 1.17.0
     6Stable tag: 1.18.0
    77
    88AgeChecker.Net seamlessly and securely verifies the age of your customers directly on your website during the checkout process.
     
    6363== Changelog ==
    6464
     65= 1.18.0 =
     66*Release Date - 11 June 2024*
     67
     68* After-Payment verification will no longer initiate on order status page if order status is set to "Failed" (This behavior can be reversed if needed by setting the plugin setting "Trigger Popup on Order Failed" to "Enable popup if order status is failed")
     69
    6570= 1.17.0 =
    6671*Release Date - 22 May 2024*
Note: See TracChangeset for help on using the changeset viewer.