How can I set default country in country dropdown in checkout page?
-
@foreach (core()->countries() as $country) @if($country->code=="NP") <option selected value="{{ $country->code }}">{{ $country->name }}</option> @else <option value="{{ $country->code }}">{{ $country->name }}</option> @endif @endforeach
This didn't work.
-
Hello @bjsharma ,
add your default country code to the component (checkout) at the following path:
go to packages/Webkul/Shop/Resources/views/checkout/onepage.blade.php
add value like country: 'IN' to address.billing{} array (line 140).Thank you.
-
You mean:
address: {
billing: {
address1: [''],
country: ['NP'],use_for_shipping: false, },
But didn,t work.
-
@Naresh-webkul Thank u, it worked after i changed it in my custom theme.
-
Hi @bjsharma ,
remove array [] from country field.
thank you. -
Your Welcome @bjsharma .
-
@Naresh-webkul removed [] and all done. Thank u