Shipping / Billing address fields showing as required even though they aren't marked as such

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
We have two fields listed on the shipping / billing address form; company and fax number, that display correctly as not being required (there's no asterisk next to the field).

But, when you're viewing on a mobile device or shrink your browser window down enough, these two fields are showing as being required.

Our test users noted that this was a bit confusing as they don't have a fax number or company.

I see in the code of the page:

<div class="visible-xs form-title-required"> <span class="Required">*</span>


is being referenced. And I suppose that might be why it's showing up for all of the fields (I may be off base. I'm still learning the code base. and my .net and web development is a bit rusty).

But, I don't know of the best way to rectify this situation for our mobile users. I don't want to remove that reference (if it is indeed the culprit), as there may be a time when we do require those fields.

Any thoughts or suggestions? Thanks!
7 years ago
It sounds like there's been some customisation of the views. Could be from a theme you're using or a change in your code but if you look at the code for the _CreateOrUpdateAddress.cshtml view from the nop default theme you'll see blocks of code like this:

@if (Model.FaxRequired)
{
    @Html.RequiredHint()
}

Which is saying only display the required hint (the asterisk) for the fax number if the FaxRequired property of the AddressModel is true. Have a look at the corresponding view on your site (which might be in the themes folder if you're using one) and see if you see similar markup.

If it's a third party theme and you haven't modified it yourself then I'd be reporting it back to the theme vendor as a bug. If you've modified the views yourselves then you should go through and add similar conditional markup. Also note that earlier versions of nop used separate views for the mobile rendering instead of the current responsive css approach so the view files might be different if you're on a much earlier version of nop.
7 years ago
That was it exactly. We're using a custom theme and the _CreateOrUpdateAddress.cshtml page had
<div class="visible-xs form-title-rquired
on a separate line from the others and it wasn't checking to see if the company / fax was actually required. I'm still getting a handle on the structure of nopcommerce, so I'd probably still be trying to figure this out next week. Thanks so much for your help!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.