You can copy the section of code in include/help.php
The section begins with...
Code:
if ($REQUEST_METHOD=="POST" and $action=="contactus") {
#
# Send mail to support
#
Copy the whole section down to the next comment, change $action=="contactus" to the name of your form. You then want to change the parameters for sending the email. It is the line:
Quote:
func_send_mail($config["Company"]["support_department"], "mail/help_contactus_subj.tpl", "mail/help_contactus.tpl", $contact["email"], true);
|
Make new templates (copy the existing ones, and change the names to whatever template names you give them). When editing the templates you will need to remove the if statements as appropriate (since the fields required/showing are the ones you set up in the config for the conact form). You also may need to adjust the javascript validation and other parts of the php section you copied as appropriate for your particular form.
If you want to email the results to an additional email address not already setup in your config, you can add value(s) to the xcart_config table using SQL and the field will appaear on the admin side (category = Company). Use the existing values as an example.
Finally access your new form by linking to "/help.tpl?section=
yourform" where
yourform is the title you gave your form. If you want to get fancy you can pass through the item they came from... make your link "/help.tpl?section=yourform&item={$product.product}"
then add to include/help.php
Code:
$item= stripslashes($item);
$smarty->assign("item", $item);
You can then include {$item} on your new contact template as a hidden field to pass the value through.
It is a little involed, but the advantage of this method is that users who are registered and logged in won't have to fill out their contact info each time they use the form.