change default country on shipping estimate drop down in cart -- Pipeline Theme

Solved

change default country on shipping estimate drop down in cart -- Pipeline Theme

Redroot_Blades
Excursionist
22 3 3

Hi Folks, 

 

When you add a product to the cart, and it slides out (drawer style), there is a shipping estimator at the bottom. The default country is Afghanistan. I'd like it to be United States. Here is the piece of code I found  in the "cart-shipping.liquid" page:

 

<div class="p">
<label class="small" for="estimate_address_country">{{ 'customer.addresses.country' | t }}</label>
<select id="estimate_address_country"
name="address[country]"
{% if shop.customer_accounts_enabled and customer %}
data-default="{{ customer.default_address.country_code }}"
data-default-fullname="{{ customer.default_address.country }}"
{% elsif default_country != '' %}
data-default="{{ default_country.iso_code }}"
data-default-fullname="{{ default_country }}"
{% endif %}></select>
</div>

 

Can the " {% elsif default_country != '' %} " somehow display United States? 

 

With the inspector, I found " <option value="US">United States</option> " . Could I somehow select this option to display in the elsif situation above? 

 

Thanks for looking,

Dustin

redrootblades.com

Accepted Solution (1)

made4Uo
Shopify Partner
3840 716 1177

This is an accepted solution.

Hi @Redroot_Blades,

 

Base on the code you provided, you can probably use this edited code below. NOTE: Please change the select element only. It seems your code has multiple element missing

 

<select id="estimate_address_country"
name="address[country]"
{% if shop.customer_accounts_enabled and customer %}
data-default="{{ customer.default_address.country_code }}"
data-default-fullname="{{ customer.default_address.country }}"
{% else %}
data-default="US"
data-default-fullname="United States"
{% endif %}></select>

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Replies 2 (2)

made4Uo
Shopify Partner
3840 716 1177

This is an accepted solution.

Hi @Redroot_Blades,

 

Base on the code you provided, you can probably use this edited code below. NOTE: Please change the select element only. It seems your code has multiple element missing

 

<select id="estimate_address_country"
name="address[country]"
{% if shop.customer_accounts_enabled and customer %}
data-default="{{ customer.default_address.country_code }}"
data-default-fullname="{{ customer.default_address.country }}"
{% else %}
data-default="US"
data-default-fullname="United States"
{% endif %}></select>

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
Redroot_Blades
Excursionist
22 3 3

Wow, that totally worked! And they said it couldn't be done.... Thank you soooo much!