AlegroCart open source E-commerce
Web hosting by Host1Plus

v1.2.1 bugs

Enter AlegroCart Bugs Here, but if you're not certain, post in General support first.

Re: v1.2.1 bugs

Postby Brent » Wed Apr 21, 2010 3:38 pm

What do you mean by longer than the list it replaces?
I'm not sure I understand the problem.
User avatar
Brent
Site Admin
 
Posts: 4365
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: v1.2.1 bugs

Postby gob33 » Thu Apr 22, 2010 6:12 am

French zones in Alegro goes from ID=1091 to 1219.
But, some regions are incorrect, depts have typos, islands no more used.
My list above contains all french territories with ISO code (unique).
The correct list goes from ID=1091 to 1225, so replacement of the old list induces
shifting all that is below (normally).
If anyone uses a zone_id>1225 (e.g US zones) in production, shifting the zones list
in a new version of Alegro gives a false correspondance name/code for a zone.

So what to do ? Continue with old bad list ? Push it at the end ? Keep only major countries zones ?
I dont know, except thats reflects not the good french zones for shipping.

Looking at ZenCart new version, they have only the following zones (in order):
USA, Canada, Germany, Austria, Switzerland, Spain, Australia.
Any other zones must be inserted by the merchant/local users group.
gob33
 
Posts: 107
Joined: Wed Apr 07, 2010 3:10 pm

Re: v1.2.1 bugs

Postby Brent » Thu Apr 22, 2010 6:56 am

The zones that need to be replaced could be done with on duplicate key update.
In the upgrade.sql in the install, look at the first item that sets the version. That's how to upgrade existing zones with new value.
The rest would be appended to the end of the list as they are new.
Zones that are not required could be dropped.
As for the current numbing of zones, it does not matter where the zone is located in the list, as long as the zone_id to zone is not changed.
If new zones are appended to the end of the list, as long as the correct country and zone name are specified, what is the difference.
I know it makes the SQL look nicer, but who cares.

I should mention, in the next version, 1.2.2, The zone search and SQL has changed. You can now search by a country and the search returns that country and all zones for the country.

We can write the SQL in the upgrade and probably include in the next version, or do it as a standalone SQL update. If it is a standalone update, it is easier to manually include these
changes in the existing SQL and do a drop table and re-create.

edited: I notice the are some zones in the old SQL that are not in the new such as Paris and Riviera. I am assuming these are replaced by the new ones?
User avatar
Brent
Site Admin
 
Posts: 4365
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: v1.2.1 bugs

Postby gob33 » Fri Apr 23, 2010 3:46 pm

I have checked zones of USA, Spain, Germany in Alegro. All these are correct.
French zones can be added at the end, works but not genious.
Update by using an sql file inside the distro, like 'mysql_upgrade_alegro_1.2.1_to_1.2.2.sql'
to be passed to a tool like 'phpMyAdmin' (UPDATE ... WHERE ...).
Should have been done like with the fillers in Cobol between records: skipping ID
numbers between countries zones for adjustements.

Whereas Paris and Riviera, these regions dont exist anymore.
Islands have been merged in departments a long time ago.
The only reference is ISO_3166-2:FR
gob33
 
Posts: 107
Joined: Wed Apr 07, 2010 3:10 pm

Re: v1.2.1 bugs

Postby Brent » Fri Apr 23, 2010 3:58 pm

If the list you have is all there is, it is easier to modify the existing zone file and replace all files that are the same.
Only new files would have to be appended to the end of the list. I started doing it to included in 1.2.2, which I hope to have available in the next few days.
It could then be included in 1.2.2 as is.
Then a separate upgrade could be done for those upgrading from 1.2.1 or earlier in phpmyadmin.
User avatar
Brent
Site Admin
 
Posts: 4365
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: v1.2.1 bugs

Postby gob33 » Fri Apr 23, 2010 4:15 pm

Think my list is complete, Ive followed ISO 3166-2FR.
Dont speed to make the v1.2.2.
Im thinking if it is possible to shift all zone_ids in all tables by a simple script using MySQL
loop functions and conditionnals. Will see...
gob33
 
Posts: 107
Joined: Wed Apr 07, 2010 3:10 pm

Re: v1.2.1 bugs

Postby Brent » Sat Apr 24, 2010 3:52 am

I see what your idea is, but I don't think is is wise to shift.
Any users that already have sites up will have problems.
All customer account use ID instead of name for country and zone, which is the correct way.

Thoughts?
On second thought, a contribution using the existing ID could be available for anyone who wants to upgrade their zones and countries.
You idea of re-indexing could be used in the newer versions. Then there would be no conflict for existing users.

This could be the contribution
Attachments
country_zones.zip
(49.27 KiB) Downloaded 335 times
User avatar
Brent
Site Admin
 
Posts: 4365
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: v1.2.1 bugs

Postby gob33 » Sat Apr 24, 2010 9:47 am

zone_id is only used at 3 places in tables.
Below an example of upgrade script with shifting (tested ok on my db).
Correspondance for french region is not 1 <--> 1 but never mind.
Dont think they are plenty of french users anyway.
Attachments
mysql_upgrade_alegro_121_to_122.zip
(2.56 KiB) Downloaded 335 times
gob33
 
Posts: 107
Joined: Wed Apr 07, 2010 3:10 pm

Re: v1.2.1 bugs

Postby Brent » Sat Apr 24, 2010 11:34 am

Just ran it and did a little checking. Looks perfect.
Good job and thanks.
You might want to package and put in contribs, if you like.

ps. You're right, I have no idea about French zones.
Been 30 years since I was there.

Thanks again.
User avatar
Brent
Site Admin
 
Posts: 4365
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: v1.2.1 bugs

Postby gob33 » Sat Apr 24, 2010 2:26 pm

Have checked your zip:
- country list ok, i have removed Yougoslavia for my part as not in ISO 3166 (->Macédoine). Can keep it.
Insertions at the end permits to better see changes than mixed.
- zone list rather in disorder by zone_id but seems correct.
You have kept old regions correspondance as possible (not me).
Also I have removed 1210->1219; these are some lost Islands there (there are a few others)
which now have all a zip code and linked to a dept (Polynésie, Terres australes).
They are not departments by themselves, i dont see why they are in the list.

My idea was to add an sql upgrade script in each new version if necessary.
And use now the new french zones starting with 1.2.2
OpenCart has the same old list, so french users group as the same pb.
I also prepare a french langage pack for Alegro.
gob33
 
Posts: 107
Joined: Wed Apr 07, 2010 3:10 pm

PreviousNext

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron