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

PHP zen_get_customer_validate_session函数代码示例

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

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



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

示例1: zen_redirect

 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 4793 2006-10-20 05:25:20Z ajeh $
 */
// This should be first line of the script:
$zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_PAYMENT_ADDRESS');
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
// if the customer is not logged on, redirect them to the login page
if (!$_SESSION['customer_id']) {
    $_SESSION['navigation']->set_snapshot();
    zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
} else {
    // validate customer
    if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
        $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_SHIPPING));
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
}
require DIR_WS_MODULES . zen_get_module_directory('require_languages.php');
$addressType = "billto";
require DIR_WS_MODULES . zen_get_module_directory('checkout_new_address');
// if no billing destination address was selected, use their own address as default
if (!$_SESSION['billto']) {
    $_SESSION['billto'] = $_SESSION['customer_default_address_id'];
}
$breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2);
$addresses_count = zen_count_customer_address_book_entries();
// This should be last line of the script:
开发者ID:ygeneration666,项目名称:ec,代码行数:31,代码来源:header_php.php


示例2: strtotime

<script type="text/javascript" src="<?php 
echo DIR_WS_INCLUDES;
?>
templates/blackcool/login/register_or_login_html.js?<?php 
echo strtotime(date('Y-m'));
?>
" ></script>

<script type="text/javascript">
<?php 
if ((!isset($_SESSION['customer_id']) || !zen_get_customer_validate_session($_SESSION['customer_id'])) && $_REQUEST['main_page'] == 'checkout') {
    ?>
	
                $(document).ready(function(){
                        checkout_L_to_R(2);
                });
<?php 
}
if (isset($_SESSION['customer_id']) && $_SESSION['address_exist_status'] == 0 && !$_SESSION['sendto'] && $_REQUEST['main_page'] == 'checkout') {
    ?>
                $(document).ready(function(){
                        enroll_address();
                });
<?php 
}
?>
 
</script>


<div style="clear:both;"></div>
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:tpl_footer.php


示例3: prepareConfirmation

 public function prepareConfirmation()
 {
     global $messageStack, $template, $breadcrumb, $template_dir_select, $template_dir, $language_page_directory, $currencies, $order, $zco_notifier, $db, $current_page_base, $order_total_modules, $credit_covers;
     // error_reporting(E_ALL);
     // ini_set('display_errors', 'on');
     $_GET['main_page'] = $current_page_base = $current_page = FILENAME_CHECKOUT_CONFIRMATION;
     if ($_SESSION['cart']->count_contents() <= 0) {
         zen_redirect(zen_href_link(FILENAME_TIME_OUT));
     }
     if (!$_SESSION['customer_id']) {
         $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
         zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
     } else {
         // validate customer
         if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
             $_SESSION['navigation']->set_snapshot();
             zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
         }
     }
     // avoid hack attempts during the checkout procedure by checking the internal cartID
     if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) {
         if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
             zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
         }
     }
     // if no shipping method has been selected, redirect the customer to the shipping method selection page
     if (!isset($_SESSION['shipping'])) {
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
     }
     if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free' && $_SESSION['cart']->get_content_type() != 'virtual' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER') && $_SESSION['cart']->show_total() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
     }
     if (isset($_POST['payment'])) {
         $_SESSION['payment'] = $_POST['payment'];
     }
     $_SESSION['comments'] = $_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');
         }
     }
     // echo $messageStack->size('checkout_payment');
     // load the selected payment module
     require DIR_WS_CLASSES . 'payment.php';
     $payment_modules = new payment($_POST['payment']);
     $payment_modules->update_status();
     if (($_POST['payment'] == '' || !is_object($payment_modules->paymentClass)) && $credit_covers === FALSE) {
         $messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error');
     }
     $GLOBALS[$_POST['payment']] = $payment_modules->paymentClass;
     require DIR_WS_CLASSES . 'order.php';
     $order = new order();
     // load the selected shipping module
     require DIR_WS_CLASSES . 'shipping.php';
     $shipping_modules = new shipping($_SESSION['shipping']);
     require DIR_WS_CLASSES . 'order_total.php';
     $order_total_modules = new order_total();
     $order_total_modules->collect_posts();
     $order_total_modules->pre_confirmation_check();
     if (!isset($credit_covers)) {
         $credit_covers = FALSE;
     }
     // echo 'credit covers'.$credit_covers;
     if ($credit_covers) {
         unset($_SESSION['payment']);
         $_SESSION['payment'] = '';
     }
     // @debug echo ($credit_covers == true) ? 'TRUE' : 'FALSE';
     if (is_array($payment_modules->modules)) {
         $payment_modules->pre_confirmation_check();
     }
     if ($messageStack->size('checkout_payment') > 0) {
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
     }
     // Stock Check
     $flagAnyOutOfStock = false;
     $stock_check = array();
     if (STOCK_CHECK == 'true') {
         for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
             if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
                 $flagAnyOutOfStock = true;
             }
         }
         // Out of Stock
         if (STOCK_ALLOW_CHECKOUT != 'true' && $flagAnyOutOfStock == true) {
             zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
         }
     }
     // update customers_referral with $_SESSION['gv_id']
     if ($_SESSION['cc_id']) {
         $discount_coupon_query = "SELECT coupon_code\n                            FROM " . TABLE_COUPONS . "\n                            WHERE coupon_id = :couponID";
         $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer');
         $discount_coupon = $db->Execute($discount_coupon_query);
         $customers_referral_query = "SELECT customers_referral\n                               FROM " . TABLE_CUSTOMERS . "\n                               WHERE customers_id = :customersID";
         $customers_referral_query = $db->bindVars($customers_referral_query, ':customersID', $_SESSION['customer_id'], 'integer');
         $customers_referral = $db->Execute($customers_referral_query);
         // only use discount coupon if set by coupon
         if ($customers_referral->fields['customers_referral'] == '' and CUSTOMERS_REFERRAL_STATUS == 1) {
             $sql = "UPDATE " . TABLE_CUSTOMERS . "\n            SET customers_referral = :customersReferral\n            WHERE customers_id = :customersID";
             $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
//.........这里部分代码省略.........
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:101,代码来源:zcAjaxPayment.php


示例4: pwas_notify_checkout_start_confirmation

function pwas_notify_checkout_start_confirmation()
{
    global $messageStack;
    global $credit_covers;
    // if there is nothing in the customers cart, redirect them to the shopping cart page
    if ($_SESSION['cart']->count_contents() <= 0) {
        zen_redirect(zen_href_link(FILENAME_TIME_OUT));
    }
    // if the customer is not logged on, redirect them to the login page
    if (!$_SESSION['customer_id']) {
        $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    } else {
        // validate customer
        if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
            $_SESSION['navigation']->set_snapshot();
            zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
        }
    }
    // avoid hack attempts during the checkout procedure by checking the internal cartID
    if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) {
        if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
            zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
        }
    }
    // if no shipping method has been selected, redirect the customer to the shipping method selection page
    if (!$_SESSION['shipping']) {
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
    if (isset($_POST['payment'])) {
        $_SESSION['payment'] = $_POST['payment'];
    }
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
    //'checkout_payment_discounts'
    //zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
    if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
        if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
            $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
        }
    }
    //echo $messageStack->size('checkout_payment');
    require DIR_FS_CATALOG_ADDON_MODULES . 'products_with_attributes_stock/classes/order.php';
    $order = new pwas_order();
    // Stock Check
    $any_out_of_stock = false;
    if (STOCK_CHECK == 'true') {
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
            if (zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_sendfor_status', array($products[$i]['id'])) != '') {
                continue;
            }
            $order->products[$i]['stock_check'] = '';
            // Added to allow individual stock of different attributes
            unset($attributes);
            if (is_array($order->products[$i]['attributes'])) {
                $attributes = $order->products[$i]['attributes'];
            } else {
                $attributes = '';
            }
            // End change
            $stock_check = pwas_check_stock($order->products[$i]['id'], $order->products[$i]['qty'], $attributes);
            if (zen_not_null($stock_check)) {
                $any_out_of_stock = true;
                $order->products[$i]['stock_check'] = $stock_check;
            }
        }
    }
    // Out of Stock
    if (STOCK_ALLOW_CHECKOUT != 'true' && $any_out_of_stock == true) {
        zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
    }
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:71,代码来源:functions.php



注:本文中的zen_get_customer_validate_session函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP zen_get_discount_calc函数代码示例发布时间:2022-05-23
下一篇:
PHP zen_get_country_name函数代码示例发布时间: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