Hi,
i had managed to complete a small mod whereby a customer can enquire about a product from admin for version 4.0+.
----
this is for version 4.0+ and tested on 4.017 for older versions there is better mod here
http://forum.x-cart.com/viewtopic.php?t=15362 .
--------------------------------
we would be using send to friend.php as base.
add following lines to send to friend.php before ?> .
if you could notice below text is similar to code already on file just
mode changed.
Quote:
if($mode == 'enquire') {
if($email && $from && $name) {
$mail_smarty->assign ("product", $product_info);
$mail_smarty->assign ("name", $name);
$mail_smarty->assign ("query", $query);
func_send_mail ($email, "mail/querysub.tpl", "mail/queryap.tpl", $from, $query, false);
$top_message["content"] = func_get_langvar_by_name("txt_inquiry_sent");
} else {
$top_message["content"] = func_get_langvar_by_name("err_filling_form");
$top_message["type"] = "E";
}
func_header_location("product.php?productid=".$pro ductid);
}
|
now create following files.
mail/queryap.tpl
mail/querysub.tpl
mine are as below.
mail/queryap.tpl
Quote:
{* $Id: send2friend.tpl,v 1.2 2004/05/31 10:52:01 max Exp $ *}
{config_load file="$skin_config"}
{include file="mail/mail_header.tpl"}
{assign var=max_truncate value=$config.Email.max_truncate}{math assign="max_space" equation="x+5" x=$max_truncate}{assign var="max_space" value="%-"|cat:$max_space|cat:"s"}
{$lng.lbl_hello}
{$name} has following query about the Product "{$product.product}" at http://www.yourURL.com/shop/product.php?productid={$product.productid}
{$query}
{include file="mail/signature.tpl"}
|
mail/querysub.tpl
Quote:
{config_load file="$skin_config"}Inquiry about {$product.product}
|
Now Create a language variable which would inform customer that inquiry is sent.
txt_inquiry_sent
add form code in product.tpl you can do it via .tpl file or directly copying into product.tpl
Quote:
<TABLE width="450" border="0" class="send-friend">
<FORM action="product.php" method="post" name="enquire">
<INPUT type="hidden" name="mode" value="enquire">
<INPUT type="hidden" name="productid" value="{$product.productid}">
<INPUT id="send_to" type="hidden" size="45" name="email" value="Your email@yoursite.com">
<TR>
<TD class="FormButton">Your Name :</TD>
<TD><FONT class="Star">*</FONT></TD>
<TD><INPUT id="send_name" type="text" size="45" name="name"></TD>
</TR>
<TR>
<TD class="FormButton">Your Email :</TD>
<TD><FONT class="Star">*</FONT></TD>
<TD><INPUT id="send_from" type="text" size="45" name="from"></TD>
</TR><tr>
<td valign="top" class="FormButton">Query</td>
<td valign="top"><FONT class="Star">*</FONT></td>
<td><TEXTAREA name="query" cols="40" rows="5"></TEXTAREA></td></tr>
<TR align="center">
<TD colspan="3">
<INPUT type="submit" name="Submit" value="Submit"></TD>
</TR>
</FORM>
</TABLE>
|
i hope this would be of help.