NopCommerce 2.2 Contuct us page customization

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 12 ans
Hi All,
  I add a new Text field in Contact us form. I have done this to update contactus.cshtml and ContactUsModel.cs files. But i am unable to add phone field in mail.  I add following code in Contactus.cshtml

                <tr class="row">
                    <td class="item-name">
                        @Html.LabelFor(model => model.Phone):
                    </td>
                    <td class="item-value">
                        @Html.TextBoxFor(model => model.Phone, new { style = "Width: 250px;" })
              
                    </td>
                </tr>

and add follwing code in ContactUsModel.cs
[AllowHtml]
        [NopResourceDisplayName("Phone")]
        public string Phone { get; set; }
Thanks
Il y a 12 ans
Hello,
As we are using MVC, you need to update Model, View AND Controller!
Because the process you need to change is ContactUsSend method in CommonController class.

Good luck
Il y a 12 ans
Hi Nicolas MUNIERE

Thank you very much. I relly Appriciate your effort. Please let me know how can i find exact function in CommonController as you tell me to change "ContactUsSend" for others views/models

Thanks
Il y a 12 ans
Well go to

Nop.Web>Controllers>CommonController.cs

Here you can look for ActionResult ContactUsSend , make amendments according to ur needs.
Il y a 12 ans
For upgrade purposes it might be better to make your own controller if you need this kind of modifications.
That way you can easily upgrade to a newer version
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.