TJF008 Posted October 6, 2009 Share Posted October 6, 2009 Hi,I've been having a lot of trouble customising the address type in Prestashop to Australian standards. I wish PrestaShop would offer more control over this.Anyway, so far I've followed the instructions posted in http://www.prestashop.com/forums/viewthread/18112/, have added a new 'suburb' field to the ps_address table in the database, and through a few template modifications and tweaks of the order-address.js file, have the address displaying perfectly on order.php?step=1However, I still have to fix address display on the following pages:1. The order summary page at order.php - (BTW by default the address display is inconsistent on this page and shows surname before first name).2. The order details page at history.phpDoes anyone know what files to edit to alter the address display on those pages?Finally, I have a new 'Suburb' field appearing on address.php?id_address=7 using the following code: {l s='Suburb'} <input type="text" id="suburb" name="suburb" value="{if isset($smarty.post.suburb)}{$smarty.post.suburb}{else}{$suburb->suburb|escape:'htmlall':'UTF-8'}{/if}"/> This field saves to the database perfectly and the suburb field shows on order.php?step=1, but for some reason, when I load the address.php?id_address=7 page, the suburb field appears blank (unlike the other field for name, address, etc.). I think it has something to do with the code: value="{if isset($smarty.post.suburb)}{$smarty.post.suburb}{else}{$suburb->suburb|escape:'htmlall':'UTF-8'}{/if}" because when I view source, value appears as value="". Does anyone know how to get the suburb field to appear pre-filled when the edit address details page is displayed?Thanks, I hope I've made sense. Link to comment Share on other sites More sharing options...
jhnstcks Posted October 6, 2009 Share Posted October 6, 2009 You need to add a line of code in class/address.php at about line 136 in the private function get fields. Probably look something like this $fields['suburb'] = psQL($this->suburb); Link to comment Share on other sites More sharing options...
TJF008 Posted October 6, 2009 Author Share Posted October 6, 2009 Hi jhnstcks, thanks for your quick response.I added public $suburb; under public $id_customer = NULL; and $fields['suburb'] = pSQL($this->suburb); under $fields['date_upd'] = pSQL($this->date_upd); in the address.php when I made the edits in the UK address format instructions. I followed all instructions in that thread, but replaced county with suburb.Do you have any other ideas where I should look?Thanks again. Link to comment Share on other sites More sharing options...
TJF008 Posted October 6, 2009 Author Share Posted October 6, 2009 Ok,I've worked out that shopping-cart.tpl controls what is shown on the first stage of the checkout process at order.phpHowever, it doesn't like the code {$delivery->suburb|escape:'htmlall':'UTF-8'} The HTML output is simple with no closing or suburb name. How can I fix this?When I am done with this, I will write up a guide to completely modifying the address display.Thanks. Link to comment Share on other sites More sharing options...
jhnstcks Posted October 6, 2009 Share Posted October 6, 2009 You know I never noticed that that page was wrong. I will make a fix now. Link to comment Share on other sites More sharing options...
jhnstcks Posted October 6, 2009 Share Posted October 6, 2009 Did you change the section at the top of order-address.tpl? The javascript section? Link to comment Share on other sites More sharing options...
TJF008 Posted October 6, 2009 Author Share Posted October 6, 2009 Ok, I think I've fixed everything.The problem with the address.tpl file was that I had stupidly typed $suburb->suburb instead of $address->suburb. This fixed it: {l s='Suburb'} <input type="text" id="suburb" name="suburb" value="{if isset($smarty.post.suburb)}{$smarty.post.suburb}{else}{$address->suburb|escape:'htmlall':'UTF-8'}{/if}"/> The other problem with inconsistent address formatting appearing on the order.php page seemed to fix itself when I logged out, created a new user account and started the checkout process again.Thanks for your help and patience jhnstcks! Link to comment Share on other sites More sharing options...
jhnstcks Posted October 6, 2009 Share Posted October 6, 2009 The address page in the myaccount section is controlled by addresses.tpl Link to comment Share on other sites More sharing options...
TJF008 Posted October 6, 2009 Author Share Posted October 6, 2009 Oops - one more thing I forgot to change. How do I change the address layout on the history.php page when viewing a past order's details? Editing history.tpl doesn't seem to affect anything.Thanks :-) Link to comment Share on other sites More sharing options...
jhnstcks Posted October 6, 2009 Share Posted October 6, 2009 Try the order-detail.tpl file Link to comment Share on other sites More sharing options...
TJF008 Posted October 6, 2009 Author Share Posted October 6, 2009 Thanks a lot! You're a legend :-) Link to comment Share on other sites More sharing options...
Recommended Posts