X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   send_to_friend feature to be a request additional info (https://forum.x-cart.com/showthread.php?t=20397)

matthew@wallstudios.com.a 03-08-2006 06:14 PM

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);
}

?>


slade 05-20-2006 08:16 PM

hey great mod :D now my customers will be able to ask a qustion about a product they are interested in thankyou.

B00MER 05-20-2006 08:52 PM

Nice!, I know awhile back my old 3.5.x send to friend mod, someone tweaked for the very same purpose. Defiantly something X-Cart should consider to add an option so you can easily change it from send to friend to enquire about product. Kudos! :wink:

Jerrad 07-03-2006 02:23 PM

This seems like a great mod and exactly what I'm looking for!
Only problem is that I'm using the send_to_friend feature... :(

So, I'm wondering if anyone knows a way to get this working without losing the send_to_friend feature?

Thanks in advance! :D

alru111 07-30-2006 09:35 PM

this seems to work fine.
I would make it a pop up and get rid of that prehistoric confirmation window (dialogue.tpl)
Would be nice to add a 'sign up for updates on this product' option that would involve a couple of db queries.

pauldodman 07-31-2006 01:31 AM

Quote:

So, I'm wondering if anyone knows a way to get this working without losing the send_to_friend feature?

Are you still looking for this?
If so, is this the kind of thing you need? for example:
http://www.japangarden.co.uk/-Venetian-Screen-SPECIAL-OFFER-pr-481.html

ecommerce 07-31-2006 01:39 PM

hey paul,

thats exactly what im looking for!

can you help out?

pauldodman 08-01-2006 01:08 AM

Hi,

sent you a PM with some details.

nfc5382 05-01-2007 07:40 PM

Re: send_to_friend feature to be a request additional info
 
thanks!

mmonger 05-28-2007 11:25 AM

Re: send_to_friend feature to be a request additional info
 
Regarding the sendtofriend.php script (the original):

We need to get an email (i.e. to webmaster@domain.com) of the email that was sent from a visitor on the board. Is there a way to, I guess, CC: us on what was sent? There currently appears to be no way to see what people are sending to themselves or their friends.

Any help would be appreciated...

Thanks in advance!


All times are GMT -8. The time now is 09:19 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.