| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Email cart contents? | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
![]() Got a little bit further, managed to get the email sending the product code and price through to me now
![]() Would you know how to get the customers email address and their shipping address on the email that comes throught to me? and also if I could get the email to come FROM the customer so that I can reply directly to it? many thanks for your help, I am nearly there now. Regards Dan <?php require "./auth.php"; x_load('cart'); $emailSentTo = "info@here.com"; $subjectOfEmail = "Catac Shipping Quote"; //========= no need to edit bellow // Set HTML Mail Header $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // The Message $message = $GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]; //Cleaning Message for ($i = 0; $i < $cart["max_cartid"]; $i++){ $message = $cart["products"][$i]["productcode"]; $message3 = $cart["products"][$i]["product"]; $message2 = $cart["display_discounted_subtotal"]; } // Sending mail($emailSentTo, $subjectOfEmail, $message, $message2, $headers); //Thanking echo "<script language=\"javascript\" type=\"text/javascript\"> alert('Thank You, We will contact you shortly.'); window.location = \"http://$_SERVER[HTTP_HOST]\"; </script> "; ?>
__________________
X Cart Version 4.2 |
|||||||
#12
|
|||||||
|
|||||||
![]() nearly done this now and works quite well
![]() Just need 2 things: the product options (ie size or colour chosen) to show on my email (everything else such as item ordered, code etc. does) and 2 my Email is coming back FROM Apache in the header, need somehow to either make the users email appear in the FROM header or just to show FROM Your Site. Anyone got any ideas? Regards Dan THIS IS THE CODE THAT IS WORKING WELL. <?php require "./auth.php"; x_load('cart','user','order','tests'); require $xcart_dir."/include/cart_process.php"; include $xcart_dir."/shipping/shipping.php"; $smarty->assign("register_script_name",(($config["Security"]["use_https_login"] == "Y") ? $xcart_catalogs_secure["customer"]."/" : "")."cart.php"); # # Register member if not registerred yet # (not a newbie - do not show help messages) # if ($mode == "checkout" && !$func_is_cart_empty) { $usertype = "C"; $old_action = $action; $action = "cart"; $smarty->assign("action", $action); $newbie = "Y"; if (empty($login)) include $xcart_dir."/include/register.php"; if (!empty($auto_login)) { func_header_location("cart.php?mode=checkout®is tered="); } $saved_userinfo = isset($userinfo) ? $userinfo : array(); $action = $old_action; $smarty->assign("newbie", $newbie); } if (!empty($login)) $userinfo = func_userinfo($login, $current_area, false, false, "H"); x_session_save(); $emailSentTo = "info@uorsite.com"; $subjectOfEmail = "Catac Shipping Quote"; //========= no need to edit bellow // Set HTML Mail Header $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // The Message $message = $GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]; //Cleaning Message $message .= "Products Required"; $message .= "\n\n"; for ($i = 0; $i < $cart["max_cartid"]; $i++){ $message .= "Product Name: ";$message .= $cart["products"][$i]["product"]; $message .= "\n"; $message .= "Product Code: ";$message .= $cart["products"][$i]["productcode"]; $message .= "\n"; $message .= "Quantity: ";$message .= $cart["products"][$i]["amount"]; $message .= "\n\n"; } $message .= "Cost of products BEFORE SHIPPING: ";$message .= $cart["subtotal"]; $message2 .= "\n"; $message2 .= "Customer Details & Address Items to be Shipped to"; $message2 .= "\n\n"; $message2 .= "Name: ";$message2 .= $userinfo["b_firstname"]; $message2 .= $userinfo["b_lastname"]; $message2 .= "\n"; $message2 .= "Email: ";$message2 .= $userinfo["email"]; $message2 .= "\n\n"; $message2 .= "City: ";$message2 .= $userinfo["b_city"]; $message2 .= "\n"; $message2 .= "Country: ";$message2 .= $userinfo["b_countryname"]; $message2 .= "\n"; $message2 .= "Post code: ";$message2 .= $userinfo["b_zipcode"]; $message2 .= "\n\n"; // Sending mail($emailSentTo, $subjectOfEmail, $message, $message2, $headers); //Thanking echo "<script language=\"javascript\" type=\"text/javascript\"> alert('Thank you for enquiring about our products, we will contact you shortly with your shipping costs.'); window.close(); </script> "; ?>
__________________
X Cart Version 4.2 |
|||||||
#13
|
|||||||||
|
|||||||||
![]() you need to specify the from header for the email, see here for help,
http://uk3.php.net/manual/en/function.mail.php
__________________
X-Cart version 5 (Previously 3.5-4) Previous Versions included BCSE Reward Points Mod Altered Cart On Sale Mod Wordpress Plugin Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there. Shout me a Coffee! |
|||||||||
#14
|
|||||||
|
|||||||
![]() Thanks for the reply, but this is not working.
I think it's because I have 5 parts in the mail code below (ie an extra $message): mail($emailSentTo, $subjectOfEmail, $message, $message2, $headers); I can get it working when I take out $message2 and leave 4 parts in the header. I really need all 5, any ideas? Regards Dan
__________________
X Cart Version 4.2 |
|||||||
#15
|
|||||||||
|
|||||||||
![]() the mail function:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) so you have: $emailsentto as $to $subjectOfEmail as $subject $message as $message $message2 as $additionalheaders $headers as $additionalparameters so your $message2 is moving all of the parameters into the wronf places which is why it doesn't work with it in, but it does without it. You need to combine your $message and $message2 into a single variable to be passed to the mail function. Try changing to: Code:
you can only assign 1 variable to be the actual message.
__________________
X-Cart version 5 (Previously 3.5-4) Previous Versions included BCSE Reward Points Mod Altered Cart On Sale Mod Wordpress Plugin Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there. Shout me a Coffee! |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|