Email Customer issue...

General support forum.

Email Customer issue...

Postby Frosty » 27 Jul 2010, 13:49

Hi,

I have got the cart up and working and I have been able to integrate my payment gateway's iFrame setup just fine.
Once I receive a response from my processor (ether transaction approved or transaction decline) I need to send an email if approved to the customer about their purchase. I have the email all set and is sending but I can not figure out how to print the item and the quantity in the email.

Exp of mail output:

Amount (in USD):
Item(s):
First Name:
Last Name:
Company Name:
Address:
Address2:
Country:
Post Code/Zip:
City:
Email:

I figure that what I need to do is take this bit of code

Code: Select all
foreach ($cart->get_contents() as $item)
         {
         $message .= 'Item: ' . $item['name'];
         $message .= "\nPrice: " . $item['price'];
         $message .= "\nQuantity: " . $item['qty'];
         $message .= "\n\n";
         }


and turn $item['name'] into $_SESSION['item'] etc....but I can not figure out how or where I can do this so that it carries from the jCart pages to the iFrame page then to my email function....any ideas or guidance would be great!

Oh and I have read and tried the "HOW TO: Modify jCart to send an email to the merchant" here in the FAQ and yes it would be perfect if I was using paypal or if I was sending the email before I get the response from my processor.

Thanks
Frosy
Frosty
 
Posts: 6
Joined: 27 May 2010, 18:40

Re: Email Customer issue...

Postby Frosty » 28 Jul 2010, 18:54

ok can someone tell me if my thinking is correct on this line...

Can I do this and get the item name into the session...

foreach ($cart->get_contents() as $item)
{
$_SESSION['item] = $item['name'];
}

Anyone?
Frosty
 
Posts: 6
Joined: 27 May 2010, 18:40

Re: Email Customer issue...

Postby Frosty » 29 Jul 2010, 19:44

Ok, so it looks like after a lot of trial and error I have this sorted out.

on the check out page I am pulling the item information like this...

Code: Select all
$_SESSION['IntroBpm']       = $_SESSION['jcart']->itemname[1];
$_SESSION['ProcBpmn']       = $_SESSION['jcart']->itemname[2];
$_SESSION['ProcIdefo']       = $_SESSION['jcart']->itemname[3];
$_SESSION['CertBpr']       = $_SESSION['jcart']->itemname[4];


Since I only have 4 item for my cart the index converts nicely to the $_SESSION state.

on my approval and receipt page I am simply printing the $_SESSION var to the screen...

Code: Select all
if ($_SESSION['IntroBpm'] != "") {
   echo "<font color=\"#999999\">Item: </font>";
   print $_SESSION['IntroBpm'];
   echo "<br />";
   }
      if ($_SESSION['ProcBpmn'] != "") {
      echo "<font color=\"#999999\"> Item: </font>";
      print $_SESSION['ProcBpmn'];
      echo "<br />";
      }
         if ($_SESSION['ProcIdefo'] != "") {
         echo "<font color=\"#999999\"> Item: </font>";
         print $_SESSION['ProcIdefo'];
         echo "<br />";
         }
            if ($_SESSION['CertBpr'] != "") {
            echo "<font color=\"#999999\"> Item: </font>";
            print $_SESSION['CertBpr'];
            echo "<br />";
            }


This looks like the solution to my problem...Hope that it might help anyone else out there that has some not so standard needs for this information...

Oh, and given that I can strip the vars in this manner I should be able to also do the quantity that they selected also by changing the "itemname" to "itemqty" etc...

Cheers
Frosty
 
Posts: 6
Joined: 27 May 2010, 18:40


Return to jCart Help

Who is online

Users browsing this forum: No registered users and 1 guest