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)

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:09 PM.

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