[TEP-COMMIT] [CVS catalog] the new checkout confirmation page based on a CSS layout, and the new
hpdl-OfajU3CKLf1/[email protected] 30 Mar 2005 00:10:38 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt>content/pages/<a href="#file1"><span id="added">checkout_confirmation.php</span></a></tt></td><td align="right" id="added">+218</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/checkout_confirmation.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr class="alt"><td><tt>modules/checkout/<a href="#file2"><span id="added">confirmation.php</span></a></tt></td><td align="right" id="added">+118</td><td></td><td nowrap="nowrap" align="right">added <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/checkout/confirmation.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></td></tr>
<tr><td></td><td align="right" id="added">+336</td><td></td><td></td></tr>
</table>
<small id="info">2 added files</small><br />
<pre class="comment">
the new checkout confirmation page based on a CSS layout, and the new
confirmation checkout module to handle the processing logic
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content">content</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages">pages</a><br /></span>
<div class="fileheader" id="added"><big><b>checkout_confirmation.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/content/pages/checkout_confirmation.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N checkout_confirmation.php
--- /dev/null Wed Mar 30 02:10:26 2005
+++ /tmp/cvsAAAJFaWH5 Wed Mar 30 02:10:32 2005
@@ -0,0 +1,218 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+?>
+
+<div class="pageHeading">
+ <span class="pageHeadingImage"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_confirmation.gif', HEADING_TITLE_CHECKOUT_CONFIRMATION, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></span>
+
+ <h1><?php echo sprintf(HEADING_TITLE_CHECKOUT_CONFIRMATION, $_GET['orders']); ?></h1>
+</div>
+
+<div class="moduleBox">
+ <div class="content">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="30%" valign="top">
+
+<?php
+ if ($osC_Session->value('sendto') != false) {
+?>
+ <p><?php echo '<b>' . HEADING_DELIVERY_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, 'shipping_address', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></p>
+ <p><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></p>
+
+<?php
+ if (tep_not_null($order->info['shipping_method'])) {
+?>
+
+ <p><?php echo '<b>' . HEADING_SHIPPING_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></p>
+ <p><?php echo $order->info['shipping_method']; ?></p>
+
+<?php
+ }
+ }
+?>
+
+ <p><?php echo '<b>' . HEADING_BILLING_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, 'payment_address', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></p>
+ <p><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></p>
+
+ <p><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, 'payment', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></p>
+ <p><?php echo $order->info['payment_method']; ?></p>
+ </td>
+ <td width="70%" valign="top">
+ <div style="border: 1px; border-style: solid; border-color: #CCCCCC; background-color: #FBFBFB; padding: 5px;">
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+<?php
+ if (sizeof($order->info['tax_groups']) > 1) {
+?>
+ <tr>
+ <td colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+ <td align="right"><b><?php echo HEADING_TAX; ?></b></td>
+ <td align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
+ </tr>
+<?php
+ } else {
+?>
+ <tr>
+ <td colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
+ </tr>
+<?php
+ }
+
+ for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ echo ' <tr>' . "\n" .
+ ' <td align="right" valign="top" width="30">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
+ ' <td 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>&nbsp;<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 valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
+ }
+
+ echo ' <td align="right" valign="top">' . $osC_Currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
+ ' </tr>' . "\n";
+ }
+?>
+
+ </table>
+
+ <p>&nbsp;</p>
+
+ <table border="0" width="100%" cellspacing="0" cellpadding="2">
+
+<?php
+ if (MODULE_ORDER_TOTAL_INSTALLED) {
+ $order_total_modules->process();
+ echo $order_total_modules->output();
+ }
+?>
+
+ </table>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<?php
+ if (is_array($payment_modules->modules)) {
+ if ($confirmation = $payment_modules->confirmation()) {
+?>
+
+<div class="moduleBox">
+ <div class="outsideHeading">
+ <?php echo HEADING_PAYMENT_INFORMATION; ?>
+ </div>
+
+ <div class="content">
+ <table border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>
+ </tr>
+<?php
+ for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
+?>
+ <tr>
+ <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+ <td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
+ <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
+ <td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
+ </tr>
+<?php
+ }
+?>
+ </table>
+ </div>
+</div>
+
+<?php
+ }
+ }
+
+ if (tep_not_null($order->info['comments'])) {
+?>
+
+<div class="moduleBox">
+ <div class="outsideHeading">
+ <?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT, 'payment', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?>
+ </div>
+
+ <div class="content">
+ <?php echo nl2br(tep_output_string_protected($order->info['comments'])) . osc_draw_hidden_field('comments', $order->info['comments']); ?>
+ </div>
+</div>
+
+<?php
+ }
+?>
+
+<div class="submitFormButtons" style="text-align: right;">
+
+<?php
+ if (isset($$payment->form_action_url)) {
+ $form_action_url = $$payment->form_action_url;
+ } else {
+ $form_action_url = tep_href_link(FILENAME_CHECKOUT, 'process', 'SSL');
+ }
+
+ echo '<form name="checkout_confirmation" action="' . $form_action_url . '" method="post">';
+
+ if (is_array($payment_modules->modules)) {
+ echo $payment_modules->process_button();
+ }
+
+ echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>';
+?>
+
+</div>
+
+<table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+ <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+ </tr>
+ </table></td>
+ <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+ <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+ <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
+ <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+ </tr>
+ </table></td>
+ <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
+ <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
+ <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT, 'payment', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>
+ <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
+ <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
+ </tr>
+</table>
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname" id="added"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules">modules</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/checkout">checkout</a><br /></span>
<div class="fileheader" id="added"><big><b>confirmation.php</b></big> <small id="info">added at <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/modules/checkout/confirmation.php?rev=1.1&content-type=text/vnd.viewcvs-markup">1.1</a></small></div>
<pre class="diff"><small id="info">diff -N confirmation.php
--- /dev/null Wed Mar 30 02:10:26 2005
+++ /tmp/cvsAAAXVa4I5 Wed Mar 30 02:10:33 2005
@@ -0,0 +1,118 @@
</small></pre><pre class="diff" id="added">+<?php
+/*
+ $Id$
+
+ osCommerce, Open Source E-Commerce Solutions
+ http://www.oscommerce.com
+
+ Copyright (c) 2005 osCommerce
+
+ Released under the GNU General Public License
+*/
+
+ class osC_Checkout_Confirmation {
+
+/* Public variables */
+
+ var $page_contents = 'checkout_confirmation.php';
+
+/* Private variables */
+
+ var $_module = 'confirmation';
+
+/* Class constructor */
+
+ function osC_Checkout_Confirmation() {
+ global $osC_Session, $osC_Services, $messageStack, $breadcrumb, $order, $cart, $payment_modules, $shipping_modules, $order_total_modules, $any_out_of_stock;
+
+ if ($cart->count_contents() < 1) {
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));
+ }
+
+// avoid hack attempts during the checkout procedure by checking the internal cartID
+ if (isset($cart->cartID) && $osC_Session->exists('cartID')) {
+ if ($cart->cartID != $osC_Session->value('cartID')) {
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
+ }
+ }
+
+// if no shipping method has been selected, redirect the customer to the shipping method selection page
+ if ($osC_Session->exists('shipping') == false) {
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
+ }
+
+ if ($osC_Services->isStarted('breadcrumb')) {
+ $breadcrumb->add(NAVBAR_TITLE_CHECKOUT_CONFIRMATION, tep_href_link(FILENAME_CHECKOUT, $this->_module, 'SSL'));
+ }
+
+ if (isset($_POST['payment'])) {
+ $osC_Session->set('payment', $_POST['payment']);
+ }
+ $payment =& $osC_Session->value('payment');
+
+ if ( (isset($_POST['comments'])) && ($osC_Session->exists('comments')) && (empty($_POST['comments'])) ) {
+ $osC_Session->remove('comments');
+ } else if (tep_not_null($_POST['comments'])) {
+ $osC_Session->set('comments', tep_sanitize_string($_POST['comments']));
+ }
+
+ if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
+ if (!isset($_POST['conditions']) || ($_POST['conditions'] != '1')) {
+ $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
+ }
+ }
+
+// load the selected payment module
+ require(DIR_WS_CLASSES . 'payment.php');
+ $payment_modules = new payment($osC_Session->value('payment'));
+
+ $order = new order;
+
+ $payment_modules->update_status();
+
+ if ( (is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !isset($GLOBALS[$payment])) || (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment]) && ($GLOBALS[$payment]->enabled == false)) ) {
+ $messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error');
+ }
+
+ if ($messageStack->size('checkout_payment') > 0) {
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'payment', 'SSL'));
+ }
+
+ if (is_array($payment_modules->modules)) {
+ $payment_modules->pre_confirmation_check();
+ }
+
+// load the selected shipping module
+ require(DIR_WS_CLASSES . 'shipping.php');
+ $shipping_modules = new shipping($osC_Session->value('shipping'));
+
+ require(DIR_WS_CLASSES . 'order_total.php');
+ $order_total_modules = new order_total;
+
+// Stock Check
+ $any_out_of_stock = false;
+ if (STOCK_CHECK == 'true') {
+ for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
+ $any_out_of_stock = true;
+ }
+ }
+// Out of Stock
+ if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {
+ tep_redirect(tep_href_link(FILENAME_CHECKOUT));
+ }
+ }
+ }
+
+/* Public methods */
+
+ function getPageContentsFile() {
+ return $this->page_contents;
+ }
+
+/* Private methods */
+
+ function _process() {
+ }
+ }
+?>
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click