Jump to content

Best Way To Disable Countries?


Guest philoye

Recommended Posts

Guest philoye

I'm not going to ship to all 200+ countries that are listed in the default install of CC.

What's the best way to disable some? Do I need to delete them altogether? Seems like a shame. If I open it up to other countries in the future, I need to manually re-enter? I guess it isn't the worst thing in the world.

It seems like there should be disable/enable functionality (similar to currencies).

Link to comment
Share on other sites

Guest webicon

If you have CPanel/PHP MyAdmin or similar the easiest would be to edit the table directly.

I only deliver to Uk so I empty all rows except UK... 2 minute job. If I changed my mind I would just re-import the default table contents again....

Link to comment
Share on other sites

Guest philoye

If you have CPanel/PHP MyAdmin or similar the easiest would be to edit the table directly.

I only deliver to Uk so I empty all rows except UK... 2 minute job. If I changed my mind I would just re-import the default table contents again....

So deleting is the way to go, I guess. Good idea on backing up the table first though!

Link to comment
Share on other sites

Guest philoye

Well, I deleted countries the "old fashioned way"--via the admin tool.

Alas, as with any error prone activity, I fat-fingered a few. I deleted two countries that I didn't mean to. No problem, I thought, I simply added them back. Wrong.

Now those two countries appear at the end of the country drop down on the front-end. Even though I manually edited the ID column on the database itself to their original values, they still come at the end of the list.

Curiously, they are in the right order in the admin tool. Perhaps the SQL query that is pulling the countries on the front end, differs from the admin tool?

Any suggestions? Is there a SQL command that'll resort the rows in the table? Or I can modify the CC php file that drives the registration screen. Either way, it would seem this is a bug. If people add/remove countries, they should still show up in alpha order in the front-end.

Any help, would be appreciated.

Link to comment
Share on other sites

Guest bennyuk

I think I had this with v3 as well. To get round it you need to edit each inc file that is used on whichever page you are referring ot.

The main one is the registration page, the inc file is /includes/content/reg.inc.php

Have a look around line 340 where it says

$countries = $db->select("SELECT id, printable_name FROM ".$glob['dbprefix']."CubeCart_iso_countries");




and change it to 




$countries = $db->select("SELECT id, printable_name FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER by printable_name ");

ie get it to order by country name rather than the id number.

Just remember to take backups of any files before editing them :dizzy:

Link to comment
Share on other sites

Guest philoye

$countries = $db->select("SELECT id, printable_name FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER by printable_name ");

ie get it to order by country name rather than the id number.

That worked like a charm, thanks! (or at least once I cleared the SQL cache via the admin tool).

Cheers!

p.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...