VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: trodat on April 15, 2012, 11:09:03 AM

Title: Need to set default country, store info setup, still not working!?
Post by: trodat on April 15, 2012, 11:09:03 AM
I'm using VM 2.0.4, Joomla 2.53, Yoo theme called Vanilla.

I can't seem to have the default country be "United States" on checkout/register form. The store information is setup in the admin with "United States" selected. I'm only selling within the United States (continental/lower 48 states), so I deleted all other countries and Alaska and Hawaii. But yet, the country field still says "--Select--" on the frontend register form.

I have VM 1.1.8 Joomla 1.5.25 with theme JA_Purity running on another site / same server and the country works fine - default option selected is United States.

I have searched every post about that references "United States" and nothing seems to address my issue. Any help/answers please??!
Title: Re: Need to set default country, store info setup, still not working!?
Post by: trodat on April 17, 2012, 06:13:09 AM
Can anyone point me in a direction with this?
Title: Re: Need to set default country, store info setup, still not working!?
Post by: trodat on April 23, 2012, 07:17:06 AM
Bump, I'm stumped...  :(
Title: Re: Need to set default country, store info setup, still not working!?
Post by: david.kwock on April 24, 2012, 08:22:50 AM
Hi,
I had the same problem because my only target is AUS..
What I did to set the default country was manipulating MySql DB.
If you have a basic knowledge of MySQL, it is easy.
All you have to do is:
1. Open MySql -> Open a 'virtuemart_countries' table which is containing the country info.
2. Find USA and write down the country number for USA (AUS is 13)
3. Open 'virtuemart_userfields' table. and find a field name called 'virtuemart_country'.
4. On the same row, insert your country code into the default column.
5. Save
6. Visit your website, and check if USA is automatically selected by default.

Also you can use this method to set a default state and so on..:)

David

[Update by Milbo]
This field is now available by default, thanks David. You just need the id of the country and enter it to the default field.
Title: Re: Need to set default country, store info setup, still not working!?
Post by: trodat on April 24, 2012, 09:23:09 AM
WOW!!! David, you are a life saver! This is one of those things I can now cross of my "list" that was keeping me from putting the site live. Thank you again. Next beer is on me - coffee is ok too!  :D
Title: Re: Need to set default country, store info setup, still not working!?
Post by: david.kwock on April 24, 2012, 09:30:28 AM
Pleasure!! ;D
Mine is also still under a development process..one thing I need to add on my store is a date/time field on checkout process to make customer choose an order timing..
I hope you publish your site soon !

David
Title: Re: Need to set default country, store info setup, still not working!?
Post by: Milbo on December 12, 2012, 15:41:20 PM
I added the field for default. Now you can just enter the correct id for the country.
Title: Re: Need to set default country, store info setup, still not working!?
Post by: servlet on July 11, 2013, 07:42:40 AM
Quote from: david.kwock on April 24, 2012, 08:22:50 AM
Hi,
I had the same problem because my only target is AUS..
What I did to set the default country was manipulating MySql DB.
If you have a basic knowledge of MySQL, it is easy.
All you have to do is:
1. Open MySql -> Open a 'virtuemart_countries' table which is containing the country info.
2. Find USA and write down the country number for USA (AUS is 13)
3. Open 'virtuemart_userfields' table. and find a field name called 'virtuemart_country'.
4. On the same row, insert your country code into the default column.
5. Save
6. Visit your website, and check if USA is automatically selected by default.

Also you can use this method to set a default state and so on..:)

David

Thank you very much

It would be nice if this is default admin option...
Title: Re: Need to set default country, store info setup, still not working!?
Post by: fastpat27 on October 18, 2013, 18:49:21 PM
Thanks David and Milbo!  8)
Title: Re: Need to set default country, store info setup, still not working!?
Post by: sjshaffer on November 12, 2013, 07:44:59 AM
Quote from: Milbo on December 12, 2012, 15:41:20 PM
I added the field for default. Now you can just enter the correct id for the country.

Milbo,
Thank you for adding this feature!  I do have one request if possible:

It appears that to use this currently you need to look up the id number in the database.  Is it possible to use the 2 or 3 character country id to set the default in a future release?

Regards
Steve
Title: Re: Need to set default country, store info setup, still not working!?
Post by: szeor on May 27, 2014, 15:49:54 PM
Quote from: servlet on July 11, 2013, 07:42:40 AM
Quote from: david.kwock on April 24, 2012, 08:22:50 AM
Hi,
I had the same problem because my only target is AUS..
What I did to set the default country was manipulating MySql DB.
If you have a basic knowledge of MySQL, it is easy.
All you have to do is:
1. Open MySql -> Open a 'virtuemart_countries' table which is containing the country info.
2. Find USA and write down the country number for USA (AUS is 13)
3. Open 'virtuemart_userfields' table. and find a field name called 'virtuemart_country'.
4. On the same row, insert your country code into the default column.
5. Save
6. Visit your website, and check if USA is automatically selected by default.

Also you can use this method to set a default state and so on..:)

David

Thank you very much

It would be nice if this is default admin option...

Thank you..
big shit, doesn't work my website, and nothing countries.. thanks again :(
Title: Re: Need to set default country, store info setup, still not working!?
Post by: Milbo on May 27, 2014, 20:24:02 PM
You dont need to use the db anylonger. You can now set it directly
Title: Re: Need to set default country, store info setup, still not working!?
Post by: iscomputerman on November 20, 2015, 16:26:26 PM
When I set the default country in Virtuemart Shopper Fields, it no longer lets the states drop down in billing/shipping to populate states.  Once I remove the default, and select the country manually, the states become available.

How can this be solved?
Title: Re: Need to set default country, store info setup, still not working!?
Post by: GJC Web Design on November 20, 2015, 21:25:46 PM
You are not using a standard check out -- test on Prostar
Title: Re: Need to set default country, store info setup, still not working!?
Post by: iscomputerman on November 22, 2015, 19:29:07 PM
I'm using the standard Virtuemart checkout.  It was a template purchased from template monster.  No code modifications.  I'm considering reaching out to them. They are usually very good with "fixing" issues directly related to their templates, so long as you've not made any modifications and done your homework to ensure it's not user error. 
Title: Re: Need to set default country, store info setup, still not working!?
Post by: GJC Web Design on November 22, 2015, 22:17:33 PM
I have looked at your site.. the checkout is not standard... but if u won't try protostar then.....

chosen.js isn't loaded .. the ajax and the json is there for the states .. what ever JS select is being used isn't rendering it
Title: Re: Need to set default country, store info setup, still not working!?
Post by: iscomputerman on November 23, 2015, 03:12:44 AM
GC Web design - what is prostar? 
Title: Re: Need to set default country, store info setup, still not working!?
Post by: GJC Web Design on November 23, 2015, 10:21:40 AM
the standard Joomla bundled template... if you use this as a test then you won't use your template over rides but the std VM templates

Or try renaming templates/YOUR_TEMPLATE/html/com_virtuemart_

then the std templates will be used
Title: Re: Need to set default country, store info setup, still not working!?
Post by: amymattian on December 01, 2015, 15:44:10 PM
Hi Milbo,

two questions:
1) How exatly does adding default country work? I see the fields but how do I use them? (Is it first just the ID number and second as the title I want to show?) Sorry for asking stupid questions... :)
2) Is there a list of country ID's somewhere?

- Anne
Title: Re: Need to set default country, store info setup, still not working!?
Post by: AH on December 01, 2015, 16:20:35 PM
When you set a default country, it is used by aspects of the cart

It becomes the "default" selected country in the address details of the shopper addresses

Yes it is an ID

the list of countries and associated ID's can be found in

virtuemart admin/configuration/countries

As an example, the UK is ID 222