fettlebox Posted March 7, 2023 Share Posted March 7, 2023 I'm a UK based shop but a good proportion of my orders are from USA. I drag & drop the address details into the Royal Mail Click & Drop online portal to process my postage. The Cubecart address format has the US customers declare their state in long-hand version rather than the shortened ISO format eg South Dakota instead of SD. I have to manually amend these on the Royal Mail portal & occasionally have to double check against a list for some states ISO code that I use infrequently. Is there a way the ISO code for US States could be used on Cubecart instead of long-hand version? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 7, 2023 Share Posted March 7, 2023 You are getting the address items from the admin, Order Summary page? If so, try the following: In the admin /sources/orders.index.inc.php: Near line 419, find: $overview_summary['country'] = is_numeric($overview_summary['country']) ? getCountryFormat($overview_summary['country'], 'numcode', 'name') : $overview_summary['country']; After that, add: $overview_summary['state_abbrev_d'] = is_numeric($overview_summary['state_d']) ? getStateFormat($overview_summary['state_d'], 'id', 'abbrev') : $overview_summary['state_d']; $overview_summary['state_abbrev'] = is_numeric($overview_summary['state']) ? getStateFormat($overview_summary['state'], 'id', 'abbrev') : $overview_summary['state']; In the admin template orders.index.php: Near lines 163-164, from: {$OVERVIEW_SUMMARY.town_d|upper}<br> {if !empty($OVERVIEW_SUMMARY.state_d)}{$OVERVIEW_SUMMARY.state_d|upper}, {/if}{$OVERVIEW_SUMMARY.postcode_d}<br> To: {$OVERVIEW_SUMMARY.town_d|upper} {if !empty($OVERVIEW_SUMMARY.state_abbrev_d)}{$OVERVIEW_SUMMARY.state_abbrev_d|upper}, {/if}{$OVERVIEW_SUMMARY.postcode_d}<br> Near lines 174-175, from: {$OVERVIEW_SUMMARY.town|upper}<br> {if !empty($OVERVIEW_SUMMARY.state)}{$OVERVIEW_SUMMARY.state|upper}, {/if}{$OVERVIEW_SUMMARY.postcode}<br> To: {$OVERVIEW_SUMMARY.town|upper} {if !empty($OVERVIEW_SUMMARY.state_abbrev)}{$OVERVIEW_SUMMARY.state_abbrev|upper}, {/if}{$OVERVIEW_SUMMARY.postcode}<br> 1 Quote Link to comment Share on other sites More sharing options...
fettlebox Posted March 15, 2023 Author Share Posted March 15, 2023 Thankyou. Sorry for delay getting back to this. Just found time to make the edits. Just did a dummy order & the drop down box for customer to select their state was in long format & came through onto the order summary in same format. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.