Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State field Missing is Default country is not US #23

Closed
bheyde opened this issue Jan 26, 2016 · 2 comments
Closed

State field Missing is Default country is not US #23

bheyde opened this issue Jan 26, 2016 · 2 comments
Assignees

Comments

@bheyde
Copy link

bheyde commented Jan 26, 2016

See this thread:

http://www.miva.com/forums/forum/designers-and-developers/readytheme/levels-readytheme/681505-potential-bug-in-checkout-templates?_=1453826266554&_=1453833440641

Can we pass the default country in JS to the /scripts.js file so we don't have to hard code it?

@tessguefen
Copy link

I found this

<mvt:item name="countries" param="ShipCountry"/>

I think he is referring to the Other/State Province (we wouldn't have this for US).
I believe that is hidden. See screenshot below:
Screenshot

Do you want to add JS to check what country is selected, and if it's not US, we show it? (On the actual theme)..
or have that somewhere in the settings?*

@tessguefen
Copy link

on OCST:
search js-hide, and remove this class.

In readytheme settings (content section readytheme):
Replace this:

<script>
var theme_path = "&mvtj:global:theme_path;";
</script>

with:

<script>
var theme_path = "&mvtj:global:theme_path;";
var default_country = "&mvtj:global:store:country;";
</script>

in scripts.js:
find:

if( $select.val() === 'US')

replace with

if( $select.val() === default_country)

Also if they want the default estimate shipping "reset" to be with their country..
replace this:

$('#js-shipping-estimate-country').val('US');

with this:

$('#js-shipping-estimate-country').val(default_country);

This has been updated in Levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants