当前位置: 首页>>代码示例>>PHP>>正文


PHP order::getUserCart方法代码示例

本文整理汇总了PHP中order::getUserCart方法的典型用法代码示例。如果您正苦于以下问题:PHP order::getUserCart方法的具体用法?PHP order::getUserCart怎么用?PHP order::getUserCart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在order的用法示例。


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

示例1: __construct

 function __construct($params = array(), $get_assoc = true, $get_attached = false)
 {
     global $db, $user;
     if (!empty($params['id']) || is_numeric($params)) {
         parent::__construct($params, $get_assoc, $get_attached);
         $prodtype = $this->product_type;
         $this->product = new $prodtype($this->product_id, false, true);
     } elseif (isset($params['product_id']) && isset($params['product_type'])) {
         // see if this is an existing item in the cart
         if (isset($params['orderid'])) {
             $order = new order($params['orderid']);
         } else {
             $order = order::getUserCart();
         }
         //adding lookup on price to acocomdate quantity discounts
         $where = 'orders_id=' . $order->id . ' AND product_id=' . $params['product_id'] . ' AND products_price=' . $params['products_price'] . " AND product_type='" . $params['product_type'] . "'";
         $where .= empty($params['options']) ? '' : " AND options='" . $params['options'] . "'";
         $where .= empty($params['user_input_fields']) ? '' : " AND user_input_fields='" . $params['user_input_fields'] . "'";
         $item = $db->selectObject($this->table, $where);
         $this->product = new $params['product_type']($params['product_id'], false, true);
         if (empty($item)) {
             parent::__construct(array('orders_id' => $order->id, 'user_id' => $user->id, 'product_id' => $this->product->id, 'product_type' => $params['product_type'], 'products_name' => $this->product->title, 'products_price' => $this->product->getBasePrice()), $get_assoc, $get_attached);
         } else {
             parent::__construct($item->id, $get_assoc, $get_attached);
             //$this->quantity = $this->product->incrementQuantity($this->quantity);
         }
     } else {
         parent::__construct(null, $get_assoc, $get_attached);
     }
     if (isset($this->options)) {
         $this->opts = expUnserialize($this->options);
     }
     if (!empty($this->user_input_fields)) {
         //$this->user_input_fields = expUnserialize($this->user_input_fields);
     }
 }
开发者ID:notzen,项目名称:exponent-cms,代码行数:36,代码来源:orderitem.php

示例2: explode

$microtime_str = explode(' ', microtime());
$i_start = $microtime_str[0] + $microtime_str[1];
// Initialize the Exponent Framework
require_once 'exponent.php';
//active global timer if in DEVELOPMENT mode
if (DEVELOPMENT) {
    $timer = new expTimer();
}
// if the user has turned on sef_urls then we need to route the request, otherwise we can just
// skip it and default back to the old way of doing things.
$router->routeRequest();
// initialize this users cart if they have ecom installed.
// define whether or not ecom is enabled
if ($db->selectValue('modstate', 'active', 'module="storeController"')) {
    define('ECOM', 1);
    $order = order::getUserCart();
    // Create a globle store config
    // We're forcing the location. Global store setting will always have this loc
    $cfg->mod = "ecomconfig";
    $cfg->src = "@globalstoresettings";
    $cfg->int = "";
    $storeConfig = new expConfig($cfg);
} else {
    define('ECOM', 0);
}
if (isset($_GET['id']) && !is_numeric($_GET['id'])) {
    $_GET['id'] = intval($_GET['id']);
}
$section = $router->getSection();
if ($db->havedb) {
    $sectionObj = $router->getSectionObj($section);
开发者ID:notzen,项目名称:exponent-cms,代码行数:31,代码来源:index.php


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