When registering for an account the address he gives is automatically set as default, however there are times when he will add a second address and set that to default address. If he then deletes that address there is no longer a default address set.
Is there a way to either alert customer that he does not have a default address set or indeed a better way would be to automatically set the orginal address back to default.
Rob
Is there a way to either alert customer that he does not have a default address set or indeed a better way would be to automatically set the orginal address back to default.
Rob
I know my place...!
you can add an if else statement.
Code: Select all
if (!$this->customer->getAddressId()) { //....
}
That statement is good enough to add any text you wish to display if they do not have a default address. You can just add it directly to your template.
I´m having similar problem after a ZenCart migration. Although the default address is correctly set, zone_id in adddress table lost the old city value.
Now I want to show a message in payment_address.tpl just for users where default address have zone_id = '0':
<?php if ($addresses) { ?>
<div class="advice">Please review your address before continue. <br/>Visit <a href="/index.php?route=account/address">your address book</a>, push EDIT link and check that all the information is correct.</div><br />
<?php } ?>
How may I use your code?
It´s possible to make this link redirect directly to this address?, just like:
Something like:
Now I want to show a message in payment_address.tpl just for users where default address have zone_id = '0':
<?php if ($addresses) { ?>
<div class="advice">Please review your address before continue. <br/>Visit <a href="/index.php?route=account/address">your address book</a>, push EDIT link and check that all the information is correct.</div><br />
<?php } ?>
How may I use your code?
It´s possible to make this link redirect directly to this address?, just like:
Code: Select all
/index.php?route=account/address/update&address_id='.$address_id.'
Thanks in advance!<?php if ($address['zone'] == '0') { ?><div class="advice">Si era cliente de nuestra antigua tienda y este es su primer pedido, debería actualizar su dirección antes de seguir. <br/>Visite <a href="/index.php?route=account/address/update&address_id=<?php echo $address['address_id']; ?>">su libreta de direcciones</a>, pulse EDITAR y compruebe todos los datos que aparecen en el formulario.</div><br />
<?php } ?>
Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido
Solved with payment_address.tpl, at the very top of the file, PASTE:
Thanks.
Code: Select all
<?php if ($addresses) { ?>
<?php foreach ($addresses as $address) { ?>
<?php if ($address['zone'] == '') { ?>
<div class="advice">We have found <strong>a data error</strong>, please, <a href="/index.php?route=account/address/update&address_id=<?php echo $address['address_id']; ?>">update your address</a> before continue.</div><br />
<?php } ?>
<?php } ?>
Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido
Who is online
Users browsing this forum: No registered users and 5 guests