View Single Post
  #1  
Old 03-08-2006, 06:14 PM
 
matthew@wallstudios.com.a matthew@wallstudios.com.a is offline
 

Newbie
  
Join Date: Dec 2005
Posts: 5
 

Default send_to_friend feature to be a request additional info

I have just modified the send_to_friend feature to be a request additional info in X-cart Gold 4.0.17.

I don't know if it will be of any use to anyone or not. I'm new to this so I'm sure there are better ways of doing this or things that could be changed to make it better so any feed back would be good.

I have based this on a mod that was done by Shan to add a text field to the send_to_friend
http://forum.x-cart.com/viewtopic.php?t=15657&highlight=sendtofriend

there are three main files that need to be modified.

skin1/customer/main/send_to_friend.tpl
skin1/mail/html/send2friend.tpl
send_to_friend.php

this mod was done on X-cart Gold 4.0.17 with the tabs mod as well.

before you try backup all files that need to be changed.

you will also need to change the language lbl_recommendation to something like "Website Information Request"
if you don't use HTML for you emails you will also need change skin1/mail/send2friend.tpl

Hope this makes sense.
you need to add your email address details as well. Change "info@your-email-address.com.au"> to where ever you want it to go

skin1/customer/main/send_to_friend.tpl

Code:
{* $Id: send_to_friend.tpl,v 1.6.2.2 2004/12/10 13:14:52 max Exp $ *} {* WALLSTUDIOS - REQUEST INFO *} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var requiredFields = new Array(); requiredFields[0] = new Array('send_name', "{$lng.lbl_send_your_name|strip_tags|replace:'"':'\"'}", false); requiredFields[1] = new Array('send_lastname', "{$lng.lbl_last_name|strip_tags|replace:'"':'\"'}", false); requiredFields[2] = new Array('send_from', "{$lng.lbl_send_your_email|strip_tags|replace:'"':'\"'}", false); requiredFields[3] = new Array('send_to', "{$lng.lbl_sent_recipient_email|strip_tags|replace:'"':'\"'}", false); requiredFields[4] = new Array('send_company', "{$lng.lbl_company|strip_tags|replace:'"':'\"'}", false); requiredFields[5] = new Array('send_phone', "{$lng.lbl_phone|strip_tags|replace:'"':'\"'}", false); </SCRIPT> {include file="check_required_fields_js.tpl"} {include file="check_email_script.tpl"} {capture name=dialog} <TABLE border="0"> <FORM action="product.php" method="post" name="send"> <INPUT type="hidden" name="mode" value="send"> <INPUT type="hidden" name="productid" value="{$product.productid}"> <INPUT type="hidden" name="email" id="send_to" value="info@your-email-address.com.au"> <TR> <TD class="FormButton">{$lng.lbl_send_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">{$lng.lbl_last_name}:</TD> <TD><FONT class="Star">*</FONT></TD> <TD><INPUT id="send_lastname" type="text" size="45" name="lastname"></TD> </TR> <TR> <TD class="FormButton">{$lng.lbl_send_your_email}:</TD> <TD><FONT class="Star">*</FONT></TD> <TD><INPUT id="send_from" type="text" size="45" name="from" onchange="javascript: checkEmailAddress(this);"></TD> </TR> <TR> <TD class="FormButton">{$lng.lbl_company}:</TD> <TD><FONT class="Star">*</FONT></TD> <TD><INPUT id="send_company" type="text" size="45" name="company"></TD> </TR> <TR> <TD class="FormButton">{$lng.lbl_phone}:</TD> <TD><FONT class="Star">*</FONT></TD> <TD><INPUT id="send_phone" type="text" size="45" name="phone"></TD> </TR> <TR> <TD class="FormButton" valign="top">Add A Message:</TD> <TD><FONT class="Star"></FONT></TD> <TD><textarea name="msg" id="msg" cols="40" rows="4"></textarea></TD> </TR> <TR> <TD colspan="3"> {include file="buttons/button.tpl" style="button" button_title=$lng.lbl_send_to_friend href="javascript: if(checkRequired('')) document.send.submit();"}</TD> </TR> </FORM> </TABLE> {/capture} {include file="dialog.tpl" title=$lng.lbl_send_to_friend content=$smarty.capture.dialog extra="width=100%"}

skin1/mail/html/send2friend.tpl

Code:
{* $Id: send2friend.tpl,v 1.2.2.1 2004/10/21 07:51:07 max Exp $ *} {config_load file="$skin_config"} {* wallstudios -INFO REQUEST ADDED *} </p> INFORMATION REQUEST FROM WEBSITE!! </p> <table width="549" border="0" cellspacing="0" cellpadding="3"> <tr> <td width="145">NAME:</td> <td width="404">{$name} </td> </tr> <tr> <td>SURNAME:</td> <td>{$lastname}</td> </tr> <tr> <td>COMPANY NAME:</td> <td>{$company}</td> </tr> <tr> <td>EMAIL: </td> <td>{$from}</td> </tr> <tr> <td>PRODUCT ID:</td> <td>{$product.productcode} <FONT size="1"> </FONT></td> </tr> <tr> <td height="46">MESSAGE</td> <td>{$msg}</td> </tr> </table> Has Requested additional information on:</p> {$product.product} - {$lng.lbl_price}: {include file="currency.tpl" value=$product.taxed_price} {$product.descr}{$product.productcode} <FONT size="1"> </FONT> {$lng.eml_please_click_link}</p> = {$catalogs.customer}/product.php?productid={$product.productid} {include file="mail/html/signature.tpl"}</p>


send_to_friend.php
Code:
# # $Id: send_to_friend.php,v 1.1.2.1 2004/10/14 06:15:50 max Exp $ # if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); } if(!$productid) func_header_location ("error_message.php?access_denied&id=48"); if($mode == 'send') { if($email && $from && $name) { $mail_smarty->assign ("product", $product_info); $mail_smarty->assign ("name", $name); $mail_smarty->assign ("lastname", $lastname); $mail_smarty->assign ("msg", $msg); $mail_smarty->assign ("from", $from); $mail_smarty->assign ("company", $company); func_send_mail ($email, "mail/send2friend_subj.tpl", "mail/send2friend.tpl", $from, false); $top_message["content"] = func_get_langvar_by_name("txt_recommendation_sent"); } else { $top_message["content"] = func_get_langvar_by_name("err_filling_form"); $top_message["type"] = "E"; } func_header_location("product.php?productid=".$productid); } ?>
__________________
lc 2.2.21
Reply With Quote