jdw814 Posted June 29, 2009 Share Posted June 29, 2009 Hi all, I have the PayPal Payments Standard add-on working on my site -- except for one annoyance. The Order Confirmation that goes to the Customer does not include the Sub-Total, Shipping, Tax & Total. I am guessing I have a syntax error of some kind, but I cannot see it. Below is a piece of the code I'm using: (paypal_standard.php) $email_order = "Dear " . $order->customer['firstname'] . ",\n\n" . "Thank you for your recent " . STORE_NAME . " purchase! You will find a complete summary of your order below.\n\n" . "If you have any questions, please call us at: " . $use_phone . " or email us at: <a href='mailto:" . STORE_OWNER_EMAIL_ADDRESS . "'>" . STORE_OWNER_EMAIL_ADDRESS . "</a>.\n\n" . "Regards,\n" . STORE_NAME . "\n\n" . EMAIL_SEPARATOR . "\n" . "Order Summary\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n\n"; if (is_object($$payment)) { $payment_class = $$payment; $email_order .= EMAIL_TEXT_PAYMENT_METHOD . ": " . $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n\n"; } The part that doesn't seem to be working is: for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } --- But that same section of code works just fine in the non-PayPal Order Confirmation Email. It generates data like the following: Sub-Total: $1,834.00 United Parcel Service (1 x 3.3lbs) (3 Day Select): $9.34 MO TAX 7.35%: $134.80 Total: $1,978.14 --- Does anyone know what I can do to fix this? (Or where to point me to find the answer...?) Any help would be greatly appreciated! ~Julie Quote Link to comment Share on other sites More sharing options...
web-project Posted June 30, 2009 Share Posted June 30, 2009 simply compare to original code and correct this way. Quote Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here! 8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself. Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues. Any issues with oscommerce, I am here to help you. Link to comment Share on other sites More sharing options...
jdw814 Posted July 1, 2009 Author Share Posted July 1, 2009 Alex, I did actually try that first. That section of the code for the Order Confirmation email sent by the PayPal Payments Standard module in the original file from the Add On is not working either. (I restored my backup of that file just now, and placed an order -- just to make sure I wasn't remembering incorrectly...) The email looks like this: GoldKeyToken.com------------------------------------------------------ Order Number: 59 Detailed Invoice: http://[mysite]/goldkey/account_history_info.php?order_id=59 Date Ordered: Wednesday 01 July, 2009 Products ------------------------------------------------------ 1 x Evaluation Package - 1 Master, 3 User Tokens (GKPKE3) = $659.00 ------------------------------------------------------ Delivery Address ------------------------------------------------------ Julie Testing [Address] [City], [sT] [Postal] United States Billing Address ------------------------------------------------------ Julie Testing [Address] [City], [sT] [Postal] United States Payment Method ------------------------------------------------------ PayPal The missing information should display immediately after the list of products ordered and before the Delivery Address... --- The code in the original, unedited file for this add on reads as follows: (includes/modules/payments/paypal_standard.php, Line #515 - 517) for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } Has anyone run into -- and solved -- this problem? I would be grateful for some assistance. (I am fairly new to osCommerce, but I do have a bit more experience with PHP. Not enough to be considered adept at it, but I manage.) Any help would be appreciated. Thank you! Julie Quote Link to comment Share on other sites More sharing options...
le6ha2 Posted November 4, 2009 Share Posted November 4, 2009 I have the same trouble here. this loop command looks like does not work. for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } Did you find the solution? thank you Quote Link to comment Share on other sites More sharing options...
Larsbirger Posted January 23, 2011 Share Posted January 23, 2011 I had the same problem, finally solved it. Open the file /catalog/checkout_process.php. Around lines 48-55 you have this code: // load the before_process function from the payment modules $payment_modules->before_process(); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); Rearrange the order so the code looks like this: require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); // load the before_process function from the payment modules $payment_modules->before_process(); This solved it for me, hope it helps. Best regards Lasse I have the same trouble here. this loop command looks like does not work. for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } Did you find the solution? thank you Quote Link to comment Share on other sites More sharing options...
Leok Posted January 27, 2011 Share Posted January 27, 2011 I had the same problem, finally solved it. Open the file /catalog/checkout_process.php. Around lines 48-55 you have this code: // load the before_process function from the payment modules $payment_modules->before_process(); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); Rearrange the order so the code looks like this: require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_totals = $order_total_modules->process(); // load the before_process function from the payment modules $payment_modules->before_process(); This solved it for me, hope it helps. Best regards Lasse G'day Lasse, I had the exact same issue, and rearranging the code as you suggested seems to have fixed it! Thanks so much for posting this Cheers, Leo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.