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

Solved
Redroot_Blades
Excursionist
18 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
3756 709 1079

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>

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!

View solution in original post

Replies 2 (2)
made4Uo
Shopify Partner
3756 709 1079

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>

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!
Redroot_Blades
Excursionist
18 3 3

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