JangoF Posted April 2, 2007 Share Posted April 2, 2007 Hello, I've been designing my own html mail templates for Order Confirmation mails, and I'm almost there. But I have this small annoying syntax error which keeps the page from loading, which I cannot seem to find. This is the error: Parse error: parse error, unexpected '.' in /home/content/s/c/p/scpinferis4321/html/testsite/checkout_process.php on line 420 <br> <br> ' . $email_order = EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n\n"; . '<br> <br> Comments entered:<br> ' . if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } . '<br> The line starting with EMAIL_TEXT_INVOICE_URL is line 420. Can anyone see what could be wrong? Link to comment Share on other sites More sharing options...
RyanN Posted April 2, 2007 Share Posted April 2, 2007 remove the semi-colon after \n\n Link to comment Share on other sites More sharing options...
JangoF Posted April 2, 2007 Author Share Posted April 2, 2007 Hmm, now I get: Parse error: parse error, unexpected T_IF in /home/content/s/c/p/scpinferis4321/html/testsite/checkout_process.php on line 423 I'm gonna paste the entire code. $email_order = '<table width="564" border="1" cellspacing="0" cellpadding="0"bordercolor="#d9e5ca"> <tr> <th scope="col"><table width="564" cellspacing="0" cellpadding="2" border="0"> <tr> <td colspan="6"><a href="http://www.mysite.com/"><img src="http://www.mysite.com/images/mail_header.jpg" border="0"/></a></td> </tr> <tr bgcolor="#d9e5ca"> <td colspan="6"><p><font size="+2" face="Verdana, Arial, Times" color="#000000"> Order Confirmation <br> </font></p></td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><p><br> Dear Member,<br> <br> Thank you for shopping with us!Your order has been processed and will ship soon.<br> Below is a confirmation of your order.<br> <br> ' . $email_order = EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n\n" . '<br> <br> Comments:<br> ' . if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } . '<br> <br> </p></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Quantity Product Price</b></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top">' . $email_order .= $products_ordered . . '</td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><div align="right">' . 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"; } . '</div></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"> <p> <br> ' . if ($order->content_type != 'virtual') { $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } . '<br> <br> ' . $email_order .= if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . $payment_class = $$payment; $email_order .= $payment_class->title . "\n"; . '<br> <br> ' . if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } . '<br> <br> <br> <br> Kind Regards<br> <p>My Shop<br> <br> </p> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> </table></th> </tr> </table> <table width="564" border="0" cellpadding="2" cellspacing="2" bordercolor="#d9e5ca"> <tr></tr> <td></td> </table>'; Link to comment Share on other sites More sharing options...
RyanN Posted April 2, 2007 Share Posted April 2, 2007 Which Line is 423? Link to comment Share on other sites More sharing options...
JangoF Posted April 2, 2007 Author Share Posted April 2, 2007 Sorry, forgot to say it. Line 423 is: ' . if ($order->info['comments']) { Link to comment Share on other sites More sharing options...
JangoF Posted April 3, 2007 Author Share Posted April 3, 2007 Anyone, please? Link to comment Share on other sites More sharing options...
pvarsha Posted April 3, 2007 Share Posted April 3, 2007 Sorry, forgot to say it. Line 423 is: ' . if ($order->info['comments']) { ohh. this statement should be like this : if ($order->info['comments']) { Please modify your if statement accordingly Thanks, pvarsha Link to comment Share on other sites More sharing options...
JangoF Posted April 3, 2007 Author Share Posted April 3, 2007 Shouldn't it have ' . in front and . ' after? Because it is wrapped in html tags. This is how it looks like now (but I still get the unexpected '.'): <br> ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n\n"; . '<br> <br> Comments entered:<br> ' . if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } . '<br> <br> The whole variable is one big html statement with php information in it. It starts with $email_order = ' ... lots of html +php .... and ends with '; as you can see in the code I pasted above. Link to comment Share on other sites More sharing options...
JangoF Posted April 3, 2007 Author Share Posted April 3, 2007 I tried fixing around a bit, and now I get: Parse error: parse error, unexpected T_FOR at line 447 And this is the code: <td valign="top">' . $email_order .= $products_ordered; . '</td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><div align="right">' . 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"; } . '</div></td> I don't understand why it keeps giving me syntax errors here? Link to comment Share on other sites More sharing options...
JangoF Posted April 3, 2007 Author Share Posted April 3, 2007 Well, I have been trying to work on this all day now, but I keep getting syntax errors. This is the latest error I get: Parse error: parse error, unexpected '.' on line 423 And here is the code as it is now: $email_order = '<table width="564" border="1" cellspacing="0" cellpadding="0"bordercolor="#d9e5ca"> <tr> <th scope="col"><table width="564" cellspacing="0" cellpadding="2" border="0"> <tr> <td colspan="6"><a href="http://www.mydomain.com/"><img src="http://www.mydomain.com/images/mail_header.jpg" border="0"/></a></td> </tr> <tr bgcolor="#d9e5ca"> <td colspan="6"><p><font size="+2" face="Verdana, Arial, Times" color="#000000"> Order Confirmation <br> </font></p></td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><p><br> Dear Member,<br> <br> Thank you for shopping at us! Your order has been processed and will ship soon.<br> <br> <br> <b>Order Number:</b>' . $insert_id . '<br> <b>Date Ordered:</b>' . strftime(DATE_FORMAT_LONG) . '<br> <b>Detailed Invoice:</b>' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n\n"; if ($order->info['comments']) { echo tep_db_output($order->info['comments']) . "\n"; } . '<br> <br> </p></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Quantity Product Price</b></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top">' . $products_ordered . '</td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><div align="right">' . for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } . '</div></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Delivery Address</b> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top">' . if ($order->content_type != 'virtual') { tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } . '</td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Payment Method</b> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"> <p> ' . if (is_object($$payment)) { $payment_class = $$payment; $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $payment_class->email_footer . "\n\n"; } } . '<br> <br> <br> <br> Kind Regards<br> <p>My Shop<br> <br> </p> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> </table></th> </tr> </table> <table width="564" border="0" cellpadding="2" cellspacing="2" bordercolor="#d9e5ca"> <tr> </tr> </table>'; Line 423 is the line below echo tep_db_output($order->info['comments']) . "\n"; Link to comment Share on other sites More sharing options...
pvarsha Posted April 4, 2007 Share Posted April 4, 2007 Well, I have been trying to work on this all day now, but I keep getting syntax errors. This is the latest error I get:And here is the code as it is now: $email_order = '<table width="564" border="1" cellspacing="0" cellpadding="0"bordercolor="#d9e5ca"> <tr> <th scope="col"><table width="564" cellspacing="0" cellpadding="2" border="0"> <tr> <td colspan="6"><a href="http://www.mydomain.com/"><img src="http://www.mydomain.com/images/mail_header.jpg" border="0"/></a></td> </tr> <tr bgcolor="#d9e5ca"> <td colspan="6"><p><font size="+2" face="Verdana, Arial, Times" color="#000000"> Order Confirmation <br> </font></p></td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><p><br> Dear Member,<br> <br> Thank you for shopping at us! Your order has been processed and will ship soon.<br> <br> <br> <b>Order Number:</b>' . $insert_id . '<br> <b>Date Ordered:</b>' . strftime(DATE_FORMAT_LONG) . '<br> <b>Detailed Invoice:</b>' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n\n"; if ($order->info['comments']) { echo tep_db_output($order->info['comments']) . "\n"; } . '<br> <br> </p></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Quantity Product Price</b></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top">' . $products_ordered . '</td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><div align="right">' . for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } . '</div></td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Delivery Address</b> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top">' . if ($order->content_type != 'virtual') { tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; } . '</td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"><b>Payment Method</b> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> <tr> <td> </td> <td valign="top"> </td> <td valign="top"> <p> ' . if (is_object($$payment)) { $payment_class = $$payment; $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $payment_class->email_footer . "\n\n"; } } . '<br> <br> <br> <br> Kind Regards<br> <p>My Shop<br> <br> </p> </td> <td> </td> <td valign="top" align="right" colspan="2"> </td> </tr> </table></th> </tr> </table> <table width="564" border="0" cellpadding="2" cellspacing="2" bordercolor="#d9e5ca"> <tr> </tr> </table>'; Line 423 is the line below echo tep_db_output($order->info['comments']) . "\n"; see this line on 423 line no <code> if ($order->info['comments']) { echo tep_db_output($order->info['comments']) . "\n"; } . '<br> </code> above of if statement the string is being ended with semicolon. please concatenate with "."(dot) operator after "\n\n" instead of semicolon give the dot operator. Thanks, pvarsha Link to comment Share on other sites More sharing options...
JangoF Posted April 4, 2007 Author Share Posted April 4, 2007 I put it like this: <b>Detailed Invoice:</b>' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n\n" . if ($order->info['comments']) { echo tep_db_output($order->info['comments']) . "\n" . } . '<br> That can't be right, because now I get unexpected T_IF on line 421 (if ($order->info['comments']) {). Link to comment Share on other sites More sharing options...
JangoF Posted April 4, 2007 Author Share Posted April 4, 2007 Can any phpwiz help with this? Link to comment Share on other sites More sharing options...
JangoF Posted April 4, 2007 Author Share Posted April 4, 2007 Anyone? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.