mystifier_uk Posted June 27, 2006 Posted June 27, 2006 When a customer makes an order and it comes up in the Admin > Orders section the name and address are typical displayed as follows: Anne Other Pipers Way Thatcham, RG19 4LZ Berkshire, United Kingdom But I need to have the address display like this: Anne Other Pipers Way Thatcham, Berkshire RG19 4LZ, United Kingdom Basically I need the postcode (zip code) to change places with the county/state. I've been looking around for a solution but with no luck! :blink: I know it's only a small thing but does anyone have any ideas? Thanks in advance!
warrenerjm Posted June 28, 2006 Posted June 28, 2006 Anyone? Hi Micheal I've asked this before & I think the answer is No. I have managed to change the customer create_account around, but not on the admin side, so I'll be watching this thread just incase you are lucky to find an answer. Julie
Guest Posted June 28, 2006 Posted June 28, 2006 Hi Micheal I've asked this before & I think the answer is No. I have managed to change the customer create_account around, but not on the admin side, so I'll be watching this thread just incase you are lucky to find an answer. Julie Can you tell me where abouts you changed it for the customer screen? Thanks, Mark.
1Putts Posted June 28, 2006 Posted June 28, 2006 When a customer makes an order and it comes up in the Admin > Orders section the name and address are typical displayed as follows: Anne Other Pipers Way Thatcham, RG19 4LZ Berkshire, United Kingdom But I need to have the address display like this: Anne Other Pipers Way Thatcham, Berkshire RG19 4LZ, United Kingdom Basically I need the postcode (zip code) to change places with the county/state. I've been looking around for a solution but with no luck! :blink: I know it's only a small thing but does anyone have any ideas? Thanks in advance! The first thing I would look at is, under admin -> locations / taxes -> countries...try changing the Address Format for United Kingdom from 1 to 2 (I don't know offhand if there are more than 2). For customer registrations etc., the format of the address is taken from catalog/modules/address_book_details.php. So, from the customers viewpoint, that's where you can change the order in which the various address lines are shown. This may not do exactly what you're after but may at least get you started in the right direction.
1Putts Posted June 28, 2006 Posted June 28, 2006 Follow up to my previous post... I just took a look at the address_format table in the database. There are 5 address formats to choose form. So you can take a look at them and either modify one to suit your needs or add a new one. The "cr" that you see in the address_format field I guess stands for "carriage return".
abra123cadabra Posted June 28, 2006 Posted June 28, 2006 You can change the format assigned to the country as mentioned above. If there is no format that suits your needs, you can add one to the database table address_format. You can see there how the others are defined. The code to process the address output can be found in /includes/functions/general.php. It should be fairly easy to create a new address format. abra The First Law of E-Commerce: If the user can't find the product, the user can't buy the product. Feedback and suggestions on my shop welcome. Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.
mystifier_uk Posted June 28, 2006 Author Posted June 28, 2006 Thanks for all the replies. But unfortunately when I change the UK address format to 2, 3, 4 or 5 instead of 5 and I return to the 'Orders' section the address layout seems to be exactly the same! :blink:
1Putts Posted June 29, 2006 Posted June 29, 2006 Thanks for all the replies. But unfortunately when I change the UK address format to 2, 3, 4 or 5 instead of 5 and I return to the 'Orders' section the address layout seems to be exactly the same! :blink: I think it will only work on orders placed after you made the change. I seem to remember having the same problem when I was futzing around with the address format. Try putting in a test order with the changes and see what happens.
mystifier_uk Posted June 29, 2006 Author Posted June 29, 2006 Thanks - I tried a new order and the address format changed to: Anne Other Pipers Way Thatcham, Berkshire RG19 4LZ United Kingdom I know it's a little problem but I find that there is no comma (,) between the state and the zip code (i.e. Berkshire & RG19 4LZ). Is there anywhere in the core files I can just insert this?
mark27uk3 Posted June 29, 2006 Posted June 29, 2006 Hi Michael, I have just done this on my development store and now the address reads like this name first line of address second line of address town county postcode country no comma's at all. You will need to go into phpmyadmin (or wotever you use) and edit the address format, I have adjusted format 2 to the following '$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country' This will do what you need just make sure you change the admin>locations>countries>'your country' setting as well. When you view an order after that it should be the way it is above. Mark Lifes a bitch, then you marry one, then you die!
warrenerjm Posted June 29, 2006 Posted June 29, 2006 The first thing I would look at is, under admin -> locations / taxes -> countries...try changing the Address Format for United Kingdom from 1 to 2 (I don't know offhand if there are more than 2). For customer registrations etc., the format of the address is taken from catalog/modules/address_book_details.php. So, from the customers viewpoint, that's where you can change the order in which the various address lines are shown. This may not do exactly what you're after but may at least get you started in the right direction. Hi I also changed it in create_account.php There are 5 different address types, but how do we see which each look like? I presume from reading this thread that the UK is best suited to 5? Julie
warrenerjm Posted June 29, 2006 Posted June 29, 2006 You will need to go into phpmyadmin (or wotever you use) and edit the address format, I have adjusted format 2 to the following Mark Hi Mark How do you adjust the above please? I have only ever run a query as per contrib instructions before & not done a manual edit. Thanks Julie
mark27uk3 Posted June 29, 2006 Posted June 29, 2006 Hi Michael, Just in case you make a booboo make a back up of your dbase first. 1. In phpmyadmin in the left column select your database name. 2. Click on the address_format table 3. Now on the screen you should see 3 fields: address_format_id address_format address_format_summary if you have check boxes to the left of the above fields then put a check in address_format_id and address_format and then at the bottom of the table you should see a little table icon click this and it should bring up a table showing the id's and the address formats. 4. Click on the little pencil icon next to the field you want to change and then add cut and paste this $firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country into the address_format 'value' field. 5. Click 'Go' at the bottom and that should be it! Mark Lifes a bitch, then you marry one, then you die!
warrenerjm Posted June 29, 2006 Posted June 29, 2006 Hi Michael, Just in case you make a booboo make a back up of your dbase first. 1. In phpmyadmin in the left column select your database name. 2. Click on the address_format table 3. Now on the screen you should see 3 fields: address_format_id address_format address_format_summary if you have check boxes to the left of the above fields then put a check in address_format_id and address_format and then at the bottom of the table you should see a little table icon click this and it should bring up a table showing the id's and the address formats. 4. Click on the little pencil icon next to the field you want to change and then add cut and paste this $firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country into the address_format 'value' field. 5. Click 'Go' at the bottom and that should be it! Mark Hi Mark Thank you for that detailed instruction. :thumbsup: At point 3 I couldn't see a table, so careful snooping, & I learnt I had to press browse tab. Then on track. I amended the address_format 'value' field for id 2, then created another account. in the customer section it is still the same. Does this affect the customer details, or just the customer order details. I haven't done a test orde, which will probably answer my own question, but I thought it would amend the address in the customer field too? :blush: Julie
mark27uk3 Posted June 29, 2006 Posted June 29, 2006 This will just rearrange the address on the orders page and the order process email. If you want to rearrange the way the addresses shows in the customers.php file then you need to get in and rearrange the table to suit. Mark Lifes a bitch, then you marry one, then you die!
warrenerjm Posted June 29, 2006 Posted June 29, 2006 This will just rearrange the address on the orders page and the order process email. If you want to rearrange the way the addresses shows in the customers.php file then you need to get in and rearrange the table to suit. Mark Do I need to re-arrange the code in admin/customers.php as I did with the create_account.php? I found this code if (strlen($entry_postcode) < ENTRY_POSTCODE_MIN_LENGTH) { $error = true; $entry_post_code_error = true; } else { $entry_post_code_error = false; } but the rest of the code in this file doesn't match what is seen in admin: Street: Suburb: (How can I change this to Town?) Postcode: City: State: (How can I change this to County) Country: so I'm not sure where to move the Post Code code to? :huh: My customer side reads OK: House/Flat number & street name Second line of address Town/City County Post Code Country Can I ask another question please, related to this, that you might also know the answer to? :D Do you know how to add another field to "Your personal Details" in create_account that says "Title"? It needs to be compulsory (*) &/or have a drop down of the options. Also, how to make the drop down list of countries, in "Your Address", to start with United Kingdom, but not to only have this as an option, as I can send to certain other countries? Sorry just seen another one. :blush: How do I remove the option of "Fax number" as it is unlikely ever to be filled in? Thank you sooooooooooooo much for any help with these additional questions, loosely related to this thread. ;) Julie
mystifier_uk Posted June 29, 2006 Author Posted June 29, 2006 Great stuff - thanks for everyone's help! Everything is working as I wanted! :thumbsup:
mark27uk3 Posted June 29, 2006 Posted June 29, 2006 Do I need to re-arrange the code in admin/customers.php as I did with the create_account.php? I found this code if (strlen($entry_postcode) < ENTRY_POSTCODE_MIN_LENGTH) { $error = true; $entry_post_code_error = true; } else { $entry_post_code_error = false; } but the rest of the code in this file doesn't match what is seen in admin: Street: Suburb: (How can I change this to Town?) Postcode: City: State: (How can I change this to County) Country: so I'm not sure where to move the Post Code code to? :huh: My customer side reads OK: House/Flat number & street name Second line of address Town/City County Post Code Country Can I ask another question please, related to this, that you might also know the answer to? :D Do you know how to add another field to "Your personal Details" in create_account that says "Title"? It needs to be compulsory (*) &/or have a drop down of the options. Also, how to make the drop down list of countries, in "Your Address", to start with United Kingdom, but not to only have this as an option, as I can send to certain other countries? Sorry just seen another one. :blush: How do I remove the option of "Fax number" as it is unlikely ever to be filled in? Thank you sooooooooooooo much for any help with these additional questions, loosely related to this thread. ;) Julie Hi Julie, By heck you are giving me some hammer today hehe. Okay The part you are looking for to move the postcode field is this part. <tr> <td class="main"><?php echo ENTRY_POST_CODE; ?></td> <td class="main"> <?php if ($error == true) { if ($entry_post_code_error == true) { echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"') . ' ' . ENTRY_POST_CODE_ERROR; } else { echo $cInfo->entry_postcode . tep_draw_hidden_field('entry_postcode'); } } else { echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"', true); } ?></td> </tr> Mine will be slightly different to yours. And yes you just rearrange the same way you did in create_account. You need to put the above code above the this bit <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?></td> <td class="main"> As far as an extra field goes you could maybe modify this contribution to suit. Second Address Line Try this for the county/country selection, I use it and it is quite a nice contrib: Active Countries It has the ability that when you select a country the states are autofilled for easy selection. Personally I would leave the fax field in or just rename it in to say 'Mobile No.' And last but not least the way you change state and suburb and state look in your language files in both catalog/includes/languages and catalog/admin/includes/languages I think that was everything :thumbsup: Mark Lifes a bitch, then you marry one, then you die!
warrenerjm Posted June 29, 2006 Posted June 29, 2006 Hi Julie, By heck you are giving me some hammer today hehe. :blush: :D Sorry :D Women!! :-" Personally I would leave the fax field in or just rename it in to say 'Mobile No.' Good idea :thumbsup: I think that was everything :thumbsup: Mark I'll leave you in peace now, & get on with your suggestions. Very grateful. :thumbsup: Thanks Julie
warrenerjm Posted July 2, 2006 Posted July 2, 2006 Hi Julie, By heck you are giving me some hammer today hehe. Okay The part you are looking for to move the postcode field is this part. <tr> <td class="main"><?php echo ENTRY_POST_CODE; ?></td> <td class="main"> <?php if ($error == true) { if ($entry_post_code_error == true) { echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"') . '?' . ENTRY_POST_CODE_ERROR; } else { echo $cInfo->entry_postcode . tep_draw_hidden_field('entry_postcode'); } } else { echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"', true); } ?></td> </tr> Mine will be slightly different to yours. And yes you just rearrange the same way you did in create_account. You need to put the above code above the this bit <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?></td> <td class="main"> As far as an extra field goes you could maybe modify this contribution to suit. Second Address Line Try this for the county/country selection, I use it and it is quite a nice contrib: Active Countries It has the ability that when you select a country the states are autofilled for easy selection. Personally I would leave the fax field in or just rename it in to say 'Mobile No.' And last but not least the way you change state and suburb and state look in your language files in both catalog/includes/languages and catalog/admin/includes/languages I think that was everything :thumbsup: Mark Hey Mark, I'm now all British! :D Thanks. Changed my mind :lol: about the extra field when I looked at the contrib & took the easy way! Using your idea, I have changed Fax Number: to Mobile Number: and First name: to Title & First Name: The UK at top of Countries drop down looks to complicated too, so is there any other way of doing this please? Whilst we are in the catalog/includes/languages/english.php file :D , does it matter whether I get rid of the Top or Catalog name from the navigation bar as they both go to the same page? My website is in the root. The remaining one I will call "Home". Thanks once again. That little niggle is now sorted. :thumbsup: Julie
Recommended Posts
Archived
This topic is now archived and is closed to further replies.