[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * checkout_success header_php.php 4 * 5 * @package page 6 * @copyright Copyright 2003-2006 Zen Cart Development Team 7 * @copyright Portions Copyright 2003 osCommerce 8 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 9 * @version $Id: header_php.php 3160 2006-03-11 01:37:18Z drbyte $ 10 */ 11 12 // This should be first line of the script: 13 $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SUCCESS'); 14 15 // if the customer is not logged on, redirect them to the shopping cart page 16 if (!$_SESSION['customer_id']) { 17 zen_redirect(zen_href_link(FILENAME_TIME_OUT)); 18 } 19 20 $notify_string=''; 21 if (isset($_GET['action']) && ($_GET['action'] == 'update')) { 22 $notify_string = 'action=notify&'; 23 $notify = $_POST['notify']; 24 25 if (is_array($notify)) { 26 for ($i=0, $n=sizeof($notify); $i<$n; $i++) { 27 $notify_string .= 'notify[]=' . $notify[$i] . '&'; 28 } 29 if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1); 30 } 31 if ($notify_string == 'action=notify&') { 32 zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); 33 } else { 34 zen_redirect(zen_href_link(FILENAME_DEFAULT, $notify_string)); 35 } 36 } 37 38 require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php')); 39 $breadcrumb->add(NAVBAR_TITLE_1); 40 $breadcrumb->add(NAVBAR_TITLE_2); 41 42 // find out the last order number generated for this customer account 43 $orders_query = "SELECT * FROM " . TABLE_ORDERS . " 44 WHERE customers_id = :customersID 45 ORDER BY date_purchased DESC LIMIT 1"; 46 $orders_query = $db->bindVars($orders_query, ':customersID', $_SESSION['customer_id'], 'integer'); 47 $orders = $db->Execute($orders_query); 48 $orders_id = $orders->fields['orders_id']; 49 50 // use order-id generated by the actual order process 51 // this uses the SESSION orders_id, or if doesn't exist, grabs most recent order # for this cust (needed for paypal et al). 52 // Needs reworking in v1.4 for checkout-rewrite 53 $zv_orders_id = ($_SESSION['order_number_created'] >= 1) ? $_SESSION['order_number_created'] : $orders_id; 54 $orders_id = $zv_orders_id; 55 56 // prepare list of product-notifications for this customer 57 $global_query = "SELECT global_product_notifications 58 FROM " . TABLE_CUSTOMERS_INFO . " 59 WHERE customers_info_id = :customersID"; 60 61 $global_query = $db->bindVars($global_query, ':customersID', $_SESSION['customer_id'], 'integer'); 62 $global = $db->Execute($global_query); 63 $flag_global_notifications = $global->fields['global_product_notifications']; 64 65 if ($flag_global_notifications != '1') { 66 67 $products_array = array(); 68 $counter = 0; 69 70 $products_query = "SELECT products_id, products_name 71 FROM " . TABLE_ORDERS_PRODUCTS . " 72 WHERE orders_id = :ordersID 73 ORDER BY products_name"; 74 75 $products_query = $db->bindVars($products_query, ':ordersID', $orders_id, 'integer'); 76 $products = $db->Execute($products_query); 77 78 while (!$products->EOF) { 79 $notificationsArray[] = array('counter'=>$counter, 80 'products_id'=>$products->fields['products_id'], 81 'products_name'=>$products->fields['products_name']); 82 $counter++; 83 $products->MoveNext(); 84 } 85 } 86 87 $flag_show_products_notification = (CUSTOMERS_PRODUCTS_NOTIFICATION_STATUS == '1' and sizeof($notificationsArray)>0 and $flag_global_notifications != '1') ? true : false ; 88 89 $products_displayed = array(); 90 91 92 $gv_query = "SELECT amount 93 FROM " . TABLE_COUPON_GV_CUSTOMER . " 94 WHERE customer_id = :customersID "; 95 96 $gv_query = $db->bindVars($gv_query, ':customersID', $_SESSION['customer_id'], 'integer'); 97 $gv_result = $db->Execute($gv_query); 98 99 if ($gv_result->fields['amount'] > 0 ) { 100 $customer_has_gv_balance = true; 101 $customer_gv_balance = $currencies->format($gv_result->fields['amount']); 102 } 103 104 105 // include template specific file name defines 106 $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_CHECKOUT_SUCCESS, 'false'); 107 108 // This should be last line of the script: 109 $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SUCCESS'); 110 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |