Building a Form

Adding a custom form to collect other data

Adding a custom form to your site is a common customization. There are a few guidelines for when you do this:

A good model for all of this is the Ask a Question feature, which has been part of Zen Cart since 1.5.7. See the following files:

  • includes/modules/pages/ask_a_question/header_php.php
  • includes/templates/template_default/templates/tpl_ask_a_question_default.php

Alternative Approach - Use a Form Builder

Another option which is highly recommended for storeowners who don’t have a developer is to use a form building tool like Wufoo.

A Wufoo form can easily be embedded on a extra define page (page_2, page_3, page_4) or an existing page like Contact Us. In the case of Contact Us, you would just edit the template file (includes/templates/YOURTEMPLATE/templates/tpl_contact_us_default.php) and replace the built-in form with the script from Wufoo. Similarly, using a define page would just mean editing the template file and inserting the script below the content div.




Still have questions? No problem! Just head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified September 4, 2020 by Chris Brown (d3f281ef).