Due to a ZenCart migration to Opencart 1.5.6.1 I´m having a missconfiguration.
Some of the old clients entry_city field on address_book table lost their city (zone_id) value after migration.
As a result, the zone_id value on oc_address table has the value "0".
I´m figuring that the easiest method to "force" the users to solve the situation is redirect them through controller/checkout/payment_address.php, so, when they are going to make the payment, if check that zone_id='0' > I can do a redirect to /index.php?route=account/address and explain them the situation on a simple warning DIV.
So, I need to avoid the actual:
With something like:
Code: Select all
<?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 } ?>
Or... how may I check it?
-----------
And also, I may check tables to see if the values match and copy to zone_id the correct value, doing something like that:
SELECT *
FROM `oc_zone`,`oc_address` WHERE `name` = `city`
UPDATE `oc_address`.`zone_id` SET `oc_address`.`zone_id` = `oc_zone`.`zone_id`
LIMIT 1;
Sugestions?
thanks in advance!