Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error


Guest

Recommended Posts

Hello all,

 

We have modified the checkout_confirmation.php. Customer is receieving an error; saying that

 

Line: 267

Error: Object expected

 

The number of the 'Line' changes as the quantity of the order changes.

 

Here is the code.

 

I am looking for any comments that you have.

Thank you in advance.

Kerim

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>
<table border="0" cellspacing="1" cellpadding="0" align="center"><tr><td>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<table border="0" width="765 cellspacing="3" cellpadding="3">
   <tr>
     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
 <!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_confirmation.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
<?php
 if ($sendto != false) {
?>


<?php
   if ($order->info['shipping_method']) {
?>

<?php
   }
?>

<?php
 }
?>
           <td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (sizeof($order->info['tax_groups']) > 1) {
?>
                 <tr>
                   <td class="main" colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
                   <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
                   <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
                 </tr>
<?php
 } else {
?>
                 <tr>
                   <td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
                 </tr>
<?php
 }

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
   echo '          <tr>' . "\n" .
        '            <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
        '            <td class="main" valign="top">' . $order->products[$i]['name'];

   if (STOCK_CHECK == 'true') {
     echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);
   }

   if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
     }
   }

   echo '</td>' . "\n";

   if (sizeof($order->info['tax_groups']) > 1) echo '            <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";

   echo '            <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .
        '          </tr>' . "\n";




   if (!tep_session_is_registered('sendto')) {
   tep_session_register('sendto');}
   $sendto = $customer_id;
}
   $check_address_query = tep_db_query("select * from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
   $check_address = tep_db_fetch_array($check_address_query);
   $state = $check_address['entry_state'];


?>
               </table></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"> </td>
             </tr>
             <tr>
               <td class="main"> </td>
             </tr>
             <tr>
               <td class="main"><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b>'; ?></td>
             </tr>
             <tr>
               <td class="main">Credit Card
              <?php // Mods here       echo strtoupper($order->info['payment_method']); ?></td>
             </tr>
           </table></td>
           <td width="70%" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="2">
<?php
 if (MODULE_ORDER_TOTAL_INSTALLED) {
   $order_total_modules->process();
   $subtotal = $order_total_modules->output();

   $query = "SELECT zone_id  FROM " . TABLE_ZONES . " WHERE zone_code  = '" . $state . "'";
               $action = mysql_query($query);
               $result = mysql_fetch_array($action);
               $tax_zone = trim($result['zone_id']);

               $query = "SELECT tax_rate  FROM tax_rates WHERE zone_id  = '" . (int)$tax_zone . "'";
               $action = mysql_query($query);
               $result = mysql_fetch_array($action);
               $tax = trim($result['tax_rate']);


                        $tax=((int)($subtotal* $tax))/100;
                        $total = $subtotal + $tax;


 }
?>
           <tr>
              <td align="right" class="main"><?php echo SUBTOTAL; ?></td>
              <td align="right" class="main">$ <? echo $subtotal; ?>.00</td>
           </tr>
           <tr>
              <td align="right" class="main"><?php echo TAX; ?></td>
              <td align="right" class="main">$ <? echo $tax; ?></td>
           </tr>
           <tr>
              <td align="right" class="main"><b><?php echo TOTAL; ?></b></td>
              <td align="right" class="main">$ <? echo $total; ?></td>
           </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 //if (is_array($payment_modules->modules)) {
   //if ($confirmation = $payment_modules->confirmation()) {
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><b><?php echo HEADING_PAYMENT_INFORMATION; ?></b></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table width="100%" border="0" cellspacing="0" cellpadding="1">

             <tr>
               <td class="main" colspan="5"><?php echo $confirmation['title']; ?></td>
             </tr>
<?php
if ((!isset($HTTP_POST_VARS['cc_number3'])) || ( $HTTP_POST_VARS['cc_number3']=='')) {
   ?>
             <tr><?php echo tep_draw_form('checkout_confirmation', tep_href_link('checkout_confirmation.php', '', 'SSL'), 'post', 'onSubmit="return check_form(checkout_confirmation);"') . tep_draw_hidden_field('customer_id', $customer_id); ?>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo CREDIT_CARD_NUMBER_CONFIRMATION; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo tep_draw_input_field('cc_number3', '', 'maxlength="4"', true); ?></td>
               <td width="10"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></form></td>

             </tr>
<?php
}
$cc_query = "SELECT * FROM customers_info WHERE customers_info_id = '" . (int)$customer_id . "'";
$process = mysql_query($cc_query)or die (mysql_error());
$result=mysql_fetch_array($process);

         $cc_owner=$result['cc_owner'];
         $cc_number=$result['cc_number'];
         $cc_number4 = substr( $cc_number, 0, 12);
         if ($verified != "verified") {
         $cc_number2 = $cc_number4.$cc_number3;
         $cc_number1 = substr($cc_number4, 0, 4) . str_repeat('X', (strlen($cc_number4) - 4)) . $cc_number3;
} else {
         $cc_number2 = $cc_number4.$cc_number3;
         $cc_number1 = substr($cc_number4, 0, 4) . str_repeat('X', (strlen($cc_number4) - 4)).$cc_number3;
}
         $cc_type=$result['cc_type'];
         $cc_bank=$result['cc_bank'];
         $cc_expires = $result['cc_expires'];


?>
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo CREDIT_CARD_NUMBER; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo ($cc_number1); ?></td>
             </tr>
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo EXPIRATION_DATE; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td colspan ="2" class="main"><?php echo $cc_expires; ?></td>
             </tr>
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo CREDIT_CARD_OWNER; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td colspan ="2" class="main"><?php echo $cc_owner; ?></td>
              </tr>
              <tr>
                <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td><br>

               <td colspan ="2" class="main"><?php echo '<a href="' . tep_href_link('credit_card.php', '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT2 . ')</span></a>'; ?></td>
                             </tr>


           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
   //}
 //}
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if (tep_not_null($order->info['comments'])) {
?>
     <tr>
       <td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td align="right" class="main">

<?php
 if (isset($$payment->form_action_url)) {
   $form_action_url = $$payment->form_action_url;
 } else {
   $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
 }

 echo tep_draw_form('checkout_confirmation2', tep_href_link('autorise.php', '', 'SSL'), 'post', ''). tep_draw_hidden_field ('total', $total) .tep_draw_hidden_field ('cc_expires', $cc_expires) . tep_draw_hidden_field('cc_number', $cc_number2). tep_draw_hidden_field('order_id', $order_id). tep_draw_hidden_field('customer_id', $customer_id);

 //require_once('autorise.php');
 //$autorise = process_button2($cc_number, $cc_expires, $total, $customer_id) ;
if ((isset($HTTP_POST_VARS['cc_number3'])) && ( $HTTP_POST_VARS['cc_number3']!='')) {
 echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
} else { echo TEXT_TO_SAY_ABOUT_DIGITS;}
?>
           </td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
               <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
             </tr>
           </table></td>
           <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
           <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
               <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
               <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
             </tr>
           </table></td>
           <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
               <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
           <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>
           <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
           <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table></table></table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...