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
  #111  
Old 03-14-2006, 07:55 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

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"); ?>
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #112  
Old 03-15-2006, 08:30 AM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

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?
__________________
Version 4.0.14
Reply With Quote
  #113  
Old 03-15-2006, 08:35 AM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

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?
__________________
Version 4.0.14
Reply With Quote
  #114  
Old 03-15-2006, 08:40 AM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

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

Thanks!!!
__________________
Version 4.0.14
Reply With Quote
  #115  
Old 03-15-2006, 08:49 AM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

Btw lionel, I am using your send_to_friend.tpl page, looks great with the image en text, thanks!
__________________
Version 4.0.14
Reply With Quote
  #116  
Old 03-20-2006, 12:03 AM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

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?
__________________
Version 4.0.14
Reply With Quote
  #117  
Old 03-20-2006, 10:01 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

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

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #118  
Old 03-20-2006, 12:10 PM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

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?
__________________
Version 4.0.14
Reply With Quote
  #119  
Old 03-20-2006, 12:12 PM
 
bardolino bardolino is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

(I mean: customer/product.php)
__________________
Version 4.0.14
Reply With Quote
  #120  
Old 03-20-2006, 01:16 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

Boomer's updated code did not work for me on 4.18. I had to reuse the one I posted.
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
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 07:10 PM.

   

 
X-Cart forums © 2001-2020