Jump to content

Customising the Address Layout Questions


Recommended Posts

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=1

However, 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.php

Does 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

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

Ok,

I've worked out that shopping-cart.tpl controls what is shown on the first stage of the checkout process at order.php

However, 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

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

×
×
  • Create New...