Close

Appending a Contact Us Form on a Custom Tab

ehubcap
10 years ago
#3638 Quote
Avatar
  • 43
Hi There:
I've trying to integrate a custom Contact us Form that I created, however I need help working the code to make it render correctly as seen on the help tab here
I have tested the form and it send the email message to the client.
Basically my struggle is trying to paste the form code into ~/../_producttabs.cshtml which wont compile because:

Error 5  'SevenSpikes.Nop.Plugins.NopQuickTabs.Models.TabUIModel' does not contain a definition for 'PartsSuccessfullySent' and no extension method 'PartsSuccessfullySent' accepting a first argument of type 'SevenSpikes.Nop.Plugins.NopQuickTabs.Models.TabUIModel' could be found (are you missing a using directive or an assembly reference?)  ....\Documents\Visual Studio 2013\Projects\Template00044\Presentation\Nop.Web\Plugins\SevenSpikes.Nop.Plugins.NopQuickTabs\Views\ProductTab\_ProductTabs.cshtml   240  40  Nop.Web


here is the appended code:
<div class="productTabs-body">
                @foreach (var pair in divs)
                {
                    <div id="@pair.Key">
                        @Html.Raw(@pair.Value)
                    </div>
                }
                @* Uncomment the code bewlow if you want to have a Tab that gets its information from a Topic. This tab will be shown for all products in your store *@
                <div id="tab-PartsContactUs">
                    @Html.Action("TopicBlock", "ProductTab", new { systemName = "PartsContactUs" })

                    <div class="page contact-page">
                        <div class="page-title">
                            <h1>@T("PageTitle.PartsContactUs")</h1>
                        </div>
                        @Html.Action("TopicBlock", "Topic", new { systemName = "PartsContactUs" })
                        <div class="page-body">
                            @Html.Widget("partscontactus_top")
                            @if (Model.PartsSuccessfullySent)
                            {
                                <div class="result">
                                    @Model.Result
                                </div>
                            }
                            else
                            {
                                using (Html.BeginForm())
                                {
                                    <div class="message-error">
                                        @Html.ValidationSummary(true)
                                    </div>
                                    <div class="form-fields">
                                        <div class="inputs-left">
                                            <div class="inputs">
                                                @Html.LabelFor(model => model.FullName)
                                                <div class="input-box">
                                                    @Html.TextBoxFor(model => model.FullName, new { @class = "fullname", placeholder = T("PartsContactUs.FullName.Hint") })
                                                </div>
                                                @Html.ValidationMessageFor(model => model.FullName)
                                            </div>
                                            <div class="inputs">
                                                @Html.LabelFor(model => model.Email)
                                                <div class="input-box">
                                                    @Html.TextBoxFor(model => model.Email, new { @class = "email", placeholder = T("PartsContactUs.Email.Hint") })
                                                </div>
                                                @Html.ValidationMessageFor(model => model.Email)
                                            </div>


Any help will be appreciated
Boyko
10 years ago
#3647 Quote
Avatar
  • Moderator
  • 1570
Hi EHUBCAP,

I don't think that what you are trying is even possible. You can't have one form element inside another one. On the product page you already have a form element and you can add any other form elements. The contact us form will not work by just coping it there. You need to use Ajax to submit some additional information. Please take a look at the product reviews tab where we have use Ajax to submit data to the server. You might also need to create a new action to any of the nopCommerce controllers, which will get the submitted information and process it.

I hope this information is useful!

Best Regards,
Nop-Templates.com Support Team
Regards,
Nop-Templates.com Team