Post by comprido » Fri Jun 20, 2014 7:13 pm

Hi!

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".
zone_id_0.png

As a result, the zone_id value on oc_address table has the value "0". - zone_id_0.png (19.88 KiB) Viewed 1298 times

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:
address.png

So, I avoid the actual - address.png (25.14 KiB) Viewed 1297 times

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 } ?>
Wich is the error?

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!
Last edited by comprido on Sat Jun 21, 2014 2:49 pm, edited 1 time in total.

Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido


User avatar
New member

Posts

Joined
Mon Sep 10, 2012 11:46 pm

Post by straightlight » Fri Jun 20, 2014 10:14 pm

Without knowing exactly the type of migration tool you used to integrate these values from Zen-Cart towards OpenCart, I'd say this is where the issue lies due to the way the transactions between the two databases has been processed in the first place. Fixing the integration module would be the first way to go in order for OpenCart to load the geographical settings accordingly without having to make manual adjustments to the checkout steps.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by comprido » Sat Jun 21, 2014 1:03 pm

The author colaborate with me importing lot of things more than the default mod has:
http://www.opencart.com/index.php?route ... ion_id=699

For example:

Import more than 4 character words to metatags and tags.
Import 30 first words from descriptio to metadescription.
Importing lowercase, - separated title without spaces to SEO word.
Importing ISBN old field to opencart model/ISBN also.
imprted1.png

imprted1.png (48.34 KiB) Viewed 1277 times

imprted2.png

imprted2.png (81.61 KiB) Viewed 1277 times

The shop is perfectly migrated.
Just the old fields mentioned are unmatching.

About the mysql database query... doing:

SELECT *
FROM `oc_zone`,`oc_address`
WHERE `name` = `city`
LIMIT 0 , 30

I obtain:
query.png

SELECT * FROM `oc_zone`,`oc_address` WHERE `name` = `city`LIMIT 1 - query.png (36.03 KiB) Viewed 1277 times

But now I want to UPDATE `oc_address` SET `oc_address`.`zone_id` = `oc_zone`.`zone_id` when `country_id` is the same.

Ideas?

Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido


User avatar
New member

Posts

Joined
Mon Sep 10, 2012 11:46 pm

Post by comprido » Sat Jun 21, 2014 3:21 pm

Solved with payment_address.tpl, at the very top of the file, PASTE:

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 } ?>
Thanks.

Pedro Martin - websitesbuilder.com.au
Checkout my free extensions: https://www.opencart.com/index.php?rout ... r=comprido


User avatar
New member

Posts

Joined
Mon Sep 10, 2012 11:46 pm
Who is online

Users browsing this forum: No registered users and 4 guests