Jump to content

Integrate the adress in identity.tpl/php


Recommended Posts

In your template folder open the following files (save a copy of each file before):
- addresses.tpl
- identity.tpl

Copy everything in addresses.tpl except the following line at the top:


<!--
var baseDir = '{$base_dir_ssl}';
-->
*ript



and this one at the end:

>
</pre>
<ul>
{l s='Back to Your Account'}

{l s='Home'}
</ul>



Paste everything in identity.tpl before the following line:

>
</pre>
<ul>
{l s='Back to Your Account'}
{l s='Home'}
</ul>



You might want to remove the addresses link in account page...
In my-account.tpl (make a copy of the file and open the original one)
replace:

{l s='Your addresses'}


with

{*
{l s='Your addresses'}
*}

Link to comment
Share on other sites

Thank you for the reply.

That's almost what i'm after. When doing that you get the links etc to change you're adress but it don't know that you already have an adress. That will just leave a link that says "you don't have any adress yet, register a new one" even though you have 3 or 4.

What I'm after is make the form look like the one when you are registering for the first time.
It should just show the same form but with the information pre-entered so you can just see what you have registered and what you want to change real quick.

Something like on the picture i have attached.

(sorry for the english)

28712_dZHaSXQsSiuSPtD4qTMc_t

Link to comment
Share on other sites

To make the identity page to detect existing addresses and work properly I think you would need to copy part of the addresses.php file in the identity.php file.

Try to copy the following content of addresses.php:

if (!$cookie->isLogged())
   Tools::redirect('authentication.php?back=addresses.php');

$customer = new Customer(intval($cookie->id_customer));
if (!Validate::isLoadedObject($customer))
   die(Tools::displayError('customer not found'));

include(dirname(__FILE__).'/header.php');
$smarty->assign('addresses', $customer->getAddresses(intval($cookie->id_lang)));
$smarty->display(_PS_THEME_DIR_.'addresses.tpl');
include(dirname(__FILE__).'/footer.php');



in the identity.php file before:

include(dirname(__FILE__).'/header.php');
$smarty->display(_PS_THEME_DIR_.'identity.tpl');
include(dirname(__FILE__).'/footer.php');



It should work but will not display the address form as you want.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...