List contents of cart in Email and CSV for Paypal

Problems installing or using the NOP Design Free Shopping Cart that do not fit into one of the above categories.

Moderators: Koibito, Stefko, Randy

List contents of cart in Email and CSV for Paypal

Postby grimmbear » Sat Mar 27, 2010 3:22 pm

Variables in checkout.php have to be set to what's listed in nopcart.js. If Payment Processor Options = PP, use the following when globals are OFF.

$item_number_1 = $_POST['item_number_1'];
$quantity_1 = $_POST['quantity_1'];
$amount_1 = $_POST['amount_1'];
$item_name_1 = $_POST['item_name_1'];
$on0_1 = $_POST['on0_1'];


Paypal process doesn't use:
$QUANTITY_1 = $_POST['QUANTITY_1'];
$PRICE_1 = $_POST['PRICE_1'];
$ADDTLINFO_ = $_POST['ADDTLINFO_'];
$NAME_1 = $_POST['NAME_1'];
_____________________________________________________________________________________
if ( PaymentProcessor == 'pp' ) {
//Process hidden values for PayPal.
strOutput += "<input type=hidden name=\"item_number_" + strFooter + "\" value=\"" + fields[0] + "\">";
strOutput += "<input type=hidden name=\"quantity_" + strFooter + "\" value=\"" + fields[1] + "\">";
strOutput += "<input type=hidden name=\"amount_" + strFooter + "\" value=\"" + fields[2] + "\">";
strOutput += "<input type=hidden name=\"item_name_" + strFooter + "\" value=\"" + fields[3] + "\">";
strOutput += "<input type=hidden name=\"shipping_" + strFooter + "\" value=\"" + fields[4] + "\">";
strOutput += "<input type=hidden name=\"on0_" + strFooter + "\" value=\"" + fields[5] + "\">";
if (i == iNumberOrdered) {
strOutput += "<input type=hidden name=\"shipping_" + strFooter + "\" value=\"" + fShipping + "\">";
}

These would be your user defined variables in checkout.php

#
$header = "header.html";
$footer = "footer.html";
$returnpage = "index.html";
$youremail = "yourEmail@whatever.com";
$csvfileitem_name = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";

$b_first1 = $_POST['b_first1'];
$b_first2 = $_POST['b_first2'];
$b_last1 = $_POST['b_last1'];
$b_last2 = $_POST['b_last2'];
$b_addr = $_POST['b_addr'];
$b_city = $_POST['b_city'];
$b_state = $_POST['b_state'];
$b_zip = $_POST['b_zip'];
$b_email = $_POST['b_email'];
$b_phone = $_POST['b_phone'];
$b_postal = $_POST['b_postal'];

$s_first = $_POST['s_first'];
$s_last = $_POST['s_last'];
$s_addr = $_POST['s_addr'];
$s_city = $_POST['s_city'];
$s_state = $_POST['s_state'];
$s_zip = $_POST['s_zip'];
$s_phone = $_POST['s_phone'];
$s_date = $_POST['s_date'];
$comment = $_POST['comment'];

$item_number_1 = $_POST['item_number_1'];
$quantity_1 = $_POST['quantity_1'];
$amount_1 = $_POST['amount_1'];
$item_name_1 = $_POST['item_name_1'];
$on0_1 = $_POST['on0_1'];

$item_number_2 = $_POST['item_number_2'];
$quantity_2 = $_POST['quantity_2'];
$amount_2 = $_POST['amount_2'];
$item_name_2 = $_POST['item_name_2'];
$on0_2 = $_POST['on0_2'];

$item_number_3 = $_POST['item_number_3'];
$quantity_3 = $_POST['quantity_3'];
$amount_3 = $_POST['amount_3'];
$item_name_3 = $_POST['item_name_3'];
$on0_3= $_POST['on0_3'];

$item_number_4 = $_POST['item_number_4'];
$quantity_4 = $_POST['quantity_4'];
$amount_4 = $_POST['amount_4'];
$item_name_4 = $_POST['item_name_4'];
$on0_4 = $_POST['on0_4'];

$item_number_5 = $_POST['item_number_5'];
$quantity_5 = $_POST['quantity_5'];
$amount_5 = $_POST['amount_5'];
$item_name_5 = $_POST['item_name_5'];
$on0_5 = $_POST['on0_5'];

$item_number_6 = $_POST['item_number_6'];
$quantity_6 = $_POST['quantity_6'];
$amount_6 = $_POST['amount_6'];
$item_name_6 = $_POST['item_name_6'];
$on0_6 = $_POST['on0_6'];

$item_number_7 = $_POST['item_number_7'];
$quantity_7 = $_POST['quantity_7'];
$amount_7 = $_POST['amount_7'];
$item_name_7 = $_POST['item_name_7'];
$on0_7 = $_POST['on0_7'];

$item_number_8 = $_POST['item_number_8'];
$quantity_8 = $_POST['quantity_8'];
$amount_8 = $_POST['amount_8'];
$item_name_8 = $_POST['item_name_8'];
$on0_8 = $_POST['on0_8'];

$item_number_9 = $_POST['item_number_9'];
$quantity_9 = $_POST['quantity_9'];
$amount_9 = $_POST['amount_9'];
$item_name_9 = $_POST['item_name_9'];
$on0_9 = $_POST['on0_9'];

$item_number_10 = $_POST['item_number_10'];
$quantity_10 = $_POST['quantity_10'];
$amount_10 = $_POST['amount_10'];
$item_name_10 = $_POST['item_name_10'];
$on0_10 = $_POST['on0_10'];

$item_number_11 = $_POST['item_number_11'];
$quantity_11 = $_POST['quantity_11'];
$amount_11 = $_POST['amount_11'];
$item_name_11 = $_POST['item_name_11'];
$on0_11 = $_POST['on0_11'];

$item_number_12 = $_POST['item_number_12'];
$quantity_12 = $_POST['quantity_12'];
$amount_12 = $_POST['amount_12'];
$item_name_12 = $_POST['item_name_12'];
$on0_12 = $_POST['on0_12'];

$item_number_13 = $_POST['item_number_13'];
$quantity_13 = $_POST['quantity_13'];
$amount_13 = $_POST['amount_13'];
$item_name_13 = $_POST['item_name_13'];
$on0_13 = $_POST['on0_13'];

$TAX = $_POST['TAX'];
$SHIPPING = $_POST['SHIPPING'];
$SUBTOTAL = $_POST['SUBTOTAL'];
$TOTAL = $_POST['TOTAL'];

and under "MAIN"
it would change to this:

if (($b_first == "") || ($b_last == "") || ($b_addr == "") || ($b_city == "") || ($b_state == "") || ($b_zip == "") || ($b_phone == "") || ($b_email == "")) {
doFormError(" I'm sorry, but it appears that you forgot to fill in a required field. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}

//# checks for valitem email address
if( !(ereg("^(.+)@(.+)\\.(.+)$",$b_email)) ) {
doFormError("You submitted an invalid email address. Please go <A HREF='Javascript:history.go(-1);'>back</A> and correct the error.");
exit;
}
$today = date ("l, F jS Y");
$strMessageBody = "";
$strMessageBody .= "A new order has been received, A summary of this order appears below.\n";
$strMessageBody .= "\n";
$strMessageBody .= "Order Date: $today \n";
$strMessageBody .= " \n";
$strMessageBody .= "Bill To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $b_first $b_last \n";
$strMessageBody .= " $b_addr \n";
$strMessageBody .= " $b_addr2 \n";
$strMessageBody .= " $b_city, $b_state $b_zip \n";
$strMessageBody .= " $b_phone \n";
$strMessageBody .= " $b_fax \n";
$strMessageBody .= " $b_email \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Ship To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= " $s_first $s_last \n";
$strMessageBody .= " $s_addr \n";
$strMessageBody .= " $s_addr2 \n";
$strMessageBody .= " $s_city, $s_state $s_zip \n";
$strMessageBody .= " $s_phone \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Qty amount(\$) Product item - Type description; Color \n";
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "Qty:$quantity_1 \$$amount_1 $item_number_1 - $item_name_1 $on0_1 \n";
if( $item_name_2 ) {$strMessageBody .= "Qty:$quantity_2 \$$amount_2 $item_number_2 - $item_name_2 $on0_2 \n\n";}
if( $item_name_3 ) {$strMessageBody .= "Qty:$quantity_3 \$$amount_3 $item_number_3 - $item_name_3 $on0_3 \n\n";}
if( $item_name_4 ) {$strMessageBody .= "Qty:$quantity_4 \$$amount_4 $item_number_4 - $item_name_4 $on0_4 \n\n";}
if( $item_name_5 ) {$strMessageBody .= "Qty:$quantity_5 \$$amount_5 $item_number_5 - $item_name_5 $on0_5 \n\n";}
if( $item_name_6 ) {$strMessageBody .= "Qty:$quantity_6 \$$amount_6 $item_number_6 - $item_name_6 $on0_6 \n\n";}
if( $item_name_7 ) {$strMessageBody .= "Qty:$quantity_7 \$$amount_7 $item_number_7 - $item_name_7 $on0_7 \n\n";}
if( $item_name_8 ) {$strMessageBody .= "Qty:$quantity_8 \$$amount_8 $item_number_8 - $item_name_8 $on0_8 \n\n";}
if( $item_name_9 ) {$strMessageBody .= "Qty:$quantity_9 \$$amount_9 $item_number_9 - $item_name_9 $on0_9 \n\n";}
if( $item_name_10 ){$strMessageBody .= "Qty:$quantity_10 \$$amount_10 $item_number_10 - $item_name_10 $on0_10 \n\n";}
if( $item_name_11 ){$strMessageBody .= "Qty:$quantity_11 \$$amount_11 $item_number_11 - $item_name_11 $on0_11 \n\n";}
if( $item_name_12 ){$strMessageBody .= "Qty:$quantity_12 \$$amount_12 $item_number_12 - $item_name_12 $on0_12 \n\n";}
if( $item_name_13 ){$strMessageBody .= "Qty:$quantity_13 \$$amount_13 $item_number_13 - $item_name_13 $on0_13 \n\n";}
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "SUBTOTAL: $SUBTOTAL \n";
$strMessageBody .= "SHIPPING: $SHIPPING \n";
$strMessageBody .= "\n";
$strMessageBody .= "TOTAL: $TOTAL \n";
$strMessageBody .= "\n\n";
$strMessageBody .= "Comments: \n";
$strMessageBody .= "--------- \n";
$strMessageBody .= "$comment \n";
$strMessageBody .= " \n";
grimmbear
WebMaster
 
Posts: 1
Joined: Sat Mar 27, 2010 3:04 pm

Return to Help: Cart / General

Who is online

Users browsing this forum: No registered users and 1 guest