jjanguda Posted June 17, 2004 Posted June 17, 2004 I don't know why, but mine is not working. I just followed what you said.. but shows me an error message public_html/checkout_payment.php on line 194 .. Can you help me on this? This is my catalog/checkout_payment.php <?php /* $Id: checkout_payment.php,v 1.113 2003/06/29 23:03:27 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { if ($cart->cartID != $cartID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } // Stock Check if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) { $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); break; } } } // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; // if no billing destination address was selected, use the customers own address as default if (!tep_session_is_registered('billto')) { tep_session_register('billto'); $billto = $customer_default_address_id; } else { // verify the selected billing address $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'"); $check_address = tep_db_fetch_array($check_address_query); if ($check_address['total'] != '1') { $billto = $customer_default_address_id; if (tep_session_is_registered('payment')) tep_session_unregister('payment'); } } require(DIR_WS_CLASSES . 'order.php'); $order = new order; if (!tep_session_is_registered('comments')) tep_session_register('comments'); $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); // load all enabled payment modules require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment; require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); ?> <!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"> <script language="javascript"><!-- var selected; function selectRowEffect(object, buttonSelect) { if (!selected) { if (document.getElementById) { selected = document.getElementById('defaultSelected'); } else { selected = document.all['defaultSelected']; } } if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object; // one button is not an array if (document.checkout_payment.payment[0]) { document.checkout_payment.payment[buttonSelect].checked=true; } else { document.checkout_payment.payment.checked=true; } } function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } //--></script> <?php echo $payment_modules->javascript_validation(); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="images/top_banner.gif" width="900" height="165"></td> </tr> <tr> <td> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" 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 width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><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_payment.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> <?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice"> <tr class="infoBoxNoticeContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></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 class="main" colspan="4"><?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 width="10%" class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td width="60%" 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 width="30%"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"; } ?> <tr><td COLSPAN="4" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="3"> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td> </tr> </table></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><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br><br><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td> <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" align="center" valign="top"><b><?php echo TITLE_BILLING_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </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><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td> </tr> </table></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"> <?php $selection = $payment_modules->selection(); if (sizeof($selection) > 1) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td> <td class="main" width="50%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } else { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } $radio_buttons = 0; for ($i=0, $n=sizeof($selection); $i<$n; $i++) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) { echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } else { echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td> <td class="main" align="right"> <?php if (sizeof($selection) > 1) { echo tep_draw_radio_field('payment', $selection[$i]['id']); } else { echo tep_draw_hidden_field('payment', $selection[$i]['id']); } ?> </td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php if (isset($selection[$i]['error'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="4"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php $radio_buttons++; } ?> </table></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="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> </table></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><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td> </tr> </table></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"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></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%"><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%"><?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 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="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> This is english/checkout_payment.php <?php /* $Id: checkout_payment.php,v 1.14 2003/02/06 17:38:16 thomasamoulton Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('NAVBAR_TITLE_1', 'Checkout'); define('NAVBAR_TITLE_2', 'Payment Method'); define('HEADING_TITLE', 'Payment Information'); define('HEADING_PRODUCTS', 'PRODUCTS ORDERED'); define('TEXT_EDIT', 'Edit'); define('TABLE_HEADING_BILLING_ADDRESS', 'Billing Address'); define('TEXT_SELECTED_BILLING_DESTINATION', 'Please choose from your address book where you would like the invoice to be sent to.'); define('TITLE_BILLING_ADDRESS', 'Billing Address:'); define('TABLE_HEADING_PAYMENT_METHOD', 'Payment Method'); define('TEXT_SELECT_PAYMENT_METHOD', 'Please select the preferred payment method to use on this order.'); define('TITLE_PLEASE_SELECT', 'Please Select'); define('TEXT_ENTER_PAYMENT_INFORMATION', 'This is currently the only payment method available to use on this order.'); define('TABLE_HEADING_COMMENTS', 'Add Comments About Your Order'); define('TITLE_CONTINUE_CHECKOUT_PROCEDURE', 'Continue Checkout Procedure'); define('TEXT_CONTINUE_CHECKOUT_PROCEDURE', 'to confirm this order.'); ?>
TerryK Posted June 17, 2004 Author Posted June 17, 2004 At a glance, I don't see anything out of place, but it would be a whole lot easier if you could just post your code from about line 190 to 200 or so. Had you made any other modifications to the page? Are you editing it in a PHP or text editor, or with the editor available through admin (which always seems to cause problems)? Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
jjanguda Posted June 17, 2004 Posted June 17, 2004 thanks for looking at the code OK.. I've never modified catalog/checkout_payment.php before I installed your codes on it. And the line between 161 and 245 would be here. <?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice"> <tr class="infoBoxNoticeContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></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 class="main" colspan="4"><?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 width="10%" class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td width="60%" 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 width="30%"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"; } ?> <tr><td COLSPAN="4" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="3"> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td> </tr> </table></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> This also includes your codes. I don't know why.... it doesn't function..
TerryK Posted June 17, 2004 Author Posted June 17, 2004 Okay, I tried the code I supplied and it broke, too. :( Here's a tested version of the code on a clean copy of the /catalog/checkout_payment.php file. See if this works for you. <?php /* $Id: checkout_payment.php,v 1.113 2003/06/29 23:03:27 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { if ($cart->cartID != $cartID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } // Stock Check if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) { $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); break; } } } // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; // if no billing destination address was selected, use the customers own address as default if (!tep_session_is_registered('billto')) { tep_session_register('billto'); $billto = $customer_default_address_id; } else { // verify the selected billing address $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'"); $check_address = tep_db_fetch_array($check_address_query); if ($check_address['total'] != '1') { $billto = $customer_default_address_id; if (tep_session_is_registered('payment')) tep_session_unregister('payment'); } } require(DIR_WS_CLASSES . 'order.php'); $order = new order; if (!tep_session_is_registered('comments')) tep_session_register('comments'); $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); // load all enabled payment modules require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment; require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); ?> <!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"> <script language="javascript"><!-- var selected; function selectRowEffect(object, buttonSelect) { if (!selected) { if (document.getElementById) { selected = document.getElementById('defaultSelected'); } else { selected = document.all['defaultSelected']; } } if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object; // one button is not an array if (document.checkout_payment.payment[0]) { document.checkout_payment.payment[buttonSelect].checked=true; } else { document.checkout_payment.payment.checked=true; } } function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } //--></script> <?php echo $payment_modules->javascript_validation(); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" 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 width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><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_payment.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> <?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice"> <tr class="infoBoxNoticeContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></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="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBox2"> <tr class="infoBoxContents2"> <td><table border="0" width="100%" cellspacing="0" cellpadding="3"> <?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> <tr> <td COLSPAN="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td> </tr> <?php } else { ?> <tr> <td class="main" colspan="4"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td COLSPAN="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr>' . "\n" . ' <td width="10%" class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td width="60%" class="main" valign="top">' . $order->products[$i]['name'] . '<br><small>Price, Each: USD $' . $order->products[$i]['price'] . '</small>' . '<br><small>Item #' . $order->products[$i]['item_number'] . '</small>'; if (STOCK_CHECK == 'true') { echo '<br>' . 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><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small>'; } } 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 width="30%"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"; } ?> <tr><td COLSPAN="4" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="3"> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> </table></td> </tr> </table></td> </tr> </table></td></tr></table> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '25'); ?></td> </tr> <tr> <td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td> </tr> </table></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><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br><br><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td> <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" align="center" valign="top"><b><?php echo TITLE_BILLING_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </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><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td> </tr> </table></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"> <?php $selection = $payment_modules->selection(); if (sizeof($selection) > 1) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td> <td class="main" width="50%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } else { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } $radio_buttons = 0; for ($i=0, $n=sizeof($selection); $i<$n; $i++) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) { echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } else { echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td> <td class="main" align="right"> <?php if (sizeof($selection) > 1) { echo tep_draw_radio_field('payment', $selection[$i]['id']); } else { echo tep_draw_hidden_field('payment', $selection[$i]['id']); } ?> </td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php if (isset($selection[$i]['error'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="4"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php $radio_buttons++; } ?> </table></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="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> </table></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><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td> </tr> </table></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"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></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%"><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%"><?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 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="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Let me know if it works... Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
TerryK Posted June 17, 2004 Author Posted June 17, 2004 One correction to the above code (sigh)... Change: <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBox2"> <tr class="infoBoxContents2"> to: <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBox"> <tr class="infoBoxContents"> Sorry 'bout that... :( Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
jjanguda Posted June 17, 2004 Posted June 17, 2004 TerryK, thanks for your help. It actually works, but.. I have tag problems.. I don't use a "Center your shop" contribution, but what I've done is that I used Dreamweaver. As you can see here, my shop has 900px width at center. (All my catalog files are set like this.) And I added your codes into the first <td> </td>. It works, but it looks awkward. Can you help me on this tad problem? Of course, I've added codes around the line 49. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <title>Untitled Document</title> </head> <body> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> ?<tr> ? ?<td> </td> ?</tr> ?<tr> ? ?<td> </td> ?</tr> </table> </body> </html> So, Can you try this code to see how it looks.. <?php /* $Id: checkout_payment.php,v 1.113 2003/06/29 23:03:27 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { ? $navigation->set_snapshot(); ? tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { ? tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { ? tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { ? if ($cart->cartID != $cartID) { ? ? tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); ? } } // Stock Check if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) { ? $products = $cart->get_products(); ? for ($i=0, $n=sizeof($products); $i<$n; $i++) { ? ? if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { ? ? ? tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); ? ? ? break; ? ? } ? } } // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; // if no billing destination address was selected, use the customers own address as default if (!tep_session_is_registered('billto')) { ? tep_session_register('billto'); ? $billto = $customer_default_address_id; } else { // verify the selected billing address ? $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'"); ? $check_address = tep_db_fetch_array($check_address_query); ? if ($check_address['total'] != '1') { ? ? $billto = $customer_default_address_id; ? ? if (tep_session_is_registered('payment')) tep_session_unregister('payment'); ? } } require(DIR_WS_CLASSES . 'order.php'); $order = new order; if (!tep_session_is_registered('comments')) tep_session_register('comments'); $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); // load all enabled payment modules require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment; require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); ?> <!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"> <script language="javascript"><!-- var selected; function selectRowEffect(object, buttonSelect) { if (!selected) { ? if (document.getElementById) { ? ? selected = document.getElementById('defaultSelected'); ? } else { ? ? selected = document.all['defaultSelected']; ? } } if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object; // one button is not an array if (document.checkout_payment.payment[0]) { ? document.checkout_payment.payment[buttonSelect].checked=true; } else { ? document.checkout_payment.payment.checked=true; } } function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } //--></script> <?php echo $payment_modules->javascript_validation(); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <!-- footer_eof //--> <p><br> </p> <table width="900" border="0" align="center" cellpadding="0" cellspacing="0"> ?<tr> ? ?<td> </td> ?</tr> ?<tr> ? ?<td><table width="100%" ?border="0" cellspacing="0" cellpadding="0"> ? ? ?<tr> ? ? ? ?<td><?php require(DIR_WS_INCLUDES . 'header.php'); ?> ? ? ? ? ?<!-- header_eof //--> ? ? ? ? ?<!-- body //--> ? ? ? ? ?<table border="0" width="100%" 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 width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?> ? ? ? ? ? ? ? ? ?<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_payment.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> ? ? ? ? ? ? ? ? ? ?<?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?> ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td> ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice"> ? ? ? ? ? ? ? ? ? ? ? ? ?<tr class="infoBoxNoticeContents"> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></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="2"> ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</table> ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBox2"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr class="infoBoxContents2"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="3"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?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> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php } else { ?> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" colspan="4"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ? echo ' ? ? ? ? ?<tr>' . "\n" . ? ? ? ?' ? ? ? ? ? ?<td width="10%" class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ? ? ? ?' ? ? ? ? ? ?<td width="60%" class="main" valign="top">' . $order->products[$i]['name'] . '<br><small>Price, Each: USD $' . $order->products[$i]['price'] . '</small>' . '<br><small>Item #' . $order->products[$i]['item_number'] . '</small>'; ? if (STOCK_CHECK == 'true') { ? ? echo '<br>' . 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><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small>'; ? ? } ? } ? 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 width="30%"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"; } ?> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td colspan="4" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="3"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php if (MODULE_ORDER_TOTAL_INSTALLED) { ? $order_total_modules->process(); ? echo $order_total_modules->output(); } ?> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ?</table> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '25'); ?></td> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ?<td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ?</table></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><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<br> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" align="center" valign="top"><b><?php echo TITLE_BILLING_ADDRESS; ?></b><br> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ?</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><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ?<td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td> ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ?</table></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"> ? ? ? ? ? ? ? ? ? ? ? ?<?php $selection = $payment_modules->selection(); if (sizeof($selection) > 1) { ?> ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" width="50%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b><br> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ?<?php } else { ?> ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ?<?php } $radio_buttons = 0; for ($i=0, $n=sizeof($selection); $i<$n; $i++) { ?> ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<?php ? if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) { ? ? echo ' ? ? ? ? ? ? ? ? ?<tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; ? } else { ? ? echo ' ? ? ? ? ? ? ? ? ?<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; ? } ?> ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td> ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" align="right"><?php ? if (sizeof($selection) > 1) { ? ? echo tep_draw_radio_field('payment', $selection[$i]['id']); ? } else { ? ? echo tep_draw_hidden_field('payment', $selection[$i]['id']); ? } ?> ? ? ? ? ? ? ? ? ? ? ? ?</td> ? ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?<?php ? if (isset($selection[$i]['error'])) { ?> ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ?<td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td> ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?<?php ? } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) { ?> ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ?<td colspan="4"><table border="0" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ? ?<?php ? ? for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) { ?> ? ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ? ?<?php ? ? } ?> ? ? ? ? ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?<?php ? } ?> ? ? ? ? ? ? ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ? ? ?<?php ? $radio_buttons++; } ?> ? ? ? ? ? ? ? ? ? ?</table></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="2"> ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ?<td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ?</table></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><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?</table></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"> ? ? ? ? ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></b></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> ? ? ? ? ? ? ? ? ? ? ? ? ?<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ? ? ? ?</table></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%"><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%"><?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 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="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> ? ? ? ? ? ? ? ? ? ?<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> ? ? ? ? ? ? ? ? ? ?<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> ? ? ? ? ? ? ? ? ?</tr> ? ? ? ? ? ? ?</table></td> ? ? ? ? ? ?</tr> ? ? ? ? ?</table> ? ? ? ? ?<!-- body_text_eof //--> ? ? ? ? ?<!-- body_eof //--> ? ? ? ? ?<!-- footer //--> ? ? ? ? ?<?php require(DIR_WS_INCLUDES . 'footer.php'); ?></td> ? ? ?</tr> ? ?</table></td> ?</tr> ?<tr> ? ?<td> </td> ?</tr> ?<tr> ? ?<td> </td> ?</tr> ?<tr> ? ?<td> </td> ?</tr> </table> <p> </p> <p> </p> <p> </p> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
TerryK Posted June 18, 2004 Author Posted June 18, 2004 I don't understand what you mean. Can you point me to a URL so I can see it? Thanks, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
jjanguda Posted June 18, 2004 Posted June 18, 2004 TerryK, I think I solved that problem.. But, I do have another question for you.. As you can see here, I want Products Ordered infomation be located in a box just like Billing Address. I think it looks way better and well organized. I'm sure you can do this.. BTW, thanks for the payment php code.. I really like your idea.
TerryK Posted June 23, 2004 Author Posted June 23, 2004 *** CORRECTION TO CHECKOUT_SHIPPING INSTRUCTIONS *** 2. Around line 22 of /catalog/checkout_shipping.php, look for: // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping destination address was selected, use the customers own address as default Replace with: // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // Stock Check if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) { $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); break; } } } // if no shipping destination address was selected, use the customers own address as default 3. Around line 205 of /catalog/checkout_shipping.php, look for: <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><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_delivery.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="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td> </tr> </table></td> </tr> Replace with: <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><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_delivery.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="0" cellpadding="2"> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBox"> <?php if (sizeof($order->info['tax_groups']) > 1) { ?> <tr class="infoBoxContents"> <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> <tr> <td COLSPAN="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td> </tr> <?php } else { ?> <tr class="infoBoxContents"> <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> <tr> <td COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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"; } ?> <tr> <td align="right" class="main" COLSPAN="3"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td> </tr> <tr> <td COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td> </tr> </table></td> </tr> Okay, now this should work. Sorry for the confusion... Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
TerryK Posted June 23, 2004 Author Posted June 23, 2004 As you can see here, I want Products Ordered infomation be located in a boxjust like Billing Address. I think it looks way better and well organized. I'm sure you can do this.. BTW, thanks for the payment php code.. I really like your idea. Hi jjanguda, The code I just posted should also fix your layout -- give it a try and let me know. HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
jjanguda Posted June 27, 2004 Posted June 27, 2004 thanks, TerryK. Finally I fixed all layout problems.. I also tried checkout_shipping.php as well.. It works fine.. Thanks TerryK..
jjanguda Posted August 10, 2004 Posted August 10, 2004 TerryK, I'd like to add OUT_OF_STOCK_CAN_CHECKOUT message in catalog/checkout_payment.php right after the final price. Please take a look at this pic.. As you can see, I'd like to add a short phrase at the bottom of the box. By the way, item # doesn't work. So I just modified just like checkout_shipping.php. I'd like to use a "if" function for this so that that message may come or may not depending on a stock. I'll appreciate for any help.. Thank you.
TerryK Posted August 11, 2004 Author Posted August 11, 2004 In shopping_cart.php, they use this code to display the stock messages: <?php if ($any_out_of_stock == 1) { if (STOCK_ALLOW_CHECKOUT == 'true') { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td> </tr> <?php } else { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td> </tr> <?php } } ?> You could try inserting that underneath the two instances where the order total shows, something like this (NOT TESTED, SO BACKUP BEFORE YOU TRY!!!) : <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> <tr> <td COLSPAN="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td> </tr> <?php if ($any_out_of_stock == 1) { if (STOCK_ALLOW_CHECKOUT == 'true') { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td> </tr> <?php } else { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td> </tr> <?php } } ?> <?php } else { ?> <tr> <td class="main" colspan="4"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td COLSPAN="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr>' . "\n" . ' <td width="10%" class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td width="60%" class="main" valign="top">' . $order->products[$i]['name'] . '<br><small>Price, Each: USD $' . $order->products[$i]['price'] . '</small>' . '<br><small>Item #' . $order->products[$i]['item_number'] . '</small>'; if (STOCK_CHECK == 'true') { echo '<br>' . 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><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small>'; } } 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 width="30%"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"; } ?> <tr><td COLSPAN="4" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="3"> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> <?php if ($any_out_of_stock == 1) { if (STOCK_ALLOW_CHECKOUT == 'true') { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td> </tr> <?php } else { ?> <tr> <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td> </tr> <?php } } ?> </table></td> </tr> Again, I have NOT tested this, so I have no idea whether it will work or not, but perhaps it will at least get you going in the right direction... HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
jjanguda Posted August 13, 2004 Posted August 13, 2004 well.. unfortunately, it doesn't work at all.. hmm.. Can you take a look at my checkout_payment.php code if there's a problem... <?php /* $Id: checkout_payment.php,v 1.113 2003/06/29 23:03:27 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers cart, redirect them to the shopping cart page if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($cart->cartID) && tep_session_is_registered('cartID')) { if ($cart->cartID != $cartID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } // Stock Check if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) { $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); break; } } } // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; // if no billing destination address was selected, use the customers own address as default if (!tep_session_is_registered('billto')) { tep_session_register('billto'); $billto = $customer_default_address_id; } else { // verify the selected billing address $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'"); $check_address = tep_db_fetch_array($check_address_query); if ($check_address['total'] != '1') { $billto = $customer_default_address_id; if (tep_session_is_registered('payment')) tep_session_unregister('payment'); } } require(DIR_WS_CLASSES . 'order.php'); $order = new order; if (!tep_session_is_registered('comments')) tep_session_register('comments'); $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); // load all enabled payment modules require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment; require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); ?> <!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"> <script language="javascript"><!-- var selected; function selectRowEffect(object, buttonSelect) { if (!selected) { if (document.getElementById) { selected = document.getElementById('defaultSelected'); } else { selected = document.all['defaultSelected']; } } if (selected) selected.className = 'moduleRow'; object.className = 'moduleRowSelected'; selected = object; // one button is not an array if (document.checkout_payment.payment[0]) { document.checkout_payment.payment[buttonSelect].checked=true; } else { document.checkout_payment.payment.checked=true; } } function rowOverEffect(object) { if (object.className == 'moduleRow') object.className = 'moduleRowOver'; } function rowOutEffect(object) { if (object.className == 'moduleRowOver') object.className = 'moduleRow'; } //--></script> <?php echo $payment_modules->javascript_validation(); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <table width="964" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="964" height="165"> <param name="movie" value="images/flash/top_b.swf"> <param name="quality" value="high"> <embed src="images/flash/top_b.swf" quality="high" pluginspage="www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="964" height="165"></embed> </object></td> </tr> <tr> <td> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" 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 width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><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_payment.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> <?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice"> <tr class="infoBoxNoticeContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td class="main" colspan="4"> <?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit"><strong>(' . TEXT_EDIT . ')</strong></span></a>'; ?> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="3" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="3"> <?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 width="68%" class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td> <td width="3%" class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td> </tr> <tr> <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td> </tr> <?php } else { ?> <?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>'; } } 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"; } ?> <tr> <td colspan="4" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="3"> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> </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><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td> </tr> </table></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><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br><br><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td> <td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" align="center" valign="top"><b><?php echo TITLE_BILLING_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </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><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td> </tr> </table></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"> <?php $selection = $payment_modules->selection(); if (sizeof($selection) > 1) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td> <td class="main" width="50%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } else { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } $radio_buttons = 0; for ($i=0, $n=sizeof($selection); $i<$n; $i++) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) { echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } else { echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n"; } ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td> <td class="main" align="right"> <?php if (sizeof($selection) > 1) { echo tep_draw_radio_field('payment', $selection[$i]['id']); } else { echo tep_draw_hidden_field('payment', $selection[$i]['id']); } ?> </td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php if (isset($selection[$i]['error'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td colspan="4"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php } ?> </table></td> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <?php $radio_buttons++; } ?> </table></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="2"> <tr> <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> </table></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><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td> </tr> </table></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"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td> <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></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%"><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%"><?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 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="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table> </form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> thank you for all your help.
oldworldcharms Posted March 22, 2005 Posted March 22, 2005 I'm using MS2.2 Can someone post a code for the shipping page that did work (displayed the cart in the checkout_shipping.php) Thanks
TerryK Posted March 22, 2005 Author Posted March 22, 2005 Try this thread -- I think there are a couple of 'correction' posts you'll need to read through, but it definitely works. I'm using it on my site. http://www.oscommerce.com/forums/index.php?showtopic=96860 HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
RGStephens Posted July 2, 2005 Posted July 2, 2005 Try this thread -- I think there are a couple of 'correction' posts you'll need to read through, but it definitely works. I'm using it on my site. http://www.oscommerce.com/forums/index.php?showtopic=96860 HTH, Terry <{POST_SNAPBACK}> Hi Terry - I was browsing through the tips forum and found your original tip in this thread regarding pitting the total in the checkout process before the customer has to put in the credit card info and I thought that was a really smart thing to do. So I applied your mods. There was nothing funky about the changes...I found the exact code you were looking for and I placed the additions on top as you instructed. Sadly :( When I tested it I get this error: Fatal error: Cannot redeclare class order_total in /home/mysite/public_html/oscatalog/includes/classes/order_total.php on line 15 Interestingly enough I was having the same problem with PayPay IPN conflicting with My Print Order contrib so I took the button out of order_total 'cause I knew I could do with out it. But I don't know why this is popping up again. Do you have any ideas? Rick PS (You have some great contribution by the way)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.