• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tep_session_unregister函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tep_session_unregister函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_session_unregister函数的具体用法?PHP tep_session_unregister怎么用?PHP tep_session_unregister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tep_session_unregister函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: add_wishlist

 function add_wishlist($wishlist_id, $attributes_id)
 {
     global $customer_id;
     if (!$this->in_wishlist($wishlist_id)) {
         $wishlist_id = tep_get_uprid($wishlist_id, $attributes_id);
         // Insert into session
         $this->wishID[$wishlist_id] = array($wishlist_id);
         if (tep_session_is_registered('customer_id')) {
             // Insert into database
             tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id) values ('" . $customer_id . "', '" . $wishlist_id . "')");
         }
         // Read array of options and values for attributes in id[]
         if (is_array($attributes_id)) {
             reset($attributes_id);
             while (list($option, $value) = each($attributes_id)) {
                 $this->wishID[$wishlist_id]['attributes'][$option] = $value;
                 // Add to customers_wishlist_attributes table
                 if (tep_session_is_registered('customer_id')) {
                     tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $wishlist_id . "', '" . $option . "', '" . $value . "' )");
                 }
             }
             tep_session_unregister('attributes_id');
         }
     }
 }
开发者ID:digideskio,项目名称:oscmax2,代码行数:25,代码来源:wishlist.php


示例2: execute

 function execute()
 {
     global $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($cart->count_contents() > 0) {
         $cart_contents_string = '<ul class="shoppingCartList">';
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($cart->show_total()) . '</li>' . '</ul>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     $data = '<div class="panel panel-default">' . '  <div class="panel-heading"><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . '</a></div>' . '  <div class="panel-body">' . $cart_contents_string . '</div>' . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
开发者ID:osc2nuke,项目名称:demobts,代码行数:28,代码来源:bm_shopping_cart.php


示例3: amSessionUnregister

function amSessionUnregister($strSessionVar)
{
    if (amSessionIsRegistered($strSessionVar)) {
        tep_session_unregister($strSessionVar);
    }
    unset($GLOBALS[$strSessionVar]);
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:7,代码来源:attributeManagerSessionFunctions.inc.php


示例4: execute

 function execute()
 {
     global $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($cart->count_contents() > 0) {
         $cart_contents_string = NULL;
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link('product_info.php', 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($cart->show_total()) . '</li>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     ob_start();
     include 'includes/modules/boxes/templates/shopping_cart.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:30,代码来源:bm_shopping_cart.php


示例5: _unregisterSessionVars

function _unregisterSessionVars()
{
    // unregister session variables used during checkout
    tep_session_unregister('sendto');
    tep_session_unregister('billto');
    tep_session_unregister('shipping');
    tep_session_unregister('payment');
    tep_session_unregister('comments');
}
开发者ID:TodoPago,项目名称:Plugin-OsCommerce,代码行数:9,代码来源:second_step_todopago.php


示例6: messageStack

 function messageStack()
 {
     global $messageToStack;
     $this->messages = array();
     if (tep_session_is_registered('messageToStack')) {
         for ($i = 0, $n = sizeof($messageToStack); $i < $n; $i++) {
             $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']);
         }
         tep_session_unregister('messageToStack');
     }
 }
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:11,代码来源:message_stack.php


示例7: execute

 function execute()
 {
     global $customer_id, $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     /* ** Altered for CCGV **	  
           $cart_contents_string = '';
     */
     if (tep_session_is_registered('customer_id')) {
         $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . (int) $customer_id . "'");
         $gv_result = tep_db_fetch_array($gv_query);
         if ($gv_result['amount'] > 0) {
             $gv_contents_string = '<div class="ui-widget-content infoBoxContents"><div style="float:left;">' . VOUCHER_BALANCE . '</div><div style="float:right;">' . $currencies->format($gv_result['amount']) . '</div><div style="clear:both;"></div>';
             $gv_contents_string .= '<div style="text-align:center; width:100%; margin:auto;"><a href="' . tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></div></div>';
         }
     }
     if (tep_session_is_registered('gv_id')) {
         $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
         $coupon = tep_db_fetch_array($gv_query);
         $gv_contents_string = '<div style="text-align:center; width:100%; margin:auto;">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</div>';
     }
     if (tep_session_is_registered('cc_id') && $cc_id) {
         $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
         $coupon = tep_db_fetch_array($coupon_query);
         $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_id . "' and language_id = '" . $languages_id . "'");
         $coupon_desc = tep_db_fetch_array($coupon_desc_query);
         $text_coupon_help = sprintf("%s", $coupon_desc['coupon_name']);
         $gv_contents_string = '<div style="text-align:center; width:100%; margin:auto;">' . CART_COUPON . $text_coupon_help . '<br>' . '</div>';
     }
     /* ** EOF alterations for CCGV ** */
     if ($cart->count_contents() > 0) {
         $cart_contents_string = NULL;
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($cart->show_total()) . '</li>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     ob_start();
     include DIR_WS_MODULES . 'boxes/templates/shopping_cart.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:54,代码来源:bm_shopping_cart.php


示例8: after_process

 function after_process()
 {
     global $customer_id, $insert_id, $zp_code, $order;
     if (tep_session_is_registered('zp_code')) {
         tep_session_unregister('zp_code');
     }
     tep_session_register('zp_code');
     $code = md5(md5(microtime()) . md5(rand(0, 100000)));
     $zp_code = base64_encode($code . '-' . $customer_id . '-' . $insert_id . '-' . $order->info['total']);
     //	  echo $zp_code;
     //	  die();
     return false;
 }
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:13,代码来源:zpayment.php


示例9: reset

 function reset($reset_database = false)
 {
     global $customer_id;
     $this->contents = array();
     $this->total = 0;
     $this->weight = 0;
     $this->content_type = false;
     if (tep_session_is_registered('customer_id') && $reset_database == true) {
         tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int) $customer_id . "'");
         tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int) $customer_id . "'");
     }
     unset($this->cartID);
     if (tep_session_is_registered('cartID')) {
         tep_session_unregister('cartID');
     }
 }
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:16,代码来源:shopping_cart.php


示例10: after_process

 function after_process()
 {
     global $customer_id, $insert_id, $order_totals, $rx_code, $currency, $currencies;
     if (tep_session_is_registered('op_code')) {
         tep_session_unregister('op_code');
     }
     tep_session_register('op_code');
     $ot_total_value = 0;
     for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
         if ($order_totals[$i]['code'] == 'ot_total') {
             $ot_total_value = str_replace(',', '.', round($order_totals[$i]['value'], $currencies->get_decimal_places($currency)));
             break;
         }
     }
     $code = md5(md5(microtime()) . md5(rand(0, 100000)));
     $op_code = base64_encode($code . '-' . $customer_id . '-' . $insert_id . '-' . $ot_total_value);
     return false;
 }
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:18,代码来源:onpay.php


示例11: execute

 function execute()
 {
     global $cart, $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($cart->count_contents() > 0) {
         $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0" class="ui-widget-content infoBoxContents">';
         $products = $cart->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<tr><td align="right" valign="top">';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '<span class="newItemInCart">';
             }
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '</span>';
             }
             $cart_contents_string .= '</td><td valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '<span class="newItemInCart">';
             }
             $cart_contents_string .= $products[$i]['name'];
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= '</span>';
             }
             $cart_contents_string .= '</a></td></tr>';
             if (tep_session_is_registered('new_products_id_in_cart') && $new_products_id_in_cart == $products[$i]['id']) {
                 tep_session_unregister('new_products_id_in_cart');
             }
         }
         $cart_contents_string .= '<tr><td colspan="2" style="padding-top: 5px; padding-bottom: 2px;">' . tep_draw_separator() . '</td></tr>' . '<tr><td colspan="2" align="right">' . $currencies->format($cart->show_total()) . '</td></tr>' . '</table>';
     } else {
         $cart_contents_string .= '<div class="ui-widget-content infoBoxContents">' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</div>';
     }
     $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . '</a></div>' . '  ' . $cart_contents_string . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
开发者ID:Sibzsolutions,项目名称:Savostore,代码行数:36,代码来源:bm_shopping_cart.php


示例12: tep_session_unregister

<?php

tep_session_unregister('login_userid');
tep_session_unregister('login_account_number');
tep_session_unregister('login_useremail');
tep_session_unregister('navigation');
tep_session_unregister('login_main_account_info');
// delete the cookie
tep_setcookie("account_number", $account_number, time() - 1, HTTP_COOKIE_PATH, HTTP_COOKIE_DOMAIN);
tep_setcookie("password", $login_password, time() - 1, HTTP_COOKIE_PATH, HTTP_COOKIE_DOMAIN);
tep_redirect(get_href_link(PAGE_DEFAULT, '', 'SSL'));
开发者ID:rongandat,项目名称:ookcart-project,代码行数:11,代码来源:logout.php


示例13: strip_tags

for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
    $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}
if ($order->content_type != 'virtual') {
    $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}
$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (is_object(${$payment})) {
    $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
    $payment_class = ${$payment};
    $email_order .= $payment_class->title . "\n\n";
    if ($payment_class->email_footer) {
        $email_order .= $payment_class->email_footer . "\n\n";
    }
}
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
// load the after_process function from the payment modules
$payment_modules->after_process();
$cart->reset(true);
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
require DIR_WS_INCLUDES . 'application_bottom.php';
开发者ID:jobw0110,项目名称:lascolinasobgyn,代码行数:31,代码来源:checkout_process.php


示例14: tep_session_register

                    $reset_shipping = true;
                }
            }
        } else {
            tep_session_register('sendto');
        }
        $sendto = $HTTP_POST_VARS['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') {
            if ($reset_shipping == true) {
                tep_session_unregister('shipping');
            }
            tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
        } else {
            tep_session_unregister('sendto');
        }
    } else {
        if (!tep_session_is_registered('sendto')) {
            tep_session_register('sendto');
        }
        $sendto = $customer_default_address_id;
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
}
// if no shipping destination address was selected, use their own address as default
if (!tep_session_is_registered('sendto')) {
    $sendto = $customer_default_address_id;
}
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
开发者ID:laiello,项目名称:hotel-os,代码行数:31,代码来源:checkout_shipping_address.php


示例15: tep_session_unregister

                }
                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_PAYMENT, '', 'SSL'));
                    }
                }
            } else {
                tep_session_unregister('shipping');
            }
        }
    } else {
        if (defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') {
            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();
// 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();
}
开发者ID:skarred,项目名称:Responsive-osCommerce,代码行数:31,代码来源:checkout_shipping.php


示例16: tep_session_register

                    $reset_payment = true;
                }
            }
        } else {
            tep_session_register('billto');
        }
        $billto = $HTTP_POST_VARS['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') {
            if ($reset_payment == true) {
                tep_session_unregister('payment');
            }
            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
        } else {
            tep_session_unregister('billto');
        }
        // no addresses to select from - customer decided to keep the current assigned address
    } else {
        if (!tep_session_is_registered('billto')) {
            tep_session_register('billto');
        }
        $billto = $customer_default_address_id;
        tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    }
}
// if no billing destination address was selected, use their own address as default
if (!tep_session_is_registered('billto')) {
    $billto = $customer_default_address_id;
}
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
开发者ID:wrtcoder,项目名称:mini_isp,代码行数:31,代码来源:checkout_payment_address.php


示例17: before_process


//.........这里部分代码省略.........
         }
     }
     tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID) . "', last_modified = now() where orders_id = '" . (int) $order_id . "'");
     $sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => SEND_EMAILS == 'true' ? '1' : '0', 'comments' => $order->info['comments']);
     tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
     // initialized for the email confirmation
     $products_ordered = '';
     $subtotal = 0;
     $total_tax = 0;
     for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         // Stock Update - Joao Correia
         if (STOCK_LIMITED == 'true') {
             if (DOWNLOAD_ENABLED == 'true') {
                 $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename\n                                FROM " . TABLE_PRODUCTS . " p\n                                LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                ON p.products_id=pa.products_id\n                                LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                ON pa.products_attributes_id=pad.products_attributes_id\n                                WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
                 // Will work with only one option for downloadable products
                 // otherwise, we have to build the query dynamically with a loop
                 $products_attributes = $order->products[$i]['attributes'];
                 if (is_array($products_attributes)) {
                     $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
                 }
                 $stock_query = tep_db_query($stock_query_raw);
             } else {
                 $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
             }
             if (tep_db_num_rows($stock_query) > 0) {
                 $stock_values = tep_db_fetch_array($stock_query);
                 // do not decrement quantities if products_attributes_filename exists
                 if (DOWNLOAD_ENABLED != 'true' || !$stock_values['products_attributes_filename']) {
                     $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
                 } else {
                     $stock_left = $stock_values['products_quantity'];
                 }
                 tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
                 if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false') {
                     tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
                 }
             }
         }
         // Update products_ordered (for bestsellers list)
         tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
         //------insert customer choosen option to order--------
         $attributes_exist = '0';
         $products_ordered_attributes = '';
         if (isset($order->products[$i]['attributes'])) {
             $attributes_exist = '1';
             for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
                 if (DOWNLOAD_ENABLED == 'true') {
                     $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\n                                   from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                   left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                   on pa.products_attributes_id=pad.products_attributes_id\n                                   where pa.products_id = '" . $order->products[$i]['id'] . "'\n                                   and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                   and pa.options_id = popt.products_options_id\n                                   and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                   and pa.options_values_id = poval.products_options_values_id\n                                   and popt.language_id = '" . $languages_id . "'\n                                   and poval.language_id = '" . $languages_id . "'";
                     $attributes = tep_db_query($attributes_query);
                 } else {
                     $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
                 }
                 $attributes_values = tep_db_fetch_array($attributes);
                 $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
             }
         }
         //------insert customer choosen option eof ----
         $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
         $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
         $total_cost += $total_products_price;
         $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
     }
     // lets start with the email confirmation
     $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
     if ($order->info['comments']) {
         $email_order .= tep_db_output($order->info['comments']) . "\n\n";
     }
     $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n";
     for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
         $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
     }
     if ($order->content_type != 'virtual') {
         $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
     }
     $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
     if (is_object(${$payment})) {
         $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n";
         $payment_class = ${$payment};
         $email_order .= $payment_class->title . "\n\n";
         if ($payment_class->email_footer) {
             $email_order .= $payment_class->email_footer . "\n\n";
         }
     }
     tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     // send emails to other people
     if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
         tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     }
     // load the after_process function from the payment modules
     $this->after_process();
     $cart->reset(true);
     // unregister session variables used during checkout
     tep_session_unregister('sendto');
     tep_session_unregister('billto');
     tep_session_unregister('shipping');
     tep_session_unregister('payment');
     tep_session_unregister('comments');
     tep_session_unregister('cart_PayPal_Standard_ID');
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
 }
开发者ID:laiello,项目名称:myopensources,代码行数:101,代码来源:paypal_standard.php


示例18: apply_credit

 function apply_credit()
 {
     global $insert_id, $customer_id, $REMOTE_ADDR, $cc_id;
     //$cc_id = $_SESSION['cc_id']; //Fred commented out, do not use $_SESSION[] due to backward comp. Reference the global var instead.
     if ($this->deduction != 0) {
         tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, redeem_date, redeem_ip, customer_id, order_id) values ('" . $cc_id . "', now(), '" . $REMOTE_ADDR . "', '" . $customer_id . "', '" . $insert_id . "')");
     }
     tep_session_unregister('cc_id');
 }
开发者ID:eosc,项目名称:EosC-2.3,代码行数:9,代码来源:ot_coupon.php


示例19: elseif

                        $error = true;
                        $messageStack->add('header', ENTRY_REVIEW_EMAIL_ERROR);
                    } elseif (REVIEW_TEXT_MIN_LENGTH > 0 && mb_strlen($review_text, 'CP1251') < REVIEW_TEXT_MIN_LENGTH) {
                        $error = true;
                        $messageStack->add('header', ENTRY_REVIEW_TEXT_ERROR);
                    } elseif (tep_validate_email($customers_email) == false) {
                        $error = true;
                        $messageStack->add('header', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
                    } else {
                        $reviews_status = 1;
                        tep_db_query("insert into " . TABLE_REVIEWS . " (reviews_types_id, products_id, customers_id, reviews_vote, customers_name, customers_email, reviews_text, date_added, reviews_ip, reviews_agent, shops_id, reviews_status) values ('1', '" . (int) $HTTP_GET_VARS['products_id'] . "', '" . (int) $customers_id . "', '" . (int) $review_rating . "', '" . tep_db_input($customers_name) . "', '" . tep_db_input($customers_email) . "', '" . tep_db_input($review_text) . "', now(), '" . tep_db_input($remote_addr) . "', '" . tep_db_input(tep_db_prepare_input($_SERVER['HTTP_USER_AGENT'])) . "', '" . (int) SHOP_ID . "', '" . (int) $reviews_status . "')");
                        if ($reviews_status > 0) {
                            tep_db_query("update " . TABLE_PRODUCTS . " set products_rating = (select sum(reviews_vote)/count(*) from " . TABLE_REVIEWS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and reviews_status = '1') where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'");
                        }
                        $messageStack->add_session('header', TEXT_REVIEW_SUCCESS_ADDED, 'success');
                        tep_session_unregister('captcha_value');
                    }
                }
            }
            if (!$error) {
                tep_redirect(PHP_SELF);
            }
            break;
    }
}
if (!tep_session_is_registered('customer_id') && isset($_COOKIE['remember_customer'])) {
    list($cookie_customer_password, $cookie_customer_id) = explode('||', $_COOKIE['remember_customer']);
    $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, customers_type from " . TABLE_CUSTOMERS . " where customers_password = '" . tep_db_input(tep_db_prepare_input($cookie_customer_password)) . "' and customers_id = '" . (int) $cookie_customer_id . "'");
    if (tep_db_num_rows($check_customer_query) > 0) {
        $check_customer = tep_db_fetch_array($check_customer_query);
        $check_country_query = tep_db_query("(select address_book_id, entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id = '" . (int) $check_customer['customers_default_address_id'] . "' and entry_country_id in (select countries_id from " . TABLE_COUNTRIES . ")) union (select address_book_id, entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $check_customer['customers_id'] . "' and address_book_id <> '" . (int) $check_customer['customers_default_address_id'] . "' and entry_country_id in (select countries_id from " . TABLE_COUNTRIES . ") order by address_book_id desc) order by '" . (int) $check_customer['customers_default_address_id'] . "'");
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:31,代码来源:application_top.php


示例20: Copyright


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tep_set_time_limit函数代码示例发布时间:2022-05-23
下一篇:
PHP tep_session_start函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap