【问题标题】:How to add more fields to contact us page in nop commerce?如何在 nopcommerce 中添加更多字段以联系我们页面?
【发布时间】:2018-03-13 08:10:27
【问题描述】:

如何在 nop commerce 中向“联系我们”表单添加更多字段?我是 nop 商务新手。

我向ContactUs.cshtml 添加了一个字段,但在我加载表单时没有显示任何内容。

我添加了邮政地址,但没有显示

                
                <div class="fieldset">
                    <div class="form-fields">
                        <div class="inputs">
                            @Html.LabelFor(model => model.FullName)
                            @Html.TextBoxFor(model => model.FullName, new { @class = "fullname", placeholder = T("ContactUs.FullName.Hint") })
                            @Html.RequiredHint()
                            @Html.ValidationMessageFor(model => model.FullName)
                        </div>
						
						<div class="inputs">
                            @Html.LabelFor(model => model.PostalAddress)
                            @Html.TextAreaFor(model => model.PostalAddress, new { @class = "postaladdress", placeholder = T("ContactUs.PostalAddress.Hint") })
                            @Html.RequiredHint()
                            @Html.ValidationMessageFor(model => model.PostalAddress)
                        </div>
						
                        <div class="inputs">
                            @Html.LabelFor(model => model.Email)
                            @Html.TextBoxFor(model => model.Email, new { @class = "email", placeholder = T("ContactUs.Email.Hint") })
                            @Html.RequiredHint()
                            @Html.ValidationMessageFor(model => model.Email)
                        </div>
                        @if (Model.SubjectEnabled)
                        {
                            <div class="inputs">
                                @Html.LabelFor(model => model.Subject)
                                @Html.TextBoxFor(model => model.Subject, new { @class = "subject", placeholder = T("ContactUs.Subject.Hint") })
                                @Html.RequiredHint()
                                @Html.ValidationMessageFor(model => model.Subject)
                            </div>
                        }
                        <div class="inputs">
                            @Html.LabelFor(model => model.Enquiry)
                            @Html.TextAreaFor(model => model.Enquiry, new { @class = "enquiry", placeholder = T("ContactUs.Enquiry.Hint") })
                            @Html.RequiredHint()
                            @Html.ValidationMessageFor(model => model.Enquiry)
                        </div>
                        @if (Model.DisplayCaptcha)
                        {
                            <div class="captcha-box">
                                @Html.Raw(Html.GenerateCaptcha())
                            </div>
                        }
                    </div>
                </div>
                <div class="buttons">
                    <input type="submit" name="send-email" class="button-1 contact-us-button" value="@T("ContactUs.Button")" />
                </div>
            }
        }
  

【问题讨论】:

  • 您使用的是主题吗?您的新代码看起来如何?更多信息会很好......
  • 你能告诉我们你的代码吗?你试过什么?
  • 我使用的主题我已经提供了上面的代码

标签: sql asp.net nopcommerce nopcommerce-3.90


【解决方案1】:

如果您使用的是主题,您应该编辑文件夹“Themes>NameOfYourTheme>WhatEverView”下的视图,而不是直接在“views”文件夹下的视图。

检查是否是这个原因。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多