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!
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025