Shopify themes, liquid, logos, and UX
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
Solved! Go to the solution
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>
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>
Wow, that totally worked! And they said it couldn't be done.... Thank you soooo much!
User | RANK |
---|---|
159 | |
138 | |
74 | |
69 | |
58 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023