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

PHP fn_cart_is_empty函数代码示例

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

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



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

示例1: ls_get_fav_data

function ls_get_fav_data()
{
    //wishlist products footer carousel
    $_SESSION['wishlist'] = isset($_SESSION['wishlist']) ? $_SESSION['wishlist'] : array();
    $wishlist =& $_SESSION['wishlist'];
    $_SESSION['continue_url'] = fn_ls_get_base_url();
    $auth =& $_SESSION['auth'];
    //view products
    $products_footer = !empty($wishlist['products']) ? $wishlist['products'] : array();
    $extra_products = array();
    $wishlist_is_empty = fn_cart_is_empty($wishlist);
    if (!empty($products_footer)) {
        foreach ($products_footer as $k => $v) {
            $_options = array();
            $extra = $v['extra'];
            if (!empty($v['product_options'])) {
                $_options = $v['product_options'];
            }
            $products_footer[$k] = fn_get_product_data($v['product_id'], $auth, CART_LANGUAGE, '', true, true, true, false, false, true, false, true);
            if (empty($products_footer[$k])) {
                unset($products_footer[$k], $wishlist['products'][$k]);
                continue;
            }
            $products_footer[$k]['extra'] = empty($products_footer[$k]['extra']) ? array() : $products_footer[$k]['extra'];
            $products_footer[$k]['extra'] = array_merge($products_footer[$k]['extra'], $extra);
            if (isset($products_footer[$k]['extra']['product_options']) || $_options) {
                $products_footer[$k]['selected_options'] = empty($products_footer[$k]['extra']['product_options']) ? $_options : $products_footer[$k]['extra']['product_options'];
            }
            if (!empty($products_footer[$k]['selected_options'])) {
                $options = fn_get_selected_product_options($v['product_id'], $v['product_options'], CART_LANGUAGE);
                foreach ($products_footer[$k]['selected_options'] as $option_id => $variant_id) {
                    foreach ($options as $option) {
                        if ($option['option_id'] == $option_id && !in_array($option['option_type'], array('I', 'T', 'F')) && empty($variant_id)) {
                            $products_footer[$k]['changed_option'] = $option_id;
                            break 2;
                        }
                    }
                }
            }
            $products_footer[$k]['display_subtotal'] = $products_footer[$k]['price'] * $v['amount'];
            $products_footer[$k]['display_amount'] = $v['amount'];
            $products_footer[$k]['cart_id'] = $k;
            if (!empty($products_footer[$k]['extra']['parent'])) {
                $extra_products[$k] = $products_footer[$k];
                unset($products_footer[$k]);
                continue;
            }
        }
    }
    fn_gather_additional_products_data($products_footer, array('get_icon' => true, 'get_detailed' => true, 'get_options' => true, 'get_discounts' => true));
    return $products_footer;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:52,代码来源:index.php


示例2: array

        $company_id = Registry::get('runtime.company_id');
        if (!empty($gift_cert_code)) {
            if (true == fn_check_gift_certificate_code($gift_cert_code, true, $company_id)) {
                $_SESSION['promotion_notices']['gift_certificates'] = array('applied' => true, 'messages' => array());
                if (!isset($_SESSION['cart']['use_gift_certificates'][$gift_cert_code])) {
                    $_SESSION['cart']['use_gift_certificates'][$gift_cert_code] = 'Y';
                    $_SESSION['cart']['pending_certificates'][] = $gift_cert_code;
                    $_SESSION['promotion_notices']['gift_certificates']['messages'][] = 'text_gift_cert_applied';
                    if (isset($cart['pending_coupon'])) {
                        unset($cart['pending_coupon']);
                    }
                } else {
                    $_SESSION['promotion_notices']['gift_certificates']['messages'][] = 'certificate_already_used';
                }
            } else {
                $_SESSION['promotion_notices']['gift_certificates'] = array('applied' => false, 'messages' => array());
                $status = db_get_field("SELECT status FROM ?:gift_certificates WHERE gift_cert_code = ?s ?p", $gift_cert_code, fn_get_gift_certificate_company_condition('?:gift_certificates.company_id'));
                $_SESSION['promotion_notices']['gift_certificates']['messages'][] = 'no_such_coupon';
            }
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'checkout.' . (!empty($_REQUEST['redirect_mode']) ? $_REQUEST['redirect_mode'] : 'cart'));
    }
    if ($mode == 'delete_use_certificate' && !empty($gift_cert_code)) {
        fn_delete_gift_certificate_in_use($gift_cert_code, $_SESSION['cart']);
        if (fn_cart_is_empty($_SESSION['cart']) && defined('AJAX_REQUEST')) {
            Tygh::$app['ajax']->assign('force_redirection', fn_url('checkout.cart'));
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'checkout.' . (!empty($_REQUEST['redirect_mode']) ? $_REQUEST['redirect_mode'] : 'checkout') . '.show_payment_options');
    }
    return;
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:checkout.post.php


示例3: fn_add_breadcrumb

    fn_add_breadcrumb(__('landing_header'));
} elseif ($mode == 'process_payment') {
    if (fn_allow_place_order($cart, $auth) == true) {
        $order_info = $cart;
        $order_info['products'] = $cart['products'];
        $order_info = fn_array_merge($order_info, $cart['user_data']);
        $order_info['order_id'] = $order_id = TIME . "_" . (!empty($auth['user_id']) ? $auth['user_id'] : 0);
        unset($order_info['user_data']);
        list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id']);
        if ($is_processor_script) {
            set_time_limit(300);
            fn_define('IFRAME_MODE', true);
            include Registry::get('config.dir.payments') . $processor_data['processor_script'];
            fn_finish_payment($order_id, $pp_response, array());
            fn_order_placement_routines('route', $order_id);
        }
    }
}
if (fn_cart_is_empty($cart) && !isset($force_redirection) && !in_array($mode, array('clear', 'delete', 'cart', 'update', 'apply_coupon', 'shipping_estimation', 'update_shipping', 'complete'))) {
    fn_set_notification('W', __('cart_is_empty'), __('cannot_proccess_checkout', 'K', 'cannot_proccess_checkout'));
    return array(CONTROLLER_STATUS_REDIRECT, 'checkout.cart');
}
if (!empty($profile_fields)) {
    Tygh::$app['view']->assign('profile_fields', $profile_fields);
}
Tygh::$app['view']->assign('cart', $cart);
Tygh::$app['view']->assign('continue_url', empty($_SESSION['continue_url']) ? '' : $_SESSION['continue_url']);
Tygh::$app['view']->assign('mode', $mode);
Tygh::$app['view']->assign('payment_methods', $payment_methods);
// Remember mode for the check shipping rates
$_SESSION['checkout_mode'] = $mode;
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:checkout.php


示例4: array

        $company_id = Registry::get('runtime.company_id');
        if (!empty($gift_cert_code)) {
            if (true == fn_check_gift_certificate_code($gift_cert_code, true, $company_id)) {
                Tygh::$app['session']['promotion_notices']['gift_certificates'] = array('applied' => true, 'messages' => array());
                if (!isset(Tygh::$app['session']['cart']['use_gift_certificates'][$gift_cert_code])) {
                    Tygh::$app['session']['cart']['use_gift_certificates'][$gift_cert_code] = 'Y';
                    Tygh::$app['session']['cart']['pending_certificates'][] = $gift_cert_code;
                    Tygh::$app['session']['promotion_notices']['gift_certificates']['messages'][] = 'text_gift_cert_applied';
                    if (isset($cart['pending_coupon'])) {
                        unset($cart['pending_coupon']);
                    }
                } else {
                    Tygh::$app['session']['promotion_notices']['gift_certificates']['messages'][] = 'certificate_already_used';
                }
            } else {
                Tygh::$app['session']['promotion_notices']['gift_certificates'] = array('applied' => false, 'messages' => array());
                $status = db_get_field("SELECT status FROM ?:gift_certificates WHERE gift_cert_code = ?s ?p", $gift_cert_code, fn_get_gift_certificate_company_condition('?:gift_certificates.company_id'));
                Tygh::$app['session']['promotion_notices']['gift_certificates']['messages'][] = 'no_such_coupon';
            }
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'checkout.' . (!empty($_REQUEST['redirect_mode']) ? $_REQUEST['redirect_mode'] : 'cart'));
    }
    if ($mode == 'delete_use_certificate' && !empty($gift_cert_code)) {
        fn_delete_gift_certificate_in_use($gift_cert_code, Tygh::$app['session']['cart']);
        if (fn_cart_is_empty(Tygh::$app['session']['cart']) && defined('AJAX_REQUEST')) {
            Tygh::$app['ajax']->assign('force_redirection', fn_url('checkout.cart'));
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'checkout.' . (!empty($_REQUEST['redirect_mode']) ? $_REQUEST['redirect_mode'] : 'checkout') . '.show_payment_options');
    }
    return;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:checkout.post.php


示例5: fn_save_cart_content

            }
            fn_save_cart_content($_SESSION['cart'], $auth['user_id'], $_REQUEST['type']);
        }
    }
    if ($mode == 'preview') {
        if (!empty($_REQUEST['gift_cert_data'])) {
            fn_correct_gift_certificate($_REQUEST['gift_cert_data']);
            fn_show_postal_card($_REQUEST['gift_cert_data']);
            exit;
        }
    }
    if ($mode == 'delete') {
        if (isset($_REQUEST['gift_cert_id'])) {
            $cart =& $_SESSION['cart'];
            fn_delete_cart_gift_certificate($cart, $_REQUEST['gift_cert_id']);
            if (fn_cart_is_empty($cart) == true) {
                fn_clear_cart($cart);
            }
            fn_save_cart_content($cart, $auth['user_id']);
            $cart['recalculate'] = true;
            fn_calculate_cart_content($cart, $auth, 'A', true, 'F', true);
            return array(CONTROLLER_STATUS_REDIRECT);
        }
    }
    return array(CONTROLLER_STATUS_OK, 'checkout.cart');
}
if ($mode == 'verify') {
    fn_add_breadcrumb(__('gift_certificate_verification'));
    $verify_id = db_get_field("SELECT gift_cert_id FROM ?:gift_certificates WHERE gift_cert_code = ?s ?p", $_REQUEST['verify_code'], fn_get_gift_certificate_company_condition('?:gift_certificates.company_id'));
    if (!empty($verify_id)) {
        Registry::set('navigation.tabs', array('detailed' => array('title' => __('detailed_info'), 'js' => true), 'log' => array('title' => __('history'), 'js' => true)));
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:gift_certificates.php


示例6: count

    $view->assign('test_ses', $test_ses);
    $result = $_SESSION['wishlist'];
    $wishlistest = count($result['products']);
    $view->assign('wishlistest', $wishlistest);
} else {
    $view->assign('wishlistest', 0);
}
//wishlist products footer carousel
$_SESSION['wishlist'] = isset($_SESSION['wishlist']) ? $_SESSION['wishlist'] : array();
$wishlist =& $_SESSION['wishlist'];
$_SESSION['continue_url'] = isset($_SESSION['continue_url']) ? $_SESSION['continue_url'] : '';
$auth =& $_SESSION['auth'];
//view products
$products_footer = !empty($wishlist['products']) ? $wishlist['products'] : array();
$extra_products = array();
$wishlist_is_empty = fn_cart_is_empty($wishlist);
if (!empty($products_footer)) {
    foreach ($products_footer as $k => $v) {
        $_options = array();
        $extra = $v['extra'];
        if (!empty($v['product_options'])) {
            $_options = $v['product_options'];
        }
        $products_footer[$k] = fn_get_product_data($v['product_id'], $auth, CART_LANGUAGE, '', true, true, true, false, false, true, false, true);
        if (empty($products_footer[$k])) {
            unset($products_footer[$k], $wishlist['products'][$k]);
            continue;
        }
        $products_footer[$k]['extra'] = empty($products_footer[$k]['extra']) ? array() : $products_footer[$k]['extra'];
        $products_footer[$k]['extra'] = array_merge($products_footer[$k]['extra'], $extra);
        if (isset($products_footer[$k]['extra']['product_options']) || $_options) {
开发者ID:OneataBogdan,项目名称:coriolan_backup,代码行数:31,代码来源:checkout.php


示例7: die

use Tygh\BlockManager\Layout;
use Tygh\BlockManager\SchemesManager;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
/**
 * Act on behalf functionality
 */
if (!empty($_REQUEST['skey'])) {
    $session_data = fn_get_storage_data('session_' . $_REQUEST['skey'] . '_data');
    fn_set_storage_data('session_' . $_REQUEST['skey'] . '_data', '');
    if (!empty($session_data)) {
        Tygh::$app['session']->start();
        Tygh::$app['session']->fromArray(unserialize($session_data));
        Tygh::$app['session']->save(Tygh::$app['session']->getID(), Tygh::$app['session']->toArray());
        if (!fn_cart_is_empty(Tygh::$app['session']['cart'])) {
            fn_calculate_cart_content(Tygh::$app['session']['cart'], Tygh::$app['session']['auth'], 'S', true, 'F', true);
            fn_save_cart_content(Tygh::$app['session']['cart'], Tygh::$app['session']['auth']['user_id']);
        }
    }
    return array(CONTROLLER_STATUS_REDIRECT, fn_query_remove(REAL_URL, 'skey'));
}
// UK Cookies Law
if (Registry::get('settings.Security.uk_cookies_law') == 'Y') {
    if (!empty($_REQUEST['cookies_accepted']) && $_REQUEST['cookies_accepted'] == 'Y') {
        Tygh::$app['session']['cookies_accepted'] = true;
    }
    if (!defined('AJAX_REQUEST') && empty(Tygh::$app['session']['cookies_accepted'])) {
        $url = fn_link_attach(Registry::get('config.current_url'), 'cookies_accepted=Y');
        $url = str_replace('&', '&', $url);
        $text = __('uk_cookies_law', array('[url]' => $url));
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:init.php


示例8: fn_finish_payment

            break;
        }
    }
    // If order was placed successfully, associate the order with this customer
    if (!empty($order_id)) {
        $auth['order_ids'][] = $order_id;
        $pp_response['order_status'] = 'P';
        fn_finish_payment($order_id, $pp_response);
    } else {
        $pp_response['order_status'] = 'F';
        $pp_response['reason_text'] = __('text_amazon_failed_order');
        fn_finish_payment($order_id, $pp_response);
    }
    fn_order_placement_routines('route', $order_id, false);
    exit;
} elseif (!empty($_payment_id) && !fn_cart_is_empty($cart)) {
    $base_domain = 'https://' . ($processor_data['processor_params']['test'] != 'Y' ? 'payments.amazon.com' : 'payments-sandbox.amazon.com');
    $merchant_id = $processor_data['processor_params']['merchant_id'];
    $_currency = $processor_data['processor_params']['currency'];
    $amazon_products = $cart['products'];
    fn_set_hook('amazon_products', $amazon_products, $cart);
    // Get cart items
    $amazon_order = array();
    foreach ($amazon_products as $key => $product) {
        // Get product options
        $item_options = ' ';
        if (!empty($product['product_options'])) {
            $_options = fn_get_selected_product_options_info($cart['products'][$key]['product_options']);
            foreach ($_options as $opt) {
                $item_options .= $opt['option_name'] . ': ' . $opt['variant_name'] . '; ';
            }
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:amazon_checkout.php


示例9: fn_twg_api_get_session_cart

     Registry::set('runtime.controller', 'twigmo');
     $result = fn_twg_api_get_session_cart($_SESSION['cart'], $lang_code);
     $response->setData($result);
     if (!empty($ids)) {
         $ids = array_keys($ids);
     }
     $response->setMeta(!empty($ids) ? array_pop($ids) : 0, 'added_id');
 } elseif ($meta['action'] == 'delete_from_cart') {
     // delete from cart
     $data = fn_twg_get_api_data($response, $format);
     $cart =& $_SESSION['cart'];
     $auth =& $_SESSION['auth'];
     foreach ($data as $cart_id) {
         fn_delete_cart_product($cart, $cart_id . '');
     }
     if (fn_cart_is_empty($cart)) {
         fn_clear_cart($cart);
     }
     fn_save_cart_content($cart, $auth['user_id']);
     $cart['recalculate'] = true;
     Registry::set('runtime.controller', 'checkout', true);
     fn_calculate_cart_content($cart, $auth, 'S', true, 'F', true);
     Registry::set('runtime.controller', 'twigmo');
     $result = fn_twg_api_get_session_cart($cart, $lang_code);
     $response->setData($result);
 } elseif ($meta['action'] == 'update_cart_amount') {
     $cart =& $_SESSION['cart'];
     $auth =& $_SESSION['auth'];
     $cart_id = $_REQUEST['cart_id'] . '';
     if (empty($cart['products'][$cart_id])) {
         return;
开发者ID:arpad9,项目名称:bygmarket,代码行数:31,代码来源:twigmo.php


示例10: fn_checkout_summary

function fn_checkout_summary(&$cart)
{
    if (fn_cart_is_empty($cart) == true) {
        return false;
    }
    fn_set_hook('checkout_summary', $cart);
    //Get payment methods
    $payment_data = fn_get_payment_method_data($cart['payment_id']);
    Registry::get('view')->assign('payment_method', $payment_data);
    // Downlodable files agreements
    $agreements = array();
    if (!empty($cart['products'])) {
        foreach ($cart['products'] as $item) {
            if ($item['is_edp'] == 'Y') {
                if ($_agreement = fn_get_edp_agreements($item['product_id'], true)) {
                    $agreements[$item['product_id']] = $_agreement;
                }
            }
        }
    }
    if (!empty($agreements)) {
        Registry::get('view')->assign('cart_agreements', $agreements);
    }
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:24,代码来源:fn.cart.php


示例11: die

****************************************************************************/
//
// $Id: google_checkout.php 10329 2010-08-03 14:46:04Z klerik $
//
if (!defined('AREA')) {
    die('Access denied');
}
$index_script = Registry::get('customer_index');
if (defined('PAYMENT_NOTIFICATION')) {
    if (!empty($_SESSION['order_id'])) {
        fn_order_placement_routines($_SESSION['order_id']);
    } else {
        fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('order_was_not_placed'));
        fn_redirect(Registry::get('config.http_location') . "/{$index_script}?dispatch=checkout.cart");
    }
} elseif (!empty($_payment_id) && !fn_cart_is_empty($cart) && $processor_data['params']['policy_agreement'] == 'Y') {
    $return_url = Registry::get('config.current_location') . "/{$index_script}?dispatch=payment_notification.notify&payment=google_checkout&" . SESS_NAME . '=' . Session::get_id();
    $edit_cart_url = Registry::get('config.current_location') . "/{$index_script}?dispatch=checkout.cart";
    $calculation_url = ($processor_data["params"]["test"] == 'N' ? Registry::get('config.https_location') : Registry::get('config.current_location')) . "/payments/google_calculations.php";
    $_currency = $processor_data['params']['currency'];
    $base_domain = 'https://' . ($processor_data['params']['test'] == 'N' ? 'checkout.google.com' : 'sandbox.google.com/checkout');
    $base_url = $base_domain . '/cws/v2/Merchant/' . $processor_data['params']['merchant_id'];
    $checkout_url = $base_url . '/checkout';
    $request_url = $base_url . '/request';
    // Form XML array with cart items
    $_items = '';
    $taxes = '';
    $google_products = $cart_products;
    fn_set_hook('google_products', $google_products, $cart);
    if (!empty($google_products) && is_array($google_products)) {
        foreach ($google_products as $k => $v) {
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:google_checkout.php


示例12: fn_place_order

/**
 * Order placing function
 *
 * @param array $cart
 * @param array $auth
 * @param string $action
 * @return int order_id or bool FALSE
 */
function fn_place_order(&$cart, &$auth, $action = '', $parent_order_id = 0)
{
    $allow = true;
    fn_set_hook('pre_place_order', $cart, $allow);
    if ($allow == true && !fn_cart_is_empty($cart)) {
        $ip = fn_get_ip();
        $__order_status = STATUS_INCOMPLETED_ORDER;
        $order = fn_check_table_fields($cart, 'orders');
        $order = fn_array_merge($order, fn_check_table_fields($cart['user_data'], 'orders'));
        // filter hidden fields, which were hidden to checkout
        fn_filter_hidden_profile_fields($order, 'O');
        // If the contact information fields were disabled, fill the information from the billing/shipping
        Registry::get('settings.General.address_position') == 'billing_first' ? $address_zone = 'b' : ($address_zone = 's');
        if (!empty($order['firstname']) || !empty($order[$address_zone . '_firstname'])) {
            $order['firstname'] = empty($order['firstname']) && !empty($order[$address_zone . '_firstname']) ? $order[$address_zone . '_firstname'] : $order['firstname'];
        }
        if (!empty($order['lastname']) || !empty($order[$address_zone . '_lastname'])) {
            $order['lastname'] = empty($order['lastname']) && !empty($order[$address_zone . '_lastname']) ? $order[$address_zone . '_lastname'] : $order['lastname'];
        }
        if (!empty($order['phone']) || !empty($order[$address_zone . '_phone'])) {
            $order['phone'] = empty($order['phone']) && !empty($order[$address_zone . '_phone']) ? $order[$address_zone . '_phone'] : $order['phone'];
        }
        $order['user_id'] = $auth['user_id'];
        $order['timestamp'] = TIME;
        $order['lang_code'] = CART_LANGUAGE;
        $order['tax_exempt'] = $auth['tax_exempt'];
        $order['status'] = STATUS_INCOMPLETED_ORDER;
        // incomplete by default to increase inventory
        $order['ip_address'] = $ip['host'];
        $cart['companies'] = fn_get_products_companies($cart['products']);
        $order['is_parent_order'] = 'N';
        if (PRODUCT_TYPE == 'MULTIVENDOR') {
            $order['parent_order_id'] = $parent_order_id;
            if (count($cart['companies']) > 1) {
                $order['is_parent_order'] = 'Y';
                $__order_status = $order['status'] = STATUS_PARENT_ORDER;
            } else {
                $order['company_id'] = key($cart['companies']);
            }
        }
        $order['promotions'] = serialize(!empty($cart['promotions']) ? $cart['promotions'] : array());
        if (!empty($cart['promotions'])) {
            $order['promotion_ids'] = implode(', ', array_keys($cart['promotions']));
        }
        $order['shipping_ids'] = !empty($cart['shipping']) ? fn_create_set(array_keys($cart['shipping'])) : '';
        if (!empty($cart['payment_surcharge'])) {
            $cart['total'] += $cart['payment_surcharge'];
            $order['total'] = $cart['total'];
        }
        if (!empty($cart['payment_info'])) {
            $ccards = fn_get_static_data_section('C', true);
            if (!empty($cart['payment_info']['card']) && !empty($ccards[$cart['payment_info']['card']])) {
                // Check if cvv2 number required and unset it if not
                if ($ccards[$cart['payment_info']['card']]['param_2'] != 'Y') {
                    unset($cart['payment_info']['cvv2']);
                }
                // Check if start date exists and required and convert it to string
                if ($ccards[$cart['payment_info']['card']]['param_3'] != 'Y') {
                    unset($cart['payment_info']['start_year'], $cart['payment_info']['start_month']);
                }
                // Check if issue number required
                if ($ccards[$cart['payment_info']['card']]['param_4'] != 'Y') {
                    unset($cart['payment_info']['issue_number']);
                }
            }
        }
        // We're editing existing order
        if (!empty($order['order_id']) && $order['is_parent_order'] != 'Y') {
            $_tmp = db_get_row("SELECT status, ip_address, details, timestamp, lang_code FROM ?:orders WHERE order_id = ?i", $order['order_id']);
            $order['ip_address'] = $_tmp['ip_address'];
            // Leave original customers IP address
            $order['details'] = $_tmp['details'];
            // Leave order details
            $order['timestamp'] = $_tmp['timestamp'];
            // Leave the original date
            $order['lang_code'] = $_tmp['lang_code'];
            // Leave the original language
            if ($action == 'save') {
                $__order_status = $_tmp['status'];
                // Get the original order status
            }
            fn_change_order_status($order['order_id'], STATUS_INCOMPLETED_ORDER, $_tmp['status'], fn_get_notification_rules(array(), false));
            // incomplete the order to increase inventory amount.
            db_query("DELETE FROM ?:orders WHERE order_id = ?i", $order['order_id']);
            db_query("DELETE FROM ?:order_details WHERE order_id = ?i", $order['order_id']);
            db_query("DELETE FROM ?:profile_fields_data WHERE object_id = ?i AND object_type = 'O'", $order['order_id']);
            db_query("DELETE FROM ?:order_data WHERE order_id = ?i AND type IN ('T', 'C', 'P')", $order['order_id']);
            fn_set_hook('edit_place_order', $order['order_id']);
        }
        if (!empty($cart['rewrite_order_id'])) {
            $order['order_id'] = array_shift($cart['rewrite_order_id']);
        }
//.........这里部分代码省略.........
开发者ID:diedsmiling,项目名称:busenika,代码行数:101,代码来源:fn.cart.php


示例13: content_55d31213b82193_32213162

    function content_55d31213b82193_32213162($_smarty_tpl)
    {
        if (!is_callable('smarty_function_script')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('text_cart_empty', 'text_cart_empty'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            echo smarty_function_script(array('src' => "js/tygh/exceptions.js"), $_smarty_tpl);
            ?>

<script type="text/javascript">
$(document).ready(function(){
    ls_checkout_estimation();
});
</script>
<?php 
            if (!fn_cart_is_empty($_smarty_tpl->tpl_vars['cart']->value)) {
                ?>
    <?php 
                echo $_smarty_tpl->getSubTemplate("views/checkout/components/cart_content.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
                ?>

<?php 
            } else {
                ?>
    <p class="ty-no-items"><?php 
                echo $_smarty_tpl->__("text_cart_empty");
                ?>
</p>

    <div class="buttons-container wrap">
        <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/continue_shopping.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => fn_url($_smarty_tpl->tpl_vars['continue_url']->value), 'but_role' => "submit"), 0);
                ?>

    </div>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="views/checkout/cart.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "views/checkout/cart.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            echo smarty_function_script(array('src' => "js/tygh/exceptions.js"), $_smarty_tpl);
            ?>

<script type="text/javascript">
$(document).ready(function(){
    ls_checkout_estimation();
});
</script>
<?php 
            if (!fn_cart_is_empty($_smarty_tpl->tpl_vars['cart']->value)) {
                ?>
    <?php 
                echo $_smarty_tpl->getSubTemplate("views/checkout/components/cart_content.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
                ?>

<?php 
            } else {
                ?>
    <p class="ty-no-items"><?php 
                echo $_smarty_tpl->__("text_cart_empty");
                ?>
</p>

    <div class="buttons-container wrap">
        <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/continue_shopping.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => fn_url($_smarty_tpl->tpl_vars['continue_url']->value), 'but_role' => "submit"), 0);
                ?>

    </div>
<?php 
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:f4725b3baaf9484cedbd55113df7d871268c9465.tygh.cart.tpl.php


示例14: die

use Tygh\Development;
use Tygh\Registry;
use Tygh\Session;
use Tygh\BlockManager\Location;
use Tygh\BlockManager\Layout;
use Tygh\BlockManager\SchemesManager;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if (!empty($_REQUEST['skey'])) {
    $session_data = fn_get_storage_data('session_' . $_REQUEST['skey'] . '_data');
    fn_set_storage_data('session_' . $_REQUEST['skey'] . '_data', '');
    if (!empty($session_data)) {
        $_SESSION = unserialize($session_data);
        Session::save(Session::getId(), $_SESSION);
        if (!fn_cart_is_empty($_SESSION['cart'])) {
            fn_calculate_cart_content($_SESSION['cart'], $_SESSION['auth'], 'S', true, 'F', true);
            fn_save_cart_content($_SESSION['cart'], $_SESSION['auth']['user_id']);
        }
    }
    return array(CONTROLLER_STATUS_REDIRECT, fn_query_remove(REAL_URL, 'skey'));
}
// UK Cookies Law
if (Registry::get('settings.Security.uk_cookies_law') == 'Y') {
    if (!empty($_REQUEST['cookies_accepted']) && $_REQUEST['cookies_accepted'] == 'Y') {
        $_SESSION['cookies_accepted'] = true;
    }
    if (!defined('AJAX_REQUEST') && empty($_SESSION['cookies_accepted'])) {
        $url = fn_link_attach(Registry::get('config.current_url'), 'cookies_accepted=Y');
        $url = str_replace('&', '&amp;', $url);
        $text = __('uk_cookies_law', array('[url]' => $url));
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:init.php


示例15: __

            Registry::get('view')->assign('order_action', __('placing_order'));
            Registry::get('view')->display('views/orders/components/placing_order.tpl');
            fn_flush();
            if (empty($_REQUEST['skip_payment']) && $process_payment == true || !empty($_REQUEST['skip_payment']) && empty($auth['act_as_user'])) {
                $payment_info = !empty($cart['payment_info']) ? $cart['payment_info'] : array();
                fn_start_payment($order_id, array(), $payment_info);
            }
            fn_order_placement_routines('route', $order_id);
        } else {
            return array(CONTROLLER_STATUS_REDIRECT, "checkout.cart");
        }
    }
    return array(CONTROLLER_STATUS_OK, "onestepcheckout{$_suffix}");
}
$payment_methods = fn_prepare_checkout_payment_methods($cart, $auth);
if ((true == fn_cart_is_empty($cart) && !isset($force_redirection) || empty($payment_methods)) && !in_array($mode, array('clear', 'delete', 'cart', 'update', 'apply_coupon', 'shipping_estimation', 'update_shipping', 'complete'))) {
    if (empty($payment_methods)) {
        fn_set_notification('W', __('notice'), __('cannot_proccess_checkout_without_payment_methods'), 'K', 'no_payment_notification');
    } else {
        fn_set_notification('W', __('cart_is_empty'), __('cannot_proccess_checkout'));
    }
    $force_redirection = "checkout.cart";
    if (defined('AJAX_REQUEST')) {
        Registry::get('ajax')->assign('force_redirection', fn_url($force_redirection));
        exit;
    } else {
        return array(CONTROLLER_STATUS_REDIRECT, $force_redirection);
    }
}
if ($mode == 'checkout') {
    fn_add_breadcrumb(__('checkout'));
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:onestepcheckout.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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