Hidden field in Contact Form ?

Darren Smith

No avatar

2007-04-27 23:37

The Contact Me page works fine. It send an email to me when someone uses it.

I have 2 QuickCart shops.

When I receive an email from the contact form, I don't know which shop it has come from.
I can't see if it is from shop A or shop B.

I think the answer might be a hidden form field but I am not sure.

I would like the email message I get to say "From shop A" or "From Shop B".

Any help appreciated.

Thanks

DS

ned

Avatar: ned

2007-04-28 13:10

Darren. This is for Q.C 2.1 and will add the referring site to both the Contact form and the Order email to the Administrator it should be similar in other versions.

You can add fields in the /lang/ file for each site such as
$lang['from'] = 'From';
$lang['this_site']= "Site A";
and change
$lang['mail_txt'] = 'You have received a new order. from $lang[this_site]. Login to that Administration Panel for details';

In /templates/contact.tpl add
<input type="hidden" name="sSite" value="$lang[this_site]" />
within the fieldset

Then in /core/other.php below
$sMailContent = $GLOBALS['lang']['First_last_name'].': '.$sName."\n".$sMailContent;
add
$sMailContent = $GLOBALS['lang']['from'].': '.$sSite."\n".$sMailContent;

HTH

ned

Avatar: ned

2007-04-29 11:20

..Ahem... must try harder!

You can add fields in the /lang/ file for each site such as
$lang['from'] = 'From';
$lang['this_site']= "Site A";

In /templates/contact.tpl add
<input type="hidden" name="sSite" value="$lang[this_site]" />
within the fieldset

To add the "Site A" to the contact form in /core/other.php below
$sMailContent = $GLOBALS['lang']['First_last_name'].': '.$sName."\n".$sMailContent;
add
$sMailContent = $GLOBALS['lang']['from'].': '.$sSite."\n".$sMailContent;

You can also add "Site A" to the mail to admin informing of a new order.
In /core/orders.php change to the following

if( $GLOBALS['config']['mail_informing'] === true )
@mail( $GLOBALS['config']['email'], $GLOBALS['lang']['mail_title'], $GLOBALS['lang']['mail_txt'], $GLOBALS['config']['this_site'], 'FROM: '.$GLOBALS['config']['email'] );
} // end function saveOrder
}

Darren Smith

No avatar

2007-04-30 13:21


Thanks for your help Ned,

I added the fields in the language file.

I edited the templates/contact.tpl too

I looked on core/other.php but couldn't find the line

$sMailContent = $GLOBALS['lang']['First_last_name'].': '.$sName."\n".$sMailContent;

Maybe it was changed for version 0.3.1.

Thanks again for your help.

Darren

DS

Darren Smith

No avatar

2007-08-13 17:38

Hi Ned,

I must have had too much to drink when I was following your instructions!

You solved the problem above.

Thank you very much.

Darren

DS

Back to top
about us | contact