Plugin Directory

Changeset 3084675


Ignore:
Timestamp:
05/10/2024 04:30:10 PM (22 months ago)
Author:
biggidroid
Message:

Added update

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

Legend:

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

    r3043344 r3084675  
    66Requires at least: 3.6.0
    77Requires PHP: 7.0
    8 Tested up to: 6.4
    9 Stable tag: 4.1.6
     8Tested up to: 6.5
     9Stable tag: 4.1.7
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • ade-custom-shipping/trunk/ade-custom-shipping.php

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

    r3014827 r3084675  
    5252    //array unique
    5353    var unique_state = [...new Set(data_options.state)];
    54     var state_options = "";
     54    //set placeholder for state_options
     55    var state_options = "<option value=''>Select State</option>";
    5556    $.each(unique_state, function (indexInArray, valueOfElement) {
    5657      state_options += `<option value="${valueOfElement}">${valueOfElement}</option>`;
     
    8384      e.preventDefault();
    8485      var state = $(this).val();
    85       var lga = "";
     86      //set placeholder for lga
     87      var lga = "<option value=''>Select Town / City</option>";
    8688      $.each(data_options.city, function (indexInArray, valueOfElement) {
    8789        if (valueOfElement.state === state) {
     
    9395        $("#ade_custom_shipping_state").after(`
    9496        <p class="form-row validate-required address-field form-row-wide" id="ade_custom_shipping_lga" >
    95           <label for="ade_custom_shipping_lga">City</label>
     97          <label for="ade_custom_shipping_lga">Town / City</label>
    9698          <select name="ade_custom_shipping_lga" class="lga_select" style="    width: 100% !important;" onchange="adesetValue(this)">
    9799              ${lga}
     
    101103        //select2 init
    102104        $('select[name="ade_custom_shipping_lga"]').select2({
    103           placeholder: "Select City"
     105          placeholder: "Select Town / City"
    104106        });
    105107
     
    115117        //update select2
    116118        $('select[name="ade_custom_shipping_lga"]').select2({
    117           placeholder: "Select City"
     119          placeholder: "Select Town / City"
    118120        });
    119121
  • ade-custom-shipping/trunk/assets/js/wc-custom-checkout.js

    r3014827 r3084675  
    9393  var state_options = "";
    9494  $.each(unique_state, function (indexInArray, valueOfElement) {
    95     state_options += `<option value="${valueOfElement}" ${
    96       valueOfElement == ade_billing_state ? "selected" : ""
    97     }>${valueOfElement}</option>`;
     95    state_options += `<option value="${valueOfElement}">${valueOfElement}</option>`;
    9896  });
    9997  $("#billing_country_field").after(`
     
    109107
    110108  let do_ade_calculation = (state, lga) => {
     109    //set placeholder for lga
     110    lga = `<option value="">Select Town / City</option>`;
     111    //loop through data_options.city
    111112    $.each(data_options.city, function (indexInArray, valueOfElement) {
    112113      if (valueOfElement.state === state) {
    113         lga += `<option value="${valueOfElement.lga}" ${
    114           valueOfElement.lga == ade_billing_city ? "selected" : ""
    115         }>${valueOfElement.lga}</option>`;
     114        lga += `<option value="${valueOfElement.lga}">${valueOfElement.lga}</option>`;
    116115      }
    117116    });
     
    120119      $("#ade_custom_shipping_state2").after(`
    121120        <p class="form-row address-field validate-required validate-state form-row-wide woocommerce-validated" id="ade_custom_shipping_lga2" >
    122           <label for="ade_custom_shipping_lga2">City <abbr class="required" title="required">*</abbr></label>
     121          <label for="ade_custom_shipping_lga2">Town / City <abbr class="required" title="required">*</abbr></label>
    123122          <span class="woocommerce-input-wrapper">
    124123            <select name="ade_custom_shipping_lga2" class="lga_select" style="    width: 100% !important;" onchange="adesetValue2(this)">
     
    130129      //select2 init
    131130      $('select[name="ade_custom_shipping_lga2"]').select2({
    132         placeholder: "Select City"
     131        placeholder: "Select Town / City"
    133132      });
    134133      //check if select[name="ade_custom_shipping_lga2"] has selected option
     
    143142      //update select2
    144143      $('select[name="ade_custom_shipping_lga2"]').select2({
    145         placeholder: "Select City"
     144        placeholder: "Select Town / City"
    146145      });
    147146
Note: See TracChangeset for help on using the changeset viewer.