Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Checkout Proceedure


ACE99

Recommended Posts

  • Replies 139
  • Created
  • Last Reply
This code is ALPHA

 

USE THIS CODE FOR TESTING PURPOSES ONLY

 

Known bugs: Only works with one payment module activated. If more than one module is activated, the radio buttons do not carry a "checked" value when the form is submitted, which causes redirection back to checkout_payment.php.

 

Possible bugs: For some reason my UPS module isn't catching the country the first time around loading checkout_shipping.php.

 

Tested with:

 

- PWA - Purchase Without Account

- Regular account

- All default shipping modules (multiple activated at once) except USPS

- Paypal IPN and check/money order

 

Notes:

 

- I haven't tested this with a virtual product yet.

- All javascript has been removed for now.

- Combining these two pages causes checkout_shipping.php to equal 30k in size.

- The checkout progress bar at the bottom has not been altered yet.

 

checkout_shipping.php code:

 

 

nice work.... seems to work pretty well.... the continue button on the bottom actually tries to go to checkout_payment instead of checkout_confirmation....I will play with it a little more to see why...sure its a minor thing....but looks like all the parameters are getting passed along correclty.....

 

:thumbsup:

Link to comment
Share on other sites

nice work.... seems to work pretty well.... the continue button on the bottom actually tries to go to checkout_payment instead of checkout_confirmation....I will play with it a little more to see why...sure its a minor thing....but looks like all the parameters are getting passed along correclty.....

 

:thumbsup:

 

Do you have more than one payment module activated? You'll have that problem if you do. See "Known Bugs"...I'm working on this tonight. Cross your fingers!

Link to comment
Share on other sites

Do you have more than one payment module activated? You'll have that problem if you do. See "Known Bugs"...I'm working on this tonight. Cross your fingers!

 

no i don't... I use one ship module (individual ship) and only one payment module (authorize.net)...so nice and clean...

 

what version did you build this on?

 

I might also attempt to port over the code for credit class & gift voucher once this stabilizes.....

 

When you test this new code, does the name field in the payment box get pre-populated? Mine does not. This is usually an indication something needs a little tweaking....but I must say you are close....

Link to comment
Share on other sites

MS2.2 - sorry that I forgot to include that in my original post. What version are you using?

 

LOL... not sure I have a version... look at my member #....been at this a LONG time.... :-" but I have well over 100 contributions and a VERY custom layout... I do wonder if the CCGV contrib (gift certs & coupons) is mucking with it..... My version still uses a checkout_process.php file...not sure if the version you are building on has this....

 

so looking at your code cutting, you took an original checkout_shipping.php and simply added the "html" portion of checkout_payment.php into it? I assume you also moved some (or all) of the php checks and queries out of checkout_payment.php and moved it over to checkout_shipping.php? I know there is some redundant code in both....

 

If I manually launch checkout_confirmation.php from your alpha code, all information actually ports over. I have not tried "confirming" the order at that point to see if the data correctly gets sent to authorize.net as I want to work out all the little bugs first....

Link to comment
Share on other sites

I did this on a vanilla install of 2.2 with no mods except the Paypal IPN module. I have a client who only uses one payment method (Authorize.net), so this will work for her (hopefully), but I'm also going to have to integrate CCGV into it. I'll be testing it with Authorize.net and will let you know of the results if it doesn't get tested by someone else first.

 

I'm wondering if maybe you have a contrib installed that I stumbled onto last night - Address Book Enhancer. I made a first attempt at combining the shipping/payment address forms and failed miserably, but I think that the Address Book Enhancer could have some use when I make a second attempt.

 

I did splice to create that code, but I checked for redudancy ;)

 

I've tried this on two stores that I'm building and I've noticed the problem with UPS not picking up the customer's country on the first load occurs on both.

Link to comment
Share on other sites

I did this on a vanilla install of 2.2 with no mods except the Paypal IPN module.  I have a client who only uses one payment method (Authorize.net), so this will work for her (hopefully), but I'm also going to have to integrate CCGV into it. I'll be testing it with Authorize.net and will let you know of the results if it doesn't get tested by someone else first.

 

I'm wondering if maybe you have a contrib installed that I stumbled onto last night - Address Book Enhancer. I made a first attempt at combining the shipping/payment address forms and failed miserably, but I think that the Address Book Enhancer could have some use when I make a second attempt.

 

I did splice to create that code, but I checked for redudancy ;) 

 

I've tried this on two stores that I'm building and I've noticed the problem with UPS not picking up the customer's country on the first load occurs on both.

 

nope....no address book enhancer... i only ship to billing address so have disabled this by removing all buttons, etc..... besides CCGV, I can't think of anything else that might interfere.....

 

I am trying something as we "speak" and will post my results in a bit .... if it works... :blink:

Link to comment
Share on other sites

CHECKOUT/SHIPPING ALPHA 2 FOR MS2.2

 

USE THIS CODE FOR TESTING PURPOSES ONLY

 

Known bugs: For some reason the UPS shipping module isn't catching the country the first time around loading checkout_shipping.php.

 

Tested with:

 

- 2.2 Milestone 2

- PWA - Purchase Without Account

- Regular account

- All default shipping modules (multiple activated at once) except USPS

- Paypal IPN and check/money order

 

Notes:

 

- I haven't tested this with a virtual product yet.

- Need to add javascript back onto shipping module table rows.

- The code below increases checkout_shipping.php to 30k in size.

- The checkout progress bar at the bottom has not been altered yet.

- Credit for the default payment module radio button code goes to Terry K :thumbsup:

 

checkout_shipping.php code:

 

<?php

 require('includes/application_top.php');
 require('includes/classes/http_client.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));
 }
 
// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
 if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
 $cartID = $cart->cartID;
   
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;
 
// if no shipping destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('sendto')) {
   tep_session_register('sendto');
   $sendto = $customer_default_address_id;
 } else {

// verify the selected shipping 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)$sendto . "'");
   $check_address = tep_db_fetch_array($check_address_query);

   if ($check_address['total'] != '1') {
     $sendto = $customer_default_address_id;
     if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
   }
 }
 
 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();

// load all enabled shipping modules
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping;

 if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
   $pass = false;

   switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
     case 'national':
       if ($order->delivery['country_id'] == STORE_COUNTRY) {
         $pass = true;
       }
       break;
     case 'international':
       if ($order->delivery['country_id'] != STORE_COUNTRY) {
         $pass = true;
       }
       break;
     case 'both':
       $pass = true;
       break;
   }

   $free_shipping = false;
   if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
     $free_shipping = true;

     include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
   }
 } else {
   $free_shipping = false;
 }

// process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
	 if (!tep_session_is_registered('payment')) tep_session_register('payment');
	 if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];
   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
     $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }

   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
     if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
       $shipping = $HTTP_POST_VARS['shipping'];

       list($module, $method) = explode('_', $shipping);
       if ( is_object($$module) || ($shipping == 'free_free') ) {
         if ($shipping == 'free_free') {
           $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
           $quote[0]['methods'][0]['cost'] = '0';
         } else {
           $quote = $shipping_modules->quote($method, $module);
         }
         if (isset($quote['error'])) {
           tep_session_unregister('shipping');
         } else {
           if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
             $shipping = array('id' => $shipping,
                               'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                               'cost' => $quote[0]['methods'][0]['cost']);

             tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
           }
         }
       } else {
         tep_session_unregister('shipping');
       }
     }
   } else {
     $shipping = false;
               
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }    
 }

// get all available shipping quotes
 $quotes = $shipping_modules->quote();

// 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 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');
   }
 }

// load all enabled payment modules
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment;

// if no shipping method has been selected, automatically select the cheapest method.
// if the modules status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
 if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);
 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_SHIPPING, '', '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_address.payment[0]) {
   document.checkout_address.payment[buttonSelect].checked=true;
 } else {
   document.checkout_address.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 //-->
<?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="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" rowspan="2" 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 //-->
<!-- begin shipping //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td>
 <table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_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>
     <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_CHOOSE_SHIPPING_DESTINATION . '<br><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_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"><?php echo '<b>' . TITLE_SHIPPING_ADDRESS . '</b><br>' . 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, $sendto, 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>
<?php
 if (tep_count_shipping_modules() > 0) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo TABLE_HEADING_SHIPPING_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
   if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {
?>
             <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td>
               <td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
<?php
   } elseif ($free_shipping == false) {
?>
             <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
<?php
   }

   if ($free_shipping == true) {
?>
             <tr>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td colspan="2" width="100%"><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" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$i]['icon']; ?></td>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                 </tr>
                 <tr>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                   <td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                 </tr>
               </table></td>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
             </tr>
<?php
   } else {
     $radio_buttons = 0;
     for ($i=0, $n=sizeof($quotes); $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">
                 <tr>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                   <td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                 </tr>
<?php
       if (isset($quotes[$i]['error'])) {
?>
                 <tr>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                   <td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                 </tr>
<?php
       } else {
         for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
           $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);

           if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
             echo '                  <tr>' . "\n";
           } else {
             echo '                  <tr>' . "\n";
           }
?>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                   <td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
<?php
           if ( ($n > 1) || ($n2 > 1) ) {
?>
                   <td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
                   <td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>
<?php
           } else {
?>
                   <td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>
<?php
           }
?>
                   <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                 </tr>
<?php
           $radio_buttons++;
         }
       }
?>
               </table></td>
               <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 
             </tr>
<?php
     }
   }
?>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
?>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" rowspan="2" 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>
 <tr>
   <td valign="top">
<!-- begin payment //-->
<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 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) {
    if ($i == 0) {
       $checked = true;
    } else {
       $checked = false;
    }
    echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked);
  } 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>
<!-- body_text_eof //-->
</td>
 </tr>
</table>
<!-- body_eof //-->
</form>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Just tried it, but I get this:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '>=fra_nr and <=til_nr' at line 1

select * from posten_postnr where >=fra_nr and <=til_nr

[TEP STOP]

 

My shipping-module is Norwegian Shipping - Posten Servicepakke

It's the only one installed, I have also only one payment-option: Credit-card

Petter - Arktisk Pudder

Link to comment
Share on other sites

You people do know this was a thread for suggested changes for MS3, not a place to put your contributions. this continuing discussion should be in its own thread. Especially considering the code is incompatible with MS3.

Link to comment
Share on other sites

You people do know this was a thread for suggested changes for MS3, not a place to put your contributions. this continuing discussion should be in its own thread. Especially considering the code is incompatible with MS3.

 

And where is that written? The title of this post does not reference MS3 and the author does not mention it in his 1st post. Post #3 and #4 of this thread already start talking about changes to existing stores -- NOT MS3. I do believe these last few posts follow the spirit of the thread and the code that is being shared may help MANY people.

Link to comment
Share on other sites

And where is that written? The title of this post does not reference MS3 and the author does not mention it in his 1st post. Post #3 and #4 of this thread already start talking about changes to existing stores -- NOT MS3. I do believe these last few posts follow the spirit of the thread and the code that is being shared may help MANY people.

 

so..its a mix and mach...,the contributing parties has still done a fenominal job....

 

 

as a sid epoint..even though emproved..the current MS3 chekoutv does need improvmnents..so the content of this tread is highly relevant as it does address several of the shortcommings bothin ms2.2 and ms3.

 

Go for it... B)

Link to comment
Share on other sites

You people do know this was a thread for suggested changes for MS3, not a place to put your contributions. this continuing discussion should be in its own thread. Especially considering the code is incompatible with MS3.

 

You'd be right if this thread was in the Development section. Sorry, but it's not.

Link to comment
Share on other sites

Just tried it, but I get this:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '>=fra_nr and <=til_nr' at line 1

select * from posten_postnr where >=fra_nr and <=til_nr

[TEP STOP]

 

My shipping-module is Norwegian Shipping - Posten Servicepakke

It's the only one installed, I have also only one payment-option: Credit-card

 

Petter, I suggest going through the install instructions for Posten Servicepakke to see if any changes were made to checkout_shipping.php.

Link to comment
Share on other sites

Nothing much to add other than when/if it's done I and countless others will be eternally indebted to those involved.

 

I switched carts on a site a few years back to oscommerce because the (admittedly cheap) commercial cart just didn't have the features I needed. Oscommerce has it all but...the change meant a 20% drop in sales because of the appaling, cluttered, complicated checkout. I've stuck with oscommerce because of the community and flexibility but if that checkout process could be simplified by someone with better php skill then I.... :D

Link to comment
Share on other sites

I hope to have the bug with UPS worked out soon - I have to, because I'm going to be using this on two live stores in about two weeks. Right now, I have the checkout procedure for one store as follows:

 

1 Customer clicks checkout

2 If customer is not logged in, goes to login/create account combo page (with limited questions)

3 Customer goes to checkout_shipping.php after logged in/account created

4 Customer goes to order confirmation

5 Customer places order

Link to comment
Share on other sites

This thread is aimed to discuss the advancement of the checkout proceedure in oscommerce.

 

In CVS the requirement to create an account have been removed with the user only needing to enter an email address and password to start the checkout process.

 

Please provide any comments on changes you would like to see to the checkout process or any additional features you would like to see.

 

Comments should be based on the checkout process only. Any posts not related to the checkout process will be removed to keep this thread on track.

 

This thread has also been made sticky.

 

Since no further development or bug fixing is being made on Milestone 2 by the development team and this post was made by a developer (at the time) when this thread was stickied, it infers that the changes looked at would be in a future version. Since the code posted is not compatible with Milestone 3 in any way, I made my comment.

Link to comment
Share on other sites

  • 1 month later...

I guess I would like to see a simpler checkout page, not only in steps, but to remove all the categories, manufacturers, reviews boxes, etc. I think that customers get distracted during the checkout process since it IS too long, and start re-browsing the site, but never finish checkout. We get tons of traffic, but not alot of buyers, and I think this is part of the problem. The other part, of course, is the huge amount of steps to checkout.

Link to comment
Share on other sites

  • 1 month later...

Has there been any contributions yet that have implemented the suggestions of this thread? If so, where can I find them. I have gone through existing contributions with a fine toothed comb and was unable to find anything that simplifies the checkout process.

 

I don't need to rant about how badly the checkout process needs to be trimmed; I am just looking for someone who has actually made the changes to the process and who is willing to provide them.

 

~Mike

Link to comment
Share on other sites

Link to comment
Share on other sites

Well crap. I just finished combining my login and create account pages. It was actually a lot easier than I thought it would be. I did use the go directly to shipping if there is anything in the cart piece though, I had forgotten about that success page.

 

Here is how my checkout process works now:

  • Click Checkout button (click 1)
  • Combined login/create account page (click 2)
  • checkout_shipping.php - shipping and billing address are required to match, address from account is used unless customer chooses to edit (click 3)
  • checkout_payment.php - Authorize.net only choice (click 4)
  • checkout_confirm.php - This page seems to be useless, need to get rid of this (click 5)

Next up, I plan to make shipping a code only page, we only offer free UPS ground and the customer can modify their address on the payment page. Once I eliminate the confirm page I'll be down to 3 clicks from cart to completed purchase.

 

This method probably won't be good for any stores that allow shipping and billing addresses to be different, but that could be solved with the checkbox that has been mentioned several times in this thread.

Link to comment
Share on other sites

Well crap. I just finished combining my login and create account pages. It was actually a lot easier than I thought it would be. I did use the go directly to shipping if there is anything in the cart piece though, I had forgotten about that success page.

 

Here is how my checkout process works now:

  • Click Checkout button (click 1)
     
  • Combined login/create account page (click 2)
     
  • checkout_shipping.php - shipping and billing address are required to match, address from account is used unless customer chooses to edit (click 3)
     
  • checkout_payment.php - Authorize.net only choice (click 4)
     
  • checkout_confirm.php - This page seems to be useless, need to get rid of this (click 5)

Next up, I plan to make shipping a code only page, we only offer free UPS ground and the customer can modify their address on the payment page. Once I eliminate the confirm page I'll be down to 3 clicks from cart to completed purchase.

 

This method probably won't be good for any stores that allow shipping and billing addresses to be different, but that could be solved with the checkbox that has been mentioned several times in this thread.

do you plan on releasing this as a contribution? :blush:

Link to comment
Share on other sites

do you plan on releasing this as a contribution? :blush:

I think I can pull out just the changes that I've made to streamline the checkout process. My store is highly modified so it will require a bit of effort to figure out what changes would need to be made to a clean install, but I think I can come up with something.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...