logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Marnix  
#1 Posted : Monday, July 29, 2019 8:33:52 AM(UTC)
Marnix

Rank: Newbie

Groups: Registered
Joined: 9/14/2017(UTC)
Posts: 5
Netherlands
Location: Rotterdam

What if my store is setup in just one country, and the region really doesn't matter...
How can I set up the checkoutaddress.cshtml, so by default it selects NL and it does not require a region.

The template shows something like:

<div class="formrow">
<div class="leftside checkoutbillformcountrydiv">
<label>@ResourceKey("General.lblCountry")</label>
@CountrySelectList(info, "genxml/billaddress/genxml/dropdownlist/country", "required name='billcountry' class='required' class='checkoutbillformcountry'")


<!-- hidden data field required to render ajax region update -->
<input id="ad_carttemplate" type="hidden" value="CheckoutRegion.cshtml">
<input id="ad_carttheme" type="hidden" value="ClassicAjax">
<input id="ad_uilang" type="hidden" value="@Utils.GetCurrentCulture()">
<input id="ad_region" type="hidden" value="@info.GetXmlProperty("genxml/billaddress/genxml/dropdownlist/region")">
<input id="ad_xpath" type="hidden" value="genxml/billaddress/genxml/dropdownlist/region">
<input id="ad_billregion" type="hidden" value="">
</div>
<div class="rightside checkoutbillformregiondiv">
<label>@ResourceKey("General.lblRegion")</label>
@RegionSelect(info, "genxml/billaddress/genxml/dropdownlist/region", "", "", false)
</div>
</div>

So what do I need, just replace it by something like:

<input id="billaddress_country" type="hidden" value="NL" >
Marnix  
#2 Posted : Monday, July 29, 2019 8:43:04 AM(UTC)
Marnix

Rank: Newbie

Groups: Registered
Joined: 9/14/2017(UTC)
Posts: 5
Netherlands
Location: Rotterdam

Actually, I have shipping costs set up for NL, and it does not add it right now.
So just setting:

<input id="billaddress_country" type="hidden" value="NL" >

Does not work....
What is the trick?!?
leedavi  
#3 Posted : Tuesday, July 30, 2019 2:44:41 AM(UTC)
leedavi

Rank: Administration

Groups: Registered, Administrators
Joined: 11/6/2016(UTC)
Posts: 322
United Kingdom
Location: France

Was thanked: 28 time(s) in 28 post(s)
I think it's based on a JQuery event. remove the class on the country.

@CountrySelectList(info, "genxml/billaddress/genxml/dropdownlist/country", "required name='billcountry' class='required' class='checkoutbillformcountry'")

to

@CountrySelectList(info, "genxml/billaddress/genxml/dropdownlist/country", "required name='billcountry' class='required' class=''")

and then remove the "region" dropdown (and textbox if you want)

I've not looked at the code, but I think that will do it.

Let me know if it doesn't work and I'll look deeper in the code for you.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.052 seconds.