Second contact form

1 2 >
Posted: April 27, 2012 at 8:26 AM Quote #68464
Hello,

I have the contact form working fine, but I want to add another page, something like "Request a demo".

This form would be entirely different to the in built Contact form, but would behave much the same way (user fills out form, clicks submit, email sent, confirmation page displayed).

I would like to know the best way about doing this please.

Should I try and copy the contact form, duplicate it, and use it's methods to send an email that has different fields?

I was thinking maybe make two topics, one form the contact form, one for the confirmation/thank you. Then just have the form submit to a page that processes the email that then redirects to the thank you page. I guess the processing page can be c#? Ideally I can pass variables between the pages, so my confirmation page can say "Thank you [submitters name] for requesting a demo".

I'll make a start and see what I can come up with, but if anyone has any good ideas please?

Thank you
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 27, 2012 at 9:41 AM Quote #68475
I just found in version 2 there was a "Request a quote" form plugin.

I believe there have been some significant changes since then. Maybe I can take the 2.00 plugin and update it to work with 2.5? What do you think?

Thanks
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 27, 2012 at 10:50 AM Quote #68480
I will follow

https://www.nopcommerce.com/boards/t/3177/urgent-i-need-to-create-a-new-page-with-a-fill-in-form-how-.aspx?p=1

But try to adapt it for MVC and let you know how I get on. If it's any good I'll try to figure out how to make it into a plugin that I can submit and give something back :)

If anyone has any hints or good ideas in the mean time please say :)

Thanks
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 04, 2012 at 9:06 AM Quote #69073
Just letting you know your not alone here, i'm trying to do exactly the same just with image upload and attachements.

Let us post our clues we gather in here.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 08, 2012 at 4:52 AM Quote #69286
I have managed to replicate the contact form and made a new "RequestADemo" form. It was fairly straightforward to be honest.

I created

Nop.Web/Views/Common/RequestADemo.cshtml (view),
Nop.Web/Models/Common/RequestADemo.cs (model),
RequestADemoValidator.cs (validator)

and expanded  

Nop.Web/Controllers/CommonControllers.cs (controller) and
Nop.Web/Infrastructure/RouteProvider.cs (route) to include the new RequestADemo stuff.

Each time I just copied the equivalent from ContactUs, replacing anywhere it said "ContactUs" with "RequestADemo".

After making sure that worked I then just expanded the view/validator/controller to handle more fields and updated the LocalStringResource database table to add lots of new phrases for my new form. I also added a RequestADemo topic to add content to the top of my form.


My next challenge is figuring out how I do more than just @Html.TextBoxFor and @Html.TextAreaFor?

I have looked for more in @Html, like @Html.Select, but it seems I have to add something like


<select id="selectDemoVersion" runat="server">
   <option value="1">One</option>
   <option value="2">Two</option>
   <option value="3">Three</option>
</select>


which doesn't seem right. Any ideas please? I'm not that hot with ASP.net.

Thanks!
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 08, 2012 at 6:29 AM Quote #69291
I got it!

@Html.DropDownListFor(
                            model => model.PreviousVersion,
                            new SelectList(
                                    new List<Object>{
                                        new { value = 1 , text = "Yes"  },
                                        new { value = 0 , text = "No" }
                                    },
                                    "value",
                                    "text"
                            )
                        )


and

@Html.CheckBoxFor(model => model.AgreeToTerms, new { @class = "agreetoterms" })


Which work for me, but if there is a better way let me know :)
This post/answer is useful
3
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 19, 2012 at 10:18 PM Quote #72274
Russ,

Can you please upload your code to help others ??
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 20, 2012 at 2:29 AM Quote #72281
Elisha: What are you stuck on specifically? As per my post I basically copied all the files that I listed and renamed the word "Contact" with "RequestADemo" each time :)
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 20, 2012 at 9:22 AM Quote #72293
Russ,

I just tried setting up default email address for the similar functionality but it never goes through.

Also, I am newbie on this and I do not know much about these all so I was wishing if you can help me out posting your code in zipped format with folder specific so that I can just copy paste and see how it looks on my demo application

Thanks much,
Elisha Cornelius
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 20, 2012 at 9:42 AM Quote #72294
elisha;

Start by copying

Nop.Web/Views/Common/ContactUs.cshtml (view),
Nop.Web/Models/Common/ContactUs.cs (model),
Nop.Web/Validators/Common/ContactUsValidator.cs (validator)

And replace anything that says "ContactUs" with what you would like to call your form (in my case "RequestADemo").

Then edit

Nop.Web/Controllers/CommonControllers.cs (controller)

(hint: there are two functions, both under "//contact us page" called ContactUs() and ContactUsSend())

Nop.Web/Infrastructure/RouteProvider.cs (route)

(hint: this bit

//contact us
            routes.MapLocalizedRoute("ContactUs",
                            "contactus",
                            new { controller = "Common", action = "ContactUs" },
                            new[] { "Nop.Web.Controllers" });


)

duplicating anything that seems specific to ContactUs to become "RequestADemo".

I'm pretty sure that's literally all I did.

Have a go at that, should be straight forward.
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
1 2 >
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.