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


PHP Lookup::payment_status_labels方法代码示例

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


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

示例1: manager

	/**
	 * Interface processor for the order manager
	 *	 
	 * @return void
	 **/
	function manager () {
		global $Ecart,$UI,$Notes;
		global $is_IIS;

		if ( !(is_ecart_userlevel() || current_user_can('ecart_orders')) )
			wp_die(__('You do not have sufficient permissions to access this page.','Ecart'));

		$Purchase = $Ecart->Purchase;
		$Purchase->Customer = new Customer($Purchase->customer);

		// Handle Order note processing
		if (!empty($_POST['note'])) {
			$user = wp_get_current_user();
			$Note = new MetaObject();
			$Note->parent = $Purchase->id;
			$Note->context = 'purchase';
			$Note->type = 'order_note';
			$Note->name = 'note';
			$Note->value = new stdClass();
			$Note->value->author = $user->ID;
			$Note->value->message = $_POST['note'];
			$Note->save();
		}
		if (!empty($_POST['delete-note'])) {
			$noteid = key($_POST['delete-note']);
			$Note = new MetaObject($noteid);
			$Note->delete();
		}
		if (!empty($_POST['edit-note'])) {
			$noteid = key($_POST['note-editor']);
			$Note = new MetaObject($noteid);
			$Note->value->message = $_POST['note-editor'][$noteid];
			$Note->save();
		}
		$Notes = new ObjectMeta($Purchase->id,'purchase','order_note');

		if (!empty($_POST['update'])) {
			check_admin_referer('ecart-save-order');

			if ($_POST['txnstatus'] != $Purchase->txnstatus)
				do_action_ref_array('ecart_order_txnstatus_update',array(&$_POST['txnstatus'],&$Purchase));


			$Purchase->updates($_POST);

			$mailstatus = false;
			if ($_POST['notify'] == "yes") {
				$labels = $this->Settings->get('order_status');
				// Save a reference to this purchase in Ecart
				// so the Template API works when generating the receipt
				$Ecart->Purchase =& $Purchase;

				// Send the e-mail notification
				$addressee = "$Purchase->firstname $Purchase->lastname";
				$address = "$Purchase->email";

				$email = array();
				$email['from'] = '"'.get_bloginfo("name").'"';
				if ($Ecart->Settings->get('merchant_email'))
					$email['from'] .= ' <'.$Ecart->Settings->get('merchant_email').'>';
				if($is_IIS) $email['to'] = $address;
				else $email['to'] = '"'.html_entity_decode($addressee,ENT_QUOTES).'" <'.$address.'>';
				$email['subject'] = __('Order Updated','Ecart');
				$email['url'] = get_bloginfo('siteurl');
				$email['sitename'] = get_bloginfo('name');

				if ($_POST['receipt'] == "yes")
					$email['receipt'] = $Purchase->receipt();

				$email['status'] = strtoupper($labels[$Purchase->status]);
				$email['message'] = wpautop(stripslashes($_POST['message']));

				if (file_exists(ECART_TEMPLATES."/notification.html")) $template = ECART_TEMPLATES."/notification.html";
				if (file_exists(ECART_TEMPLATES."/notify.php")) $template = ECART_TEMPLATES."/notify.php";

				if (ecart_email($template,$email)) $mailsent = true;

			}

			$Purchase->save();
			if ($mailsent) $updated = __('Order status updated & notification email sent.','Ecart');
			else $updated = __('Order status updated.','Ecart');
		}

		$targets = $this->Settings->get('target_markets');
		$UI->txnStatusLabels = Lookup::payment_status_labels();
		$UI->statusLabels = $this->Settings->get('order_status');
		if (empty($statusLabels)) $statusLabels = array('');

		include(ECART_ADMIN_PATH."/orders/order.php");
	}
开发者ID:robbiespire,项目名称:paQui,代码行数:96,代码来源:Service.php

示例2: tag


//.........这里部分代码省略.........
			case "item-addons-list":
			case "item-addonslist":
			case "item-addons-list":
			case "itemaddonslist":
				$item = current($this->purchased);
				if (empty($item->addons)) return false;
				$defaults = array(
					'prices' => "on",
					'download' => __('Download','Ecart'),
					'before' => '',
					'after' => '',
					'classes' => '',
					'excludes' => ''
				);
				$options = array_merge($defaults,$options);
				extract($options);

				$class = !empty($classes)?' class="'.join(' ',explode(',',$classes)).'"':'';
				$taxrate = 0;
				if ($item->unitprice > 0)
					$taxrate = round($item->unittax/$item->unitprice,4);

				$result = $before.'<ul'.$class.'>';
				foreach ($item->addons->meta as $id => $addon) {
					if (in_array($addon->name,$excludes)) continue;
					if ($this->taxing == "inclusive")
						$price = $addon->value->unitprice+($addon->value->unitprice*$taxrate);
					else $price = $addon->value->unitprice;

					$link = false;
					if (isset($addon->value->download) && isset($addon->value->dkey)) {
						$dkey = $addon->value->dkey;
						$request = ECART_PRETTYURLS?"download/$dkey":array('ecart_download'=>$dkey);
						$url = ecarturl($request,'catalog');
						$link = '<br /><a href="'.$url.'">'.$download.'</a>';
					}

					$pricing = value_is_true($prices)?" (".money($price).")":"";
					$result .= '<li>'.esc_html($addon->name.$pricing).$link.'</li>';
				}
				$result .= '</ul>'.$after;
				return $result;
				break;
			case "has-data":
			case "hasdata": return (is_array($this->data) && count($this->data) > 0); break;
			case "orderdata":
				if (!isset($this->_data_loop)) {
					reset($this->data);
					$this->_data_loop = true;
				} else next($this->data);

				if (current($this->data) !== false) return true;
				else {
					unset($this->_data_loop);
					return false;
				}
				break;
			case "data":
				if (!is_array($this->data)) return false;
				$data = current($this->data);
				$name = key($this->data);
				if (isset($options['name'])) return esc_html($name);
				return esc_html($data);
				break;
			case "promolist":
			case "promo-list":
				$output = "";
				if (!empty($this->promos)) {
					$output .= '<ul>';
					foreach ($this->promos as $promo)
						$output .= '<li>'.$promo.'</li>';
					$output .= '</ul>';
				}
				return $output;
			case "has-promo":
			case "haspromo":
				if (empty($options['name'])) return false;
				return (in_array($options['name'],$this->promos));
				break;
			case "subtotal": return money($this->subtotal); break;
			case "hasfreight": return (!empty($this->shipmethod) || $this->freight > 0);
			case "freight": return money($this->freight); break;
			case "hasdownloads": return ($this->downloads);
			case "hasdiscount": return ($this->discount > 0);
			case "discount": return money($this->discount); break;
			case "hastax": return ($this->tax > 0)?true:false;
			case "tax": return money($this->tax); break;
			case "total": return money($this->total); break;
			case "status":
				$labels = $Ecart->Settings->get('order_status');
				if (empty($labels)) $labels = array('');
				return $labels[$this->status];
				break;
			case "paid": return ($this->txnstatus == "CHARGED"); break;
			case "notpaid": return ($this->txnstatus != "CHARGED"); break;
			case "payment":
				$labels = Lookup::payment_status_labels();
				return isset($labels[$this->txnstatus])?$labels[$this->txnstatus]:$this->txnstatus; break;
		}
	}
开发者ID:robbiespire,项目名称:paQui,代码行数:101,代码来源:Purchase.php


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