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!
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025