Post by sucotronic » Sat Nov 12, 2011 5:13 pm

jp1976 wrote:mmm... i m not very sure how to hardcode this...
some direction?
Opencart follows a MVC model, so the proper way will be to add a new function in the properly controller file, add a method in the controller and add a button in some template. Sorry not to be more helpful, but I'm just starting to develop in opencart :P

Newbie

Posts

Joined
Tue Oct 11, 2011 12:09 am

Post by grethat » Mon Jan 09, 2012 9:35 pm

Exellent work, thank you for your time.

Newbie

Posts

Joined
Wed Nov 02, 2011 8:31 pm

Post by thisisworldwide » Thu Feb 16, 2012 8:48 am

does anyone have this fix for v1.4.9.6 ? Either the coding fix or the sql fix i couldnt get either to work

New member

Posts

Joined
Thu Jun 02, 2011 1:57 am

Post by komirad » Fri Mar 23, 2012 12:57 pm

Wow I created the function on the controller->geo_zone.php but after running it the edit page is slow as hell. O0

For a one-time quick use, you may use this function to temporarily replace the "AddGeoZone" function by removing the "AddGeoZone" function and renaming the function below to "AddGeoZone" .

Add a Geo Zone as you normally would, by typing the name/decription except you don't have to add any zones below.

Once you're done, click on edit and all the countries should be in the zone. Page is going to be huge.

Restore the geo_zone.php to the original code once you're done.

Code: Select all

public function addAllCountriesToThisGeoZone($data) {
		$this->db->query("INSERT INTO " . DB_PREFIX . "geo_zone SET name = '" . $this->db->escape($data['name']) . "', description = '" . $this->db->escape($data['description']) . "', date_added = NOW()");

		$geo_zone_id = $this->db->getLastId();
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country");
		
		foreach($query->rows as $value){
			$this->db->query("INSERT INTO " . DB_PREFIX . "zone_to_geo_zone SET country_id = '"  . (int)$value['country_id'] . "', zone_id = '0', geo_zone_id = '"  .(int)$geo_zone_id . "', date_added = NOW()");
		}
		
		$this->cache->delete('geo_zone');
	}

Opencart Services - Setup, Maintenance, Administration, Product Data Entry, Repair


Newbie

Posts

Joined
Fri Mar 23, 2012 12:52 pm

Post by iPhone-Unlock.be » Thu May 03, 2012 5:15 pm

Could you explain this better please? I don't understand the instructions above...


Posts

Joined
Mon Apr 30, 2012 7:54 pm

Post by aaronrrc » Tue Jun 19, 2012 7:21 am

Thank you very Much!! :joker:

Newbie

Posts

Joined
Sat Jun 09, 2012 1:03 pm

Post by portugalonlineshop » Fri Jul 27, 2012 4:19 am

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.

First of all, setup the Geo Zone in the admin as you normally would, but don't add any countries or zones to it. Next, you need to know the geo_zone_id of the Geo Zone you just created. You can find it at the end of the URL when you edit the Geo Zone:

http: //www.mystore/admin/index.php?route=local ... _zone_id=4

Now, run the following SQL query using a tool like phpMyAdmin. Make sure you edit the query with the table prefix you selected during the OpenCart installation ('oc_' for my database). You need to enter the correct geo_zone_id in the third field on the second line (it was '4' in my case):

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');
That's it! The query will complete in less than two seconds, and it will add all countries and all zones except the United States to your Geo Zone. Note that you can easily edit the query to exclude more than one country. For example, if you wanted to create a Geo Zone for all countries except the US and Canada, you would do this:

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','Canada');
Hi guys!

Would it be possible to instead of removing some specific names, one could remove all countries that were present in other geo zone?

Example:
Make a Europe Geo Zone and a Worldwide Geo Zone. Then be able to remove all countries from the Europe zone in the worldwide, or vice-versa..

I've tried messing with mysql, but it's really not my field.. Though of something like this:

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_zone_to_geo_zone.zone_id NOT IN ('[i]#id for the other geo zone[/i]');
But it does not work...

Image
www.theportugalonlineshop.com


New member

Posts

Joined
Fri May 06, 2011 1:22 am

Post by HankMcSpank » Sun Sep 09, 2012 11:28 pm

Having set up all my geo zones on one website, I've just created another new website ...to save going through the whole process again, can I just copy some files off my 1st website & then ftp these iover to my 2nd (new) website to see the same geo zones there?

Many thanks,
Hank.

Active Member

Posts

Joined
Wed Apr 11, 2012 4:15 pm

Post by tdaubs » Tue Sep 25, 2012 12:12 am

Hank, that information is not stored in files but rather the database.

Image
Opencart Support | Opencart Galaxy


User avatar
Active Member

Posts

Joined
Fri Apr 08, 2011 4:51 am
Location - Southern California

Post by HankMcSpank » Wed Sep 26, 2012 12:09 am

tdaubs wrote:Hank, that information is not stored in files but rather the database.
Thanks for the info ...in the absence of a reply I just bit the bullet & did it long hand on my new website :-)

Active Member

Posts

Joined
Wed Apr 11, 2012 4:15 pm

Post by Simon@j4kofeastpa » Wed Oct 24, 2012 11:35 am

Am I able to set up different tax info per state in the USA? For example 6% in pa and 0% in DE?

Thanks


Posts

Joined
Sat Oct 13, 2012 7:28 pm

Post by Pysiek » Sat Dec 15, 2012 12:52 am

Hello
I do have vqmod installed on my web but what I need to do with the vqmode file? Do I need to insert it somewhere?

New member

Posts

Joined
Wed Dec 12, 2012 10:14 pm

Post by dirtboy » Sun Dec 16, 2012 12:49 am

anyone know how to get this to work in 1.5.4.1?

“Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.”
- Henry Ford


User avatar
Active Member

Posts

Joined
Wed Mar 07, 2012 3:04 pm

Post by VaporJedi » Sat May 25, 2013 1:58 am

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.

Newbie

Posts

Joined
Sat Mar 30, 2013 5:19 pm

Post by OSWorX » Sat May 25, 2013 10:08 pm

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 (VQMod) a try:
Button Alle Länder DE
Button All Countries EN
Should work also on slower machines.
Last edited by OSWorX on Sat Oct 04, 2014 2:09 pm, edited 2 times in total.
Reason: adopted links

Image


User avatar
Expert Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by santura » Tue Jun 18, 2013 11:35 am

How can I make this mod with vqmod?

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by OSWorX » Tue Jun 18, 2013 3:45 pm

santura wrote:How can I make this mod with vqmod?
Do not understand your question.
This IS a VQMod.

Image


User avatar
Expert Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by santura » Tue Jun 18, 2013 4:18 pm

Sorry OSWorX I missed your post - thanks

New member

Posts

Joined
Fri Jun 14, 2013 8:33 pm

Post by ews.tom » Wed Aug 28, 2013 8:00 pm

As a long time lurker and OpenCart developer, I finally registered on the forums specifically to say THANKYOU for this VQMod - very helpful

Newbie

Posts

Joined
Wed Aug 28, 2013 7:58 pm

Post by emilpk » Sun Oct 06, 2013 2:03 am

Here is a simple piece of JavaScript I wrote that did the trick nicely. No need to mess around with updating server side code.

In the chrome console window (or in Firefox's firebug console window), simply run this line of JavaScript.
for(i=1;i<=239;i++){ addGeoZone(); $("#country" + (i-1)).val(i); }

Give it a moment to generate all 239 country picklists with each having the next country in the list auto-selected.

Once you can see the full list of countries have been generated, simply 'Remove' the countries you don't want.

Finally click the 'Save' button and bob's your uncle!

Newbie

Posts

Joined
Sun Oct 06, 2013 1:50 am
Who is online

Users browsing this forum: No registered users and 14 guests