frontend.checkout.postcoderequired CSS Fix


https://forum.kartris.com/Topic6297.aspx
Print Topic | Close Window

By jcosmo - Sat 28 Nov 2015
When setting the frontend.checkout.postcoderequired configuration setting to require the Postal Code, Kartris correctly requires that an entry is made but doesn't update the label to visually indicate it is a required field...

I'd suggest changing the CustomerAddress.ascx.vb file, at line 72 to the following:
If KartSettingsManager.GetKartConfig("frontend.checkout.postcoderequired") = "y" AndAlso value = True Then
valZipCodeRequired.Enabled = True
lblPostcode.CssClass = "requiredfield"
Else
valZipCodeRequired.Enabled = False
lblPostcode.CssClass = ""
End If


This fixes the issue so that the label visually indicates it as a required field based on the configuration setting.
By Paul - Fri 1 Jan 2016
Thanks, have added to the latest code, will be in the v2.9002 release.
By jcosmo - Sat 16 Jan 2016
I ended up having to make a change to this fix. I had implemented the check in the EnableValidation property, but I was seeing the postcode not get the required styling on the Shipping Address...

I found that the EnabledValidation property isn't toggled until the form tries to submit and was being initialized as false. So I moved the check to the PageLoad function at line 257:
If KartSettingsManager.GetKartConfig("frontend.checkout.postcoderequired") = "y" Then
lblPostcode.CssClass = "requiredfield"
Else
lblPostcode.CssClass = ""
End If


This correctly and reliably sets the styling on postcode for both Billing and Shipping addresses.
By Paul - Mon 8 Feb 2016
Ok, have done the same in the core code.