Plugin Directory

Changeset 2936642


Ignore:
Timestamp:
07/10/2023 04:09:23 PM (3 years ago)
Author:
biggidroid
Message:

Added update

Location:
ade-custom-shipping/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ade-custom-shipping/trunk/README.md

    r2915089 r2936642  
    77Requires PHP: 7.0
    88Tested up to: 6.2
    9 Stable tag: 4.0.9
     9Stable tag: 4.1.0
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4545
    4646== Changelog ==
     47
     48= 4.1.0 =
     49
     50Fix bugs
    4751
    4852= 4.0.9 =
  • ade-custom-shipping/trunk/ade-custom-shipping.php

    r2915089 r2936642  
    77 * Author URI: https://adeleyeayodeji.com
    88 * Description: Add shipping zones 3 levels deep for ecommerce.
    9  * Version: 4.0.9
     9 * Version: 4.1.0
    1010 * License: GPL2
    1111 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt
  • ade-custom-shipping/trunk/assets/js/wc-custom-checkout.js

    r2808775 r2936642  
     1/**
     2 * Ade Custom Shipping | adesetWooInputValues
     3 * @package Ade Custom Shipping
     4 */
     5function adesetWooInputValues() {
     6  jQuery(document).ready(function ($) {
     7    //get the state
     8    var state_select = $('select[name="billing_state"]');
     9    //if not exist
     10    if (!state_select.length) {
     11      return;
     12    }
     13    //get selected option
     14    var selected_option = state_select.find("option:selected").val();
     15    //check if selected_option is not empty
     16    if (selected_option == "") {
     17      //do nothing
     18      return;
     19    }
     20    //set value to input if exists
     21    if (document.querySelector("#billing_city")) {
     22      document.querySelector("#billing_city").value = selected_option;
     23    }
     24    //check if billing_city exists
     25    if (
     26      document.querySelector('form[name="checkout"] input[name="billing_city"]')
     27    ) {
     28      document.querySelector(
     29        'form[name="checkout"] input[name="billing_city"]'
     30      ).value = selected_option;
     31    }
     32    //state
     33    if (
     34      document.querySelector(
     35        'form[name="checkout"] input[name="billing_state"]'
     36      )
     37    ) {
     38      document.querySelector(
     39        'form[name="checkout"] input[name="billing_state"]'
     40      ).value = selected_option;
     41      //custom
     42    }
     43  });
     44}
     45
    146function adesetValue2(elem) {
    247  jQuery(document).ready(function ($) {
     
    1661        }
    1762      });
    18     //get selected option
    19     var selected_option = $('select[name="billing_state"]')
    20       .find("option:selected")
    21       .val();
    22     document.querySelector("#billing_city").value = selected_option;
    23     //form name="checkout" input name billing_city
    24     //custom
    25     document.querySelector(
    26       'form[name="checkout"] input[name="billing_city"]'
    27     ).value = selected_option;
    28     //state
    29     if (
    30       document.querySelector(
    31         'form[name="checkout"] input[name="billing_state"]'
    32       )
    33     ) {
    34       document.querySelector(
    35         'form[name="checkout"] input[name="billing_state"]'
    36       ).value = selected_option;
    37       //custom
    38     }
     63    //update selected option
     64    adesetWooInputValues();
    3965    $(document.body).trigger("update_checkout");
    4066  });
     
    156182      do_ade_calculation(state, lga);
    157183    }
     184    adesetWooInputValues();
    158185  }, 1000);
    159186});
Note: See TracChangeset for help on using the changeset viewer.