modify checkout shipping/billing field validation requirements

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
Hi,

I've looked around and haven't been able to figure out how to change the validation requirements for the shipping and billing address at checkout.

I'd like to make the email address field optional.

I tried following the code, but got lost and couldn't tell where it was stating that the email field is required.

I'm in version 1.9 and have access to source code, any help would be really appreciated, thanks.
13 年 前
Hi,

You have to change this file : \NopCommerceStore\Modules\EmailTextBox.ascx
as :


<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Modules.EmailTextBox"
    CodeBehind="EmailTextBox.ascx.cs" %>
<asp:TextBox ID="txtValue" runat="server"></asp:TextBox>
<%-- Comment this required field validator
<asp:RequiredFieldValidator ID="rfvValue" runat="server" ControlToValidate="txtValue"
    Display="Dynamic">*</asp:RequiredFieldValidator>
--%>
<asp:RegularExpressionValidator ID="revValue" runat="server" ControlToValidate="txtValue"
    ValidationExpression=".+@.+\..+" ErrorMessage="<% $NopResources:Account.WrongEmailFormat %>"
    Display="Dynamic" />



Attention !! This will affect all pages or controls that use EmailTextBox control ;)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.