本文整理汇总了PHP中Purchase::load_purchased方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::load_purchased方法的具体用法?PHP Purchase::load_purchased怎么用?PHP Purchase::load_purchased使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase::load_purchased方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Purchase
function shopp_transaction_tracking($push)
{
global $Shopp;
// Only process if we're in the checkout process (receipt page)
if (version_compare(substr(SHOPP_VERSION, 0, 3), '1.1') >= 0) {
// Only process if we're in the checkout process (receipt page)
if (function_exists('is_shopp_page') && !is_shopp_page('checkout')) {
return $push;
}
if (empty($Shopp->Order->purchase)) {
return $push;
}
$Purchase = new Purchase($Shopp->Order->purchase);
$Purchase->load_purchased();
} else {
// For 1.0.x
// Only process if we're in the checkout process (receipt page)
if (function_exists('is_shopp_page') && !is_shopp_page('checkout')) {
return $push;
}
// Only process if we have valid order data
if (!isset($Shopp->Cart->data->Purchase)) {
return $push;
}
if (empty($Shopp->Cart->data->Purchase->id)) {
return $push;
}
$Purchase = $Shopp->Cart->data->Purchase;
}
$push[] = "'_addTrans'," . "'" . $Purchase->id . "'," . "'" . GA_Filter::ga_str_clean(get_bloginfo('name')) . "'," . "'" . number_format($Purchase->total, 2) . "'," . "'" . number_format($Purchase->tax, 2) . "'," . "'" . number_format($Purchase->shipping, 2) . "'," . "'" . $Purchase->city . "'," . "'" . $Purchase->state . "'," . "'.{$Purchase->country}.'";
// Country
foreach ($Purchase->purchased as $item) {
$sku = empty($item->sku) ? 'PID-' . $item->product . str_pad($item->price, 4, '0', STR_PAD_LEFT) : $item->sku;
$push[] = "'_addItem'," . "'" . $Purchase->id . "'," . "'" . $sku . "'," . "'" . str_replace("'", "", $item->name) . "'," . "'" . $item->optionlabel . "'," . "'" . number_format($item->unitprice, 2) . "'," . "'" . $item->quantity . "'";
}
$push[] = "'_trackTrans'";
return $push;
}
示例2: tag
//.........这里部分代码省略.........
if (!isset($this->_menu_looping)) {
reset($this->menus);
$this->_menu_looping = true;
} else next($this->menus);
if (current($this->menus) !== false) return true;
else {
unset($this->_menu_looping);
reset($this->menus);
return false;
}
break;
case "management":
$page = current($this->menus);
if (array_key_exists('url',$options)) return ecarturl(array('acct'=>$page->request),'account');
if (array_key_exists('action',$options)) return $page->request;
return $page->label;
case "accounts": return $Ecart->Settings->get('account_system'); break;
case "hasaccount":
$system = $Ecart->Settings->get('account_system');
if ($system == "wordpress") return ($this->wpuser != 0);
elseif ($system == "ecart") return (!empty($this->password));
else return false;
case "wpuser-created": return $this->newuser;
case "order-lookup":
$auth = $Ecart->Settings->get('account_system');
if ($auth != "none") return true;
if (!empty($_POST['vieworder']) && !empty($_POST['purchaseid'])) {
require_once("Purchase.php");
$Purchase = new Purchase($_POST['purchaseid']);
if ($Purchase->email == $_POST['email']) {
$Ecart->Purchase = $Purchase;
$Purchase->load_purchased();
ob_start();
include(ECART_TEMPLATES."/receipt.php");
$content = ob_get_contents();
ob_end_clean();
return apply_filters('ecart_order_lookup',$content);
}
}
ob_start();
include(ECART_ADMIN_PATH."/orders/account.php");
$content = ob_get_contents();
ob_end_clean();
return apply_filters('ecart_order_lookup',$content);
break;
case "firstname":
if (isset($options['mode']) && $options['mode'] == "value") return $this->firstname;
if (!empty($this->firstname))
$options['value'] = $this->firstname;
return '<input type="text" name="firstname" id="firstname"'.inputattrs($options).' />';
break;
case "lastname":
if (isset($options['mode']) && $options['mode'] == "value") return $this->lastname;
if (!empty($this->lastname))
$options['value'] = $this->lastname;
return '<input type="text" name="lastname" id="lastname"'.inputattrs($options).' />';
break;
case "company":
if (isset($options['mode']) && $options['mode'] == "value") return $this->company;
if (!empty($this->company))
$options['value'] = $this->company;
return '<input type="text" name="company" id="company"'.inputattrs($options).' />';
示例3: array
/**
* Orders admin flow handlers
*/
function orders_list()
{
global $Shopp, $Orders;
$db = DB::get();
$defaults = array('page' => false, 'deleting' => false, 'selected' => false, 'update' => false, 'newstatus' => false, 'pagenum' => 1, 'per_page' => false, 'start' => '', 'end' => '', 'status' => false, 's' => '', 'range' => '', 'startdate' => '', 'enddate' => '');
$args = array_merge($defaults, $_GET);
extract($args, EXTR_SKIP);
if (!current_user_can(SHOPP_USERLEVEL)) {
wp_die(__('You do not have sufficient permissions to access this page.', 'Shopp'));
}
if ($page == "shopp-orders" && !empty($deleting) && !empty($selected) && is_array($selected)) {
foreach ($selected as $selection) {
$Purchase = new Purchase($selection);
$Purchase->load_purchased();
foreach ($Purchase->purchased as $purchased) {
$Purchased = new Purchased($purchased->id);
$Purchased->delete();
}
$Purchase->delete();
}
}
$statusLabels = $this->Settings->get('order_status');
if (empty($statusLabels)) {
$statusLabels = array('');
}
$txnStatusLabels = array('PENDING' => __('Pending', 'Shopp'), 'CHARGED' => __('Charged', 'Shopp'), 'REFUNDED' => __('Refunded', 'Shopp'), 'VOID' => __('Void', 'Shopp'));
if ($update == "order" && !empty($selected) && is_array($selected)) {
foreach ($selected as $selection) {
$Purchase = new Purchase($selection);
$Purchase->status = $newstatus;
$Purchase->save();
}
}
$Purchase = new Purchase();
if (!empty($start)) {
$startdate = $start;
list($month, $day, $year) = explode("/", $startdate);
$starts = mktime(0, 0, 0, $month, $day, $year);
}
if (!empty($end)) {
$enddate = $end;
list($month, $day, $year) = explode("/", $enddate);
$ends = mktime(23, 59, 59, $month, $day, $year);
}
$pagenum = absint($pagenum);
if (empty($pagenum)) {
$pagenum = 1;
}
if (!$per_page || $per_page < 0) {
$per_page = 20;
}
$start = $per_page * ($pagenum - 1);
$where = '';
if (!empty($status) || $status === '0') {
$where = "WHERE status='{$status}'";
}
if (!empty($s)) {
$s = stripslashes($s);
if (preg_match_all('/(\\w+?)\\:(?="(.+?)"|(.+?)\\b)/', $s, $props, PREG_SET_ORDER) > 0) {
foreach ($props as $search) {
$keyword = !empty($search[2]) ? $search[2] : $search[3];
switch (strtolower($search[1])) {
case "txn":
$where .= (empty($where) ? "WHERE " : " AND ") . "transactionid='{$keyword}'";
break;
case "gateway":
$where .= (empty($where) ? "WHERE " : " AND ") . "gateway LIKE '%{$keyword}%'";
break;
case "cardtype":
$where .= (empty($where) ? "WHERE " : " AND ") . "cardtype LIKE '%{$keyword}%'";
break;
case "address":
$where .= (empty($where) ? "WHERE " : " AND ") . "(address LIKE '%{$keyword}%' OR xaddress='%{$keyword}%')";
break;
case "city":
$where .= (empty($where) ? "WHERE " : " AND ") . "city LIKE '%{$keyword}%'";
break;
case "province":
case "state":
$where .= (empty($where) ? "WHERE " : " AND ") . "state='{$keyword}'";
break;
case "zip":
case "zipcode":
case "postcode":
$where .= (empty($where) ? "WHERE " : " AND ") . "postcode='{$keyword}'";
break;
case "country":
$where .= (empty($where) ? "WHERE " : " AND ") . "country='{$keyword}'";
break;
}
}
if (empty($where)) {
$where .= (empty($where) ? "WHERE " : " AND ") . " (id='{$s}' OR CONCAT(firstname,' ',lastname) LIKE '%{$s}%')";
}
} elseif (strpos($s, '@') !== false) {
$where .= (empty($where) ? "WHERE " : " AND ") . " email='{$s}'";
} else {
//.........这里部分代码省略.........
示例4: tag
//.........这里部分代码省略.........
$this->looping = true;
} else {
next($this->management);
}
if (current($this->management)) {
return true;
} else {
$this->looping = false;
reset($this->management);
return false;
}
break;
case "management":
if (array_key_exists('url', $options)) {
return add_query_arg('acct', key($this->management), $Shopp->link('account'));
}
if (array_key_exists('action', $options)) {
return key($this->management);
}
return $menus[key($this->management)];
case "accounts":
return $Shopp->Settings->get('account_system');
break;
case "order-lookup":
$auth = $Shopp->Settings->get('account_system');
if ($auth != "none") {
return true;
}
if (!empty($_POST['vieworder']) && !empty($_POST['purchaseid'])) {
require_once "Purchase.php";
$Purchase = new Purchase($_POST['purchaseid']);
if ($Purchase->email == $_POST['email']) {
$Shopp->Cart->data->Purchase = $Purchase;
$Purchase->load_purchased();
ob_start();
include SHOPP_TEMPLATES . "/receipt.php";
$content = ob_get_contents();
ob_end_clean();
return '<div id="shopp">' . $content . '</div>';
}
}
ob_start();
include SHOPP_ADMINPATH . "/orders/account.php";
$content = ob_get_contents();
ob_end_clean();
return '<div id="shopp">' . $content . '</div>';
break;
case "firstname":
if ($options['mode'] == "value") {
return $this->firstname;
}
if (!empty($this->firstname)) {
$options['value'] = $this->firstname;
}
return '<input type="text" name="firstname" id="firstname"' . inputattrs($options) . ' />';
break;
case "lastname":
if ($options['mode'] == "value") {
return $this->lastname;
}
if (!empty($this->lastname)) {
$options['value'] = $this->lastname;
}
return '<input type="text" name="lastname" id="lastname"' . inputattrs($options) . ' />';
break;
case "company":