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 on product pages. (https://forum.x-cart.com/showthread.php?t=216)

laureon 03-29-2004 08:46 AM

code has been added to: skin1/common_templates.tpl. If it is removed from skin1/common_templates.tpl, there is the message 'page cannot be found'. There is obviously something wrong .... somewhere.

B00MER 03-29-2004 09:43 AM

Validate that skin1/customer/sendtofriend.tpl exists and contains the correct content.

You can also try running cleanup.php in the root of your x-cart install to clear the templates_c/ folder so smarty rebuilds all templates.

arabayaservis.com 05-10-2004 12:58 AM

There is not file on server!

How can i download this mod?

PhilJ 05-10-2004 05:06 AM

try now

B00MER 05-10-2004 05:17 AM

The same file is available on cart-lab.com under freebies.

2getInk 05-10-2004 05:48 AM

I was wondering if we can attach product thumbnail with these emails. My cart thumbnails are on the file system (not in database). Will these two situations have to be delt with differently?

Thanks Boomer for this great, great feature. :D

nerd luv 06-02-2004 03:22 PM

For version 3.4.14
 
Wonderful mod, thank you! Got the bulk of it up very quickly, and now I'm just hoping to add one extra piece of info.

I see that a couple people asked about adding product name/description into the e-mails, but I have not seen anyone acomplish this yet.

Has anyone figured it out? It occured to me that without adding at least the product name to the e-mail, it looked fairly suspicious, like a piece of spam. Unless my "friend" had actually included his/her real full name (which I imagine not everyone will be apt to do) I would be likely to delete the e-mail without visiting the mystery link.

Any help would be greatly appreciated! :D

nerd luv 06-14-2004 08:02 PM

Is anyone willing to help figure this out for a small fee? I need at least the product name in the e-mail, and a description and thumbnail would be good, too.

B00MER 06-15-2004 08:31 AM

Feel free to send me a request to requests@cart-lab.com and I'll see what I can do, shouldn't be too terribly difficult. ;)

mygitar 08-18-2004 02:19 PM

hi friends

where can i get the latest version (4.0.2) of "Enquire_Mod and Send to Friend Mod"..

if anyone here uses or has it could you please share it with me? :cry:

Thanks for your help... :roll:

B00MER 08-18-2004 02:31 PM

You can find copies of the installs here:
:arrow: http://www.cart-lab.com/lab/customer/pages.php?pageid=3

mygitar 08-18-2004 03:37 PM

hi again

i tried that code but it doesn't work..i'm using version 4.0.2.


thanks for your help

B00MER 08-18-2004 03:56 PM

4.0 has a send to friend module out-of-box.

snorocket 08-19-2004 04:56 AM

cart-lab
 
download on BOOMERS site cart-lab.com, look under freebies on the left menu at the bottom

shan 09-08-2004 06:29 AM

send to friend is built into v4.

adpboss 09-21-2004 08:05 PM

Anyone mod this so that the emails are saved?

I would love to have that as marketing info to see how useful Send to friend really is.

EnriqueHavoc 10-21-2004 02:39 PM

i somehow disabled the send to friend feature and now i cant figure out where to turn it back on again... im sure its somewhere obvious :P

im trying to get it to work with Boomers Tabbed Product Menu

adpboss 10-21-2004 03:03 PM

Modules???

EnriqueHavoc 10-21-2004 03:20 PM

nope... thats where i thought it would be, but its not an option

i cant for the life of me remember how i turned it off.. maybe i deleted something :/

shan 10-21-2004 03:26 PM

you must have deleted it from products.tpl

EnriqueHavoc 10-21-2004 04:12 PM

this is making me scratch my head... http://www.motionzoo.com/forum/images/smilies/more/headscratch.gif

i unzipped the original, unedited 4.0.0 installation and products.tpl contains no references to "send to friend"

product.tpl is calling it through the cartlab-tabs.tpl include so it seems like it should be working...

are you really sure theres no option somewhere to turn it on/off?

EnriqueHavoc 10-21-2004 04:43 PM

well i dont know if there is a better way to do it with a conditional to make it work with Boomers tabbed product menu mod, but i added

Quote:

[*]Send to Friend

to cartlab-tabs.tpl and it shows up now

EnriqueHavoc 10-21-2004 04:48 PM

also now that send to friend is part of the default xcart, is there any way to stop people from abusing this and spamming 10000 emails through it?

shan 10-22-2004 04:14 AM

Sorry, yeh product.tpl

EnriqueHavoc, have you seen the send to friend being spammed ? if so this needs to be fixed

EnriqueHavoc 10-22-2004 11:49 AM

nope- i havent seen it be spammed, but i just suspect it could be abused.

doersam@hotmail.com 10-23-2004 09:07 PM

I can't seem to get this to work in my 3.5.10 test shop. When you click on the Send-To-A-Friend link, I get a blank page with a url like this:

http://domain-name.com/customer/sendtofriend.php?mode=update&productid=16164

Any ideas where I might have messed up?

dashonice 06-23-2005 05:29 PM

hi guys,

I have 4.12 installed which has send to friend by default, but I like the fuctionality of a text link instead of it filling up the product page. Any ideas how to link to send to friend? I have tried
Code:

<A href="send_to_friend.php?mode=update&productid={$product.productid}">
with unsucessful results. It just takes me back to the home page. Any help would be appreciated. Thanks.

bardolino 03-14-2006 11:23 AM

I really like this mod, much more than the out of the box functionality of 4.x. Is there anyway to make this work on a 4.x installation?

markwhoo 03-14-2006 01:12 PM

Quote:

Originally Posted by bardolino
I really like this mod, much more than the out of the box functionality of 4.x. Is there anyway to make this work on a 4.x installation?


Install it and comment out the out of can mod and now you only use the custom mod.

then it is done.

Lionel 03-14-2006 02:54 PM

Quote:

Originally Posted by markwhoo
Quote:

Originally Posted by bardolino
I really like this mod, much more than the out of the box functionality of 4.x. Is there anyway to make this work on a 4.x installation?


Install it and comment out the out of can mod and now you only use the custom mod.

then it is done.


That did not work for me. I had to do my own sendtofriend.php page, by simply including current can.

Code:

<?php
#
# altered Send to Friend Mod 4.18
#

require "./auth.php";
require $xcart_dir."/include/categories.php";
if($active_modules["Manufacturers"])
    include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";
if($active_modules["Bestsellers"])
  include "modules/Bestsellers/bestsellers.php";

$product_info = func_select_product($productid, $user_account['membership']);
$cat = $product_info["categoryid"];

$userinfo = func_userinfo($login,$login_type);

include "send_to_friend.php";

$smarty->assign("userinfo",$userinfo);
$smarty->assign("fillerror",$fillerror);
$smarty->assign("main","send_to_friend");
$location[] = array(func_get_langvar_by_name("lbl_send_to_friend", ""));
$smarty->assign("location",$location);
$smarty->assign("product",$product_info);

func_display("customer/home.tpl",$smarty);

?>


and since I display image of item to be sent in that send page, here is my send_to_friend.tpl

Code:

{* $Id: send_to_friend.tpl,v 1.6.2.2 2004/12/10 13:14:52 max Exp $ *}

The product you have selected to send to your friend:


<table><tr>
<td><a href=product.php?productid={$smarty.get.productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$smarty.get.productid image_x=100 product=$products[product].product}</a></td>
<td></td>
<td>Product: <font class="red">{$product.product|escape}</font>


{$product.descr|truncate:100:"...":true}</td>
</tr></table>


<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_from', "{$lng.lbl_send_your_email|strip_tags|replace:'"':'\"'}", false);
requiredFields[2] = new Array('send_to', "{$lng.lbl_sent_recipient_email|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}">

<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_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_sent_recipient_email}:</TD>
        <TD><FONT class="Star">*</FONT></TD>
    <TD><INPUT id="send_to" type="text" size="45" name="email" onchange="javascript: checkEmailAddress(this);"></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="44" rows="12"></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%"}


I had the textarea mod already installed. This turned out to be better. It simply does not display the outgoing template.

B00MER 03-14-2006 07:55 PM

Quote:

Originally Posted by dashonice
I have tried
Code:

<A href="send_to_friend.php?mode=update&productid={$product.productid}">
with unsucessful results. It just takes me back to the home page. Any help would be appreciated. Thanks.


sendtofriend.php NOT send_to_friend.php ;)

Here's an updated sendtofriend.php file that SHOULD be 4.0.x compatible, I've not tested it but, it all essesence should be the only part of the mod that needs to be updated, mainly the func_display() function call at the end instead of $smarty->display();
Code:

<?php
#
# Send to Friend Mod v4.0.x compatible
# cart-lab.com 3/14/2006 10:56PM

require "./auth.php";
require $xcart_dir."/include/categories.php";

if($active_modules["Bestsellers"])
  include $xcart_dir."/modules/Bestsellers/bestsellers.php";

if($active_modules["Manufacturers"])
        include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";

$product_info = func_select_product($productid, $user_account['membership']);
$cat = $product_info["categoryid"];

$userinfo = func_userinfo($login,$login_type);

if ($REQUEST_METHOD=="POST") {

#
# Send mail to friend
#
  $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]);

  while (list($key,$val) = each($HTTP_POST_VARS))
      $contact[$key]=$val;

    $fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["sendtoemail"]));

  if(!$fillerror) {
      $mail_smarty->assign("contact",$contact);

      func_send_mail($contact["sendtoemail"], "mail/sendtofriend_subj.tpl", "mail/sendtofriend.tpl", $contact["email"], true);

    $productid = $product_info['productid'];
      header("Location: sendtofriend.php?section=sendtofriend&productid=$productid");
      exit;

  } else {

      $userinfo = $HTTP_POST_VARS;
      $userinfo["login"] = $userinfo["uname"];

  }
}


$smarty->assign("userinfo",$userinfo);
$smarty->assign("fillerror",$fillerror);
$smarty->assign("main","sendtofriend");
$smarty->assign("help_section",$section);
$smarty->assign("location",$location);
$smarty->assign("product",$product_info);

func_display("customer/home.tpl",$smarty);
#$smarty->display("customer/home.tpl");

?>


bardolino 03-15-2006 08:30 AM

Hi Lionel,

thanks for your reply.

I changed

require "./auth.php";
to
require "../auth.php";

But now I got this error:

Warning: main(send_to_friend.php): failed to open stream: No such file or directory in /usr/home/bardolino/domains/bardolino.nl/public_html/xcart/customer/sendtofriend.php on line 17

Warning: main(): Failed opening 'send_to_friend.php' for inclusion (include_path='/usr/home/bardolino/domains/bardolino.nl/public_html/xcart/include/templater: in /usr/home/bardolino/domains/bardolino.nl/public_html/xcart/customer/sendtofriend.php on line 17

Any ideas?

bardolino 03-15-2006 08:35 AM

Hi Boomer,

I also tried your modification, but got this error:

Warning: main(./auth.php): failed to open stream: No such file or directory in /usr/home/bardolino/domains/bardolino.nl/public_html/xcart/customer/sendtofriend.php on line 6

Fatal error: main(): Failed opening required './auth.php' (include_path='.:/usr/local/lib/php') in /usr/home/bardolino/domains/bardolino.nl/public_html/xcart/customer/sendtofriend.php on line 6

After changing:
require "./auth.php";
to
require "../auth.php";

I got the same error as I described in my post to lionel..

There should be .. in stead of just one . right?

bardolino 03-15-2006 08:40 AM

Never mind! I uploaded the Boomer sendtofriend.php file again, refreshed and the error was gone.

Thanks!!! :D

bardolino 03-15-2006 08:49 AM

Btw lionel, I am using your send_to_friend.tpl page, looks great with the image en text, thanks!

bardolino 03-20-2006 12:03 AM

I got no errors anymore and assumed it was working... i was wrong. When i triend to mail a product and clicked on send, I got this error:

Not Found
The requested URL /xcart/customer/product.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

What should i change?

B00MER 03-20-2006 10:01 AM

Quote:

Originally Posted by bardolino
Not Found
The requested URL /xcart/customer/product.php was not found on this server.


You'll need to update the paths in the mod to just product.php and NOT customer/product.php as this was a pre 4.0.x file structure.

bardolino 03-20-2006 12:10 PM

Hi Boomer,

Yes, thats what I thought, but I searched every file, but I can't find a line that contains[customer/product/php] anywhere...

Can you give me a hint to where /what i should search?

bardolino 03-20-2006 12:12 PM

(I mean: customer/product.php)

Lionel 03-20-2006 01:16 PM

Boomer's updated code did not work for me on 4.18. I had to reuse the one I posted.


All times are GMT -8. The time now is 03:00 AM.

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