OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Parse Error Help
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > General Support
Tilapia Film
I am installing the USPS labels contribution.


In the instructions of this glorious contribution, its says:


Line 416 after:

default:

if (isset($oInfo) && is_object($oInfo)) {

$heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']&nbsp;&nbsp;' . tep_datetime_short($oInfo->date_purchased) . '</b>');



$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

$contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));

$contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method);



Insert (before the "}"):

$rqShipping = tep_db_query("SELECT title FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = " . $oInfo->orders_id . " AND class = 'ot_shipping'");

$shipping = tep_db_fetch_array($rqShipping);

$ship_method = substr(preg_replace(array('/^United States Postal Service/', '/^US Postal Service/'),'USPS',$shipping['title']),0,-1);

$contents[] = array('text' => '<br>' . TEXT_INFO_SHIPPING_METHOD . ' ' . (preg_match('/Priority/',$ship_method)? $ship_method : '<b>' . $ship_method . '</b>'));

if (preg_match('/^USPS/',$ship_method)) {




}




SO I DID..... I put all the code to insert before the }....... and then suddenly, I get a problem with line 409, which is this:

if (isset($oInfo) && is_object($oInfo)) {
Tilapia Film
Sorry my message got cut off...


Anyways.... it now says I have a parsing error on that line.... even though it hasn't been changed. All I did was add code below where I was instructed.

Then I tried deleting the line and everything works fine.

So my question is, do I need that line?

Why am I getting that parsing error?


Thanks so much!

Jeff
Avec
Mine has the code as contribution indicates and works fine. Check the code directly above. Mine is
CODE
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
default:


By the way, this contribution works great.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.