Jump to content

Multiple Contact Forms


Recommended Posts

Hello,

 

I'm trying to make two contact forms that require different information from the customer for each one. I have tried duplicating and modifying some values in the following files:

 

  • ContactController.php
  • Contact.php
  • contact-form.tpl
  • email templates (after i get the template file to display)

 

but I can't get the the duplicate file contact-form2.tpl to display. Can someone help me modify the controller(s) so it points to my contact-form2.tpl? Is there any other files involved?

 

ex. the duplicate url to access contact-form2.tpl would be http://www.example.com/index.php?controller=contact2

 

Thanks!

 

Prestashop 1.6.1.16

Edited by dirtrider118 (see edit history)
Link to comment
Share on other sites

Figured it out.

 

For anyone wanting two contact forms:

 

  1. Duplicate ContactController.php and rename to ex. NewContactController
  2. Change class name from ContactControllerCore to ex. NewContactControllerCore
  3. Change the php self variable to ex. newcontact on line 29
  4. Duplicate contact-form.tpl and rename to ex. new-contact-form.tpl
  5. Point to your new template file by editing $this->setTemplate(_PS_THEME_DIR_.'contact-form.tpl'); on line 255
  6. Delete class_index.php in cache folder in root directory
  7. Login to admin backend and add page to SEO & URLS.
  8. Access the page URL by http://example.com/index.php?controller=newcontact

 

This is how i got a second contact page to display. Adding new form fields and variables is up to you.

 

Cheers!

Edited by dirtrider118 (see edit history)
  • Thanks 2
Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...