Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Send to Friend on product pages.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 11-24-2003, 09:40 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Just wanted to say, rrf, I would be all for a "Send to Friend" module appearing in future versions of X-Cart.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #42  
Old 11-24-2003, 10:59 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

well this is a great mod.

would be nice to have

{$product.product|escape}
{$product.descr|truncate:255:"...":true}

Included in the email.
I tried this but couldnt wrap my head around it...
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #43  
Old 11-25-2003, 12:06 AM
 
MER MER is offline
 

Newbie
  
Join Date: Jun 2003
Posts: 8
 

Default

Boomer, I did what you suggested but then I have this error.

Can't write template cache in the directory: /templates_c.
Please check if it exists, and have writable permissions.

I check my /templates_c folder rights and it has 777. Do you have any hints?

Tks,

Ming
Reply With Quote
  #44  
Old 11-25-2003, 12:14 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Updated sendtofriend.php file for 3.5.0 (this should do the trick ):

Code:
<?php # # sendtofriend mod by www.cart-lab.com # require $xcart_dir."/smarty.php"; require $xcart_dir."/config.php"; require "./auth.php"; require $xcart_dir."/include/categories.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); if ($REQUEST_METHOD=="POST") { # phpinfo(); exit(); # # Send mail to support # $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); #print $contact["sendtoemail"]; exit(); 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); $smarty->display("customer/home.tpl"); ?>
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #45  
Old 11-25-2003, 12:58 AM
 
MER MER is offline
 

Newbie
  
Join Date: Jun 2003
Posts: 8
 

Default

Hi Boomer,

Thank for you such speedy respone. After trying out the new sendtofriend.php, I was able to send out an email but the email subject line & message body look like below. It doesn't populate the data. Any solution to that. Thanks in advance! -Ming


{$contact.firstname} {$contact.lastname} has recommended a product to you.
{if $contact.body ne ""}

{$contact.body}

{/if}
Checkout the product link below for more details:
http://www.EntrustResources.com/store/customer/product.php?productid={$contact.productid}

{include file="mail/signature.tpl"}
Reply With Quote
  #46  
Old 11-25-2003, 01:06 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Updated in the post above previous.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #47  
Old 12-01-2003, 05:45 AM
 
various various is offline
 

Newbie
  
Join Date: Nov 2003
Posts: 6
 

Default

Thanks for a great mod, just got a "little" error over here:

Warning: main(/smarty.php) [function.main]: failed to create stream: No such file or directory in /web/sites/mydir/mysite.com/shop/customer/sendtofriend.php on line 6

Fatal error: main() [function.main]: Failed opening required '/smarty.php' (include_path='.:/usr/local/lib/php') in /web/sites/mydir/mysite.com/shop/customer/sendtofriend.php on line 6


Anyone that got any ideas what could have caused this...??
Reply With Quote
  #48  
Old 12-01-2003, 08:41 PM
 
jacobkball jacobkball is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Brisbane, Australia
Posts: 45
 

Default

Various,

To get around it, I had to put require $xcart_dir."../smarty.php"; instead of require $xcart_dir."/smarty.php";

Having said that, I am now stuck on "Can't write template cache in the directory: /templates_c. Please check if it exists, and have writable permissions" error message, which I can't for the life of me get rid of.

I don't know if you'll have the same problem.....

Regards

Jacob
__________________
Version 3.5.1 (Unix)
Reply With Quote
  #49  
Old 12-01-2003, 08:42 PM
 
jacobkball jacobkball is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Brisbane, Australia
Posts: 45
 

Default

Ok, I've GOT IT SORTED.

To get around it, you need to remove/comment out the lines require $xcart_dir."/smarty.php"; and require $xcart_dir."/config.php";

This has fixed the "Can't write template cache in the directory: /templates_c. Please check if it exists, and have writable permissions" error messages that I was getting.

Regards

Jacob
__________________
Version 3.5.1 (Unix)
Reply With Quote
  #50  
Old 12-02-2003, 10:06 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

To update for 3.5.0 if your getting a funny error of:
"Can't to find template engine!"

Edit the sendtofriend.php file and adjust the includes:

Code:
require "../smarty.php"; require "../config.php"; @include "./https.php"; require "./auth.php"; require "../include/categories.php";

replace with:

Code:
require $xcart_dir."/smarty.php"; require $xcart_dir."/config.php"; @include "./https.php"; require "./auth.php"; require $xcart_dir."/include/categories.php";
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:34 PM.

   

 
X-Cart forums © 2001-2020