Changeset 2556394
- Timestamp:
- 06/30/2021 12:49:35 PM (5 years ago)
- Location:
- bosta-woocommerce/trunk
- Files:
-
- 2 edited
-
bosta-woocommerce.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bosta-woocommerce/trunk/bosta-woocommerce.php
r2551357 r2556394 5 5 * Author: Bosta 6 6 * Author URI: https://www.bosta.co/ 7 * Version: 2. 5.9.17 * Version: 2.6 8 8 * Requires at least: 5.0 9 9 * Tested up to: 5.7 … … 70 70 $resultStates[$i] = $states[$i]->districts; 71 71 } 72 return $resultStates; 72 $states=$resultStates; 73 return $states; 73 74 } 74 75 } … … 125 126 126 127 jQuery(function($){ 127 128 128 var opa = <?php echo json_encode($options_a); ?>, 129 129 select1 = 'select[name="_shipping_city"]', … … 294 294 select3 = 'select[name="shipping_city"]', 295 295 select4 = 'select[name="shipping_state"]'; 296 function dynamicSelectOptions( opt,type ){ 296 var selectedCityVal = $("#billing_city option:selected").val(); 297 var selectedAreaVal = $("#billing_state option:selected").val(); 298 function dynamicSelectOptions( opt,cityIndex,type ){ 299 let index=0; 300 for(let i=0;i<cityIndex;i++){ 301 index+=opa[i].flat().length 302 } 303 297 304 var options = ''; 298 299 305 $.each( opt, function( key, value ){ 300 options += '<option value="'+value.zoneName+' - '+value.districtName+'">'+value.zoneName+' - '+value.districtName+'</option>'; 306 const newKey=index+key; 307 options += '<option value='+newKey+'>'+value.zoneName+' - '+value.districtName+'</option>'; 301 308 }); 302 309 type==='billing'? $(select2).html(options): $(select4).html(options); 303 310 } 304 311 305 312 $(select1).change(function(){ 306 313 for (let i = 0; i < opa.length; i++) { 307 314 if( $(this).val() == i ) 308 dynamicSelectOptions( opa[i], 'billing' );315 dynamicSelectOptions( opa[i],i,'billing' ); 309 316 } 310 317 }); … … 313 320 for (let i = 0; i < opa.length; i++) { 314 321 if( $(this).val() == i ) 315 dynamicSelectOptions( opa[i] );322 dynamicSelectOptions( opa[i] ,i); 316 323 } 317 324 }); -
bosta-woocommerce/trunk/readme.txt
r2551357 r2556394 7 7 Requires PHP: 7.0 8 8 Tested up to: 5.7 9 Stable tag: 2. 5.9.19 Stable tag: 2.6 10 10 WC requires at least: 2.6 11 11 WC tested up to: 4.4.1 … … 111 111 * Fix place of description 112 112 * Fix number of items sent to bosta. 113 114 = 2.6 = 115 * Link shipping zones to bosta zones
Note: See TracChangeset
for help on using the changeset viewer.