Debyink Posted May 20 Share Posted May 20 Is there any way I can get the full delivery addresses to be in CAPITALS, that is: name, surname, address line 1, line 2, town, county/state not bothered about billing address but when I come to export for the shipping some customers use all lower case, some all caps and some a mix. Would help too for my international shipments as the printed address on the labels (set size by Royal Mail) isn't that big. I know I can amend the counties and zones in dashboard but going to take me forever. Thanks in advance Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 20 Share Posted May 20 This would be the printed shipping receipt? Or would you be using a third-party solution that prints your shipping labels? Quote Link to comment Share on other sites More sharing options...
Debyink Posted May 20 Author Share Posted May 20 we copy it from the delivery address that is shown on the order summary page, at the moment it shows as below, but we then spend ages correcting it all, got 80 international orders to do tonight and just so not looking forward to editing all the names and addresses As an example: Billng Address Delivery Address jackie brown jackie brown 1a the Avenue 1a the Avenue MYCITY MYCITY YORKSHIRE, XX20 2KK YORKSHIRE, XX20 2KK UNITED KINGDOM UNITED KINGDOM Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 20 Share Posted May 20 A quick edit to this admin skin template file should work -- until CubeCart gets updated. In the admin skin template file orders.index.php, find: <legend>{$LANG.address.delivery_address}</legend> {$OVERVIEW_SUMMARY.name_d}<br> {if !empty($OVERVIEW_SUMMARY.company_name_d)}{$OVERVIEW_SUMMARY.company_name_d}<br>{/if} <span class="capitalize">{$OVERVIEW_SUMMARY.line1_d}<br> {if !empty($OVERVIEW_SUMMARY.line2_d)}{$OVERVIEW_SUMMARY.line2_d}<br>{/if}</span> Change to: <legend>{$LANG.address.delivery_address}</legend> <span class="uppercase">{$OVERVIEW_SUMMARY.name_d}</span><br> {if !empty($OVERVIEW_SUMMARY.company_name_d)}<span class="uppercase">{$OVERVIEW_SUMMARY.company_name_d}</span><br>{/if} <span class="uppercase">{$OVERVIEW_SUMMARY.line1_d}<br> {if !empty($OVERVIEW_SUMMARY.line2_d)}{$OVERVIEW_SUMMARY.line2_d}<br>{/if}</span> Soon, I will write a code snippet that will do this in a manner that will survive an upgrade. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 20 Share Posted May 20 Here is the code snippet: In admin, Manage Hooks, Code Snippets tab, click the Add Snippet link. A form will appear at the bottom of the list of snippets. Fill it out as follows: Enabled: checked Unique ID: upperdeladdr@cc640+ Execution Order: 99 Description: Uppercases the Delivery Address sent to Smarty Trigger: admin.order.index.display Version: 1.0 Author: forums.cubecart.com/topic/59118-how-to-make-delivery-addresses-all-caps/ Note that at the first line in the PHP Code, I use the names of the first two characters to type. Type the actual characters, no spaces, for that line. (These forums have a security feature that often blocks submissions that look like executable code.) less-than question-mark php $uda_array = array('title_d','name_d','first_name_d','last_name_d','company_name_d','line1_d','line2_d','town_d','state_d','country_d'); $uda_overview_summary = $GLOBALS['smarty']->getTemplateVars('OVERVIEW_SUMMARY'); foreach($uda_array as $uda_field) $uda_overview_summary[$uda_field] = strtoupper($uda_overview_summary[$uda_field]); $GLOBALS['smarty']->assign('OVERVIEW_SUMMARY', $uda_overview_summary); Quote Link to comment Share on other sites More sharing options...
Debyink Posted May 21 Author Share Posted May 21 Thanks Brian, it didn't quite work on mine, got some in caps and bold but so glad you showed me where to look to change it, I'd have been looking through my standard skin templates not the admin one. I found some of the existing lines of code already had this |upper which already made some of the address uppercase, so I've just copied that onto the parts that weren't, now all are upper. {$OVERVIEW_SUMMARY.name_d} changed to {$OVERVIEW_SUMMARY.name_d|upper}, same for {$OVERVIEW_SUMMARY.line1_d } changed to {$OVERVIEW_SUMMARY.line1_d|upper} This is going to save me soooooooooo much time thank you 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.