Page 5 of 5

Re: [MOD] GeoZone - Add All Countries Button

Posted: Mon Nov 04, 2013 6:03 am
by mkp007
SQL and phpmyadmin is the way to go. I think this post will help people

http://forum.opencart.com/viewtopic.php?f=20&t=113515

Re: [MOD] GeoZone - Add All Countries Button

Posted: Thu Nov 14, 2013 2:15 am
by jsw
OSWorX wrote:
VaporJedi wrote:This doesn't work in 1.5.5.1 .

Any ideas what to do? I installed the vqmod extension.. but it doesnt make the button for all zones/all countries appear.
Maybe you want to give this mod a try: http://home.osworx.net/en/downloads/cat ... qmod-files
Should work also on slower machines.
I "refused" to add the countries one at a time... :) , this vQmod saved a lot of work. Added all countries in a few seconds and removed a few that I didn't want in the list, then it's done. THANK YOU OSWorX!

Re: [MOD] GeoZone - Add All Countries Button

Posted: Thu Nov 14, 2013 5:49 am
by OSWorX
jsw wrote:
OSWorX wrote:
VaporJedi wrote:This doesn't work in 1.5.5.1 .

Any ideas what to do? I installed the vqmod extension.. but it doesnt make the button for all zones/all countries appear.
Maybe you want to give this mod a try: http://home.osworx.net/en/downloads/cat ... qmod-files
Should work also on slower machines.
I "refused" to add the countries one at a time... :) , this vQmod saved a lot of work. Added all countries in a few seconds and removed a few that I didn't want in the list, then it's done. THANK YOU OSWorX!
Always a pleasure to help ;D

Re: [MOD] GeoZone - Add All Countries Button

Posted: Tue Feb 11, 2014 9:54 am
by rusly.mices
from emilpk code i modified into :

Code: Select all

<a onclick="addAllGeoZones();" class="button"><span class="button_left button_insert"></span><span class="button_middle">Add All Countries</span><span class="button_right"></span></a>

<script type="text/javascript">
    function addAllGeoZones() {
		for(i=1;i<=239;i++){ addGeoZone(); $("#country" + (i-1)).val(i); } 
    }
</script>

Re: [MOD] GeoZone - Add All Countries Button

Posted: Tue Feb 11, 2014 4:40 pm
by theos17
Hi,

Do you have an extention that can solve OC problem with counties sales tax?

In California, if shipping address is Sausalito then sales tax is 8.5% and rest of California is 7.5%.
So lets say that I want to add tax only when shipping address is from San Francisco, Sausalito and Reno.
San Francisco and Sausalito belongs to California but have different sales tax.

Hope you get my point and you have solution for this.

Thanks

Re: [MOD] GeoZone - Add All Countries Button

Posted: Wed Feb 19, 2014 3:27 am
by Ed_Rolla
ambrosite wrote:I am really surprised that people are trying to do this with JavaScript? That's crazy. You can set up an "All Countries" Geo Zone in a half second by running a SQL query directly against the database.
......

Code: Select all

INSERT INTO oc_zone_to_geo_zone (country_id, zone_id, geo_zone_id, date_added, date_modified)
SELECT oc_country.country_id, 0, 4, NOW(), NOW()
FROM oc_country
WHERE oc_country.name NOT IN ('United States');
Q, what you did totally makes it possible to enable clients to do it in a click. That's a great solution, but it seems nothing happens when the button is clicked (using OC v.1.5.6.1).

Ambrosite, you're I life saver and I feel like a freaking moron! ;D
Thank you! Thank you! Thank you!

Re: [MOD] GeoZone - Add All Countries Button

Posted: Wed Feb 19, 2014 4:29 am
by Qphoria
Ed_Rolla wrote: Q, what you did totally makes it possible to enable clients to do it in a click. That's a great solution, but it seems nothing happens when the button is clicked (using OC v.1.5.6.1).
keep in mind that method was from 1.4.x and also takes about a minute for anything to show up because it is trying to use javascript to loop 240 times and load ajax zone info for each. But yes the database insert method is just better overall since it is a one time thing

Re: [MOD] GeoZone - Add All Countries Button

Posted: Wed Feb 19, 2014 5:01 am
by Ed_Rolla
Yeap. I clicked on it and nothing actually happened. The browser didn't even crash... almost as the button had no action. :/
But, no sweat. I went around it with SQL. ;)

Again, great job!

Re: [MOD] GeoZone - Add All Countries Button

Posted: Wed Oct 01, 2014 11:48 am
by mzcreative
I just wanted to say a big thank you to @OSWorX for the great vqmod. It was exactly what I needed and was really quick to install on my end :D

Re: [MOD] GeoZone - Add All Countries Button

Posted: Thu Jan 15, 2015 11:44 pm
by rch
Hi,

I have updated this great script for opencart 2.0 and created a VQMOD.

Re: [MOD] GeoZone - Add All Countries Button

Posted: Sun Mar 01, 2015 3:03 pm
by vitalvintage
:crazy:
rch wrote:Hi,

I have updated this great script for opencart 2.0 and created a VQMOD.
I put your xml file into my directory and it didn't work or do anything as far as i can see. I have opencart 2.0.1.1

Re: [MOD] GeoZone - Add All Countries Button

Posted: Fri Apr 17, 2015 4:56 am
by jthrongard
I am also not able to get this to work on Opencart 2.0+. Can someone walk us through using it on the new versions?

Re: [MOD] GeoZone - Add All Countries Button

Posted: Sat Apr 25, 2015 1:13 am
by Dana
jthrongard wrote:I am also not able to get this to work on Opencart 2.0+. Can someone walk us through using it on the new versions?
The .xml that rch posted has wrong path to the file:

Replace:

Code: Select all

<file name="zowa/view/template/localisation/geo_zone_form.tpl">
with

Code: Select all

<file name="admin/view/template/localisation/geo_zone_form.tpl">
and it works. :)

Re: [MOD] GeoZone - Add All Countries Button

Posted: Fri Jan 22, 2016 10:28 pm
by kec
Works fine but you have to change the line in the previous post indeed.

Note: it will add ALL countries, so If you already had some other GEO zones set, then you have to delete them manually from this list.

Re: [MOD] GeoZone - Add All Countries Button

Posted: Sat Oct 29, 2016 12:55 am
by vandenbrande
Hi, i know this is a old post, but i need it for 2.1.0.1 is there any way to get it to work? Its not working for me. I see the button but nothing happens.

Re: [MOD] GeoZone - Add All Countries Button

Posted: Sat Oct 29, 2016 5:21 am
by vandenbrande
This code below still works on 2.1.0.1

Code: Select all

<a onclick="addAllGeoZones();" class="button"><span class="button_left button_insert"></span><span class="button_middle">Add All Countries</span><span class="button_right"></span></a>

<script type="text/javascript">
    function addAllGeoZones() {
      for(i=1;i<=239;i++){ addGeoZone(); $("#country" + (i-1)).val(i); } 
    }
</script>

Re: [MOD] GeoZone - Add All Countries Button

Posted: Wed Jul 26, 2017 12:35 pm
by jannietan
Hi,
May i know does this code able to apply to OpenCart Version 2.3.0.2? I have tried it, but seem doesn't work, hopefully there is someone that can guide me on this.
Thank you.

Re: [MOD] GeoZone - Add All Countries Button

Posted: Thu Oct 19, 2017 12:53 am
by f1br3opt1c
Tried and it works on 2.3.0.2. Here is the edited working file with Dana's line of customization.

Credit goes to rch and Dana. Thank you so much guys, solved me a big headache!