Changeset 3084675
- Timestamp:
- 05/10/2024 04:30:10 PM (22 months ago)
- Location:
- ade-custom-shipping/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
ade-custom-shipping.php (modified) (1 diff)
-
assets/js/wc-custom-cart.js (modified) (5 diffs)
-
assets/js/wc-custom-checkout.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ade-custom-shipping/trunk/README.md
r3043344 r3084675 6 6 Requires at least: 3.6.0 7 7 Requires PHP: 7.0 8 Tested up to: 6. 49 Stable tag: 4.1. 68 Tested up to: 6.5 9 Stable tag: 4.1.7 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
ade-custom-shipping/trunk/ade-custom-shipping.php
r3043344 r3084675 7 7 * Author URI: https://adeleyeayodeji.com 8 8 * Description: Add shipping zones 3 levels deep for ecommerce. 9 * Version: 4.1. 69 * Version: 4.1.7 10 10 * License: GPL2 11 11 * License URL: http://www.gnu.org/licenses/gpl-2.0.txt -
ade-custom-shipping/trunk/assets/js/wc-custom-cart.js
r3014827 r3084675 52 52 //array unique 53 53 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>"; 55 56 $.each(unique_state, function (indexInArray, valueOfElement) { 56 57 state_options += `<option value="${valueOfElement}">${valueOfElement}</option>`; … … 83 84 e.preventDefault(); 84 85 var state = $(this).val(); 85 var lga = ""; 86 //set placeholder for lga 87 var lga = "<option value=''>Select Town / City</option>"; 86 88 $.each(data_options.city, function (indexInArray, valueOfElement) { 87 89 if (valueOfElement.state === state) { … … 93 95 $("#ade_custom_shipping_state").after(` 94 96 <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> 96 98 <select name="ade_custom_shipping_lga" class="lga_select" style=" width: 100% !important;" onchange="adesetValue(this)"> 97 99 ${lga} … … 101 103 //select2 init 102 104 $('select[name="ade_custom_shipping_lga"]').select2({ 103 placeholder: "Select City"105 placeholder: "Select Town / City" 104 106 }); 105 107 … … 115 117 //update select2 116 118 $('select[name="ade_custom_shipping_lga"]').select2({ 117 placeholder: "Select City"119 placeholder: "Select Town / City" 118 120 }); 119 121 -
ade-custom-shipping/trunk/assets/js/wc-custom-checkout.js
r3014827 r3084675 93 93 var state_options = ""; 94 94 $.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>`; 98 96 }); 99 97 $("#billing_country_field").after(` … … 109 107 110 108 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 111 112 $.each(data_options.city, function (indexInArray, valueOfElement) { 112 113 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>`; 116 115 } 117 116 }); … … 120 119 $("#ade_custom_shipping_state2").after(` 121 120 <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> 123 122 <span class="woocommerce-input-wrapper"> 124 123 <select name="ade_custom_shipping_lga2" class="lga_select" style=" width: 100% !important;" onchange="adesetValue2(this)"> … … 130 129 //select2 init 131 130 $('select[name="ade_custom_shipping_lga2"]').select2({ 132 placeholder: "Select City"131 placeholder: "Select Town / City" 133 132 }); 134 133 //check if select[name="ade_custom_shipping_lga2"] has selected option … … 143 142 //update select2 144 143 $('select[name="ade_custom_shipping_lga2"]').select2({ 145 placeholder: "Select City"144 placeholder: "Select Town / City" 146 145 }); 147 146
Note: See TracChangeset
for help on using the changeset viewer.