On our web site's Product Detail pages I have added an "Ask an Expert" button. See, for example
Clicking this button pops up a simple email form (see code below). One line in this form looks like this "Preferred Contact Method: o Email o Phone," where the two "o"s are radio buttons. The idea is that the value of the radio button would be passed to the email that is sent to our Customer Service so we would know whether the customer wants to receive our advice via email or via phone. The form is working (the emails come through, along with all the customer-inserted information), and we have made some sales through this mechanism. However, the value of the radio buttons is not being passed to the emails. I have inserted the tpl code and the related php code below.
Any help that anyone can provide to help me get the values of the radio buttons passed to the emails would be most appreciated.
Code:
<?php
/*****************************************************************************\
+-----------------------------------------------------------------------------+
| X-Cart |
| Copyright (c) 2001-2004 Ruslan R. Fazliev <rrf@rrf.ru> |
| All rights reserved. |
+-----------------------------------------------------------------------------+
| PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" |
| FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE |
| AT THE FOLLOWING URL: http://www.x-cart.com/license.php |
| |
| THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE |
| THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. |
| FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING |
| AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). |
| PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT |
| CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, |
| COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY |
| (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS |
| LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS |
| AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND |
| OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS |
| AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE |
| THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.|
| THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. |
| |
| The Initial Developer of the Original Code is Ruslan R. Fazliev |
| Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2004 |
| Ruslan R. Fazliev. All Rights Reserved. |
+-----------------------------------------------------------------------------+
\*****************************************************************************/
#
# $Id: product.php,v 1.55.2.1 2004/02/05 12:25:45 mclap Exp $
#
require "./auth.php";
#
# Put all product info into $product array
#
$email=array_pop(func_query_first("select email from $sql_tbl[customers] where login='$login'"));
$smarty->assign("your_email",$email);
$smarty->assign ("your_name", $your_name);
if($mode=="send")
{
if(empty($your_email) || empty($your_name)){
/* if(empty($friend_email) || empty($your_email)){ */
$smarty->assign("error", "Sorry, the form was not filled in correctly.");
$smarty->assign ("your_email", $your_email);
/* $smarty->assign ("friend_email", $friend_email); */
$smarty->assign ("friend_email", "expert@bitsbytescomputer.com");
$smarty->assign ("message", $message);
$smarty->assign ("phone", $phone);
$smarty->assign ("your_name", $your_name);
$smarty->assign ("email_me", $email_me);
$smarty->assign ("phone_me", $phone_me);
}
else
{
$check=array_pop(func_query_first("select do_not_email from $sql_tbl[customers] where email='$friend_email'"));
if($check=="Y"){
$smarty->assign("error", "This customer does not want to receive mail.");
$smarty->assign ("your_email", $your_email);
/* $smarty->assign ("friend_email", $friend_email); */
$smarty->assign ("friend_email", "expert@bitsbytescomputer.com");
$smarty->assign ("message", $message);
$smarty->assign ("phone", $phone);
$smarty->assign ("your_name", $your_name);
$smarty->assign ("email_me", $email_me);
$smarty->assign ("phone_me", $phone_me);
}
else
{
$product = func_select_product($productid, $user_account['membership']);
$mail_smarty->assign ("product", $product);
$mail_smarty->assign ("email", $your_email);
$mail_smarty->assign ("message", $message);
$mail_smarty->assign ("phone", $phone);
$mail_smarty->assign ("your_name", $your_name);
$mail_smarty->assign ("email_me", $email_me);
$mail_smarty->assign ("phone_me", $phone_me);
func_send_mail ("expert@bitsbytescomputer.com","mail/send_to_expert_subj.tpl","mail/send_to_expert.tpl",$your_email, false);
/* func_send_mail ($friend_email, "mail/send_to_expert.tpl", "mail/wishlist_send2friend_subj.tpl", "mail/send_to_friend.tpl", $your_email, false); */
/* func_send_mail ("expert@bitsbytescomputer.com", "mail/wishlist_send2friend_subj.tpl", "mail/send_to_friend.tpl", $your_email, false); */
$smarty->assign("mode", "send");
}
}
}
$product_info = func_select_product($productid, @$user_account['membership']);
$smarty->assign("product",$product_info);
$smarty->display("customer/main/email_to_expert.tpl");
?>