本文整理汇总了PHP中Cart66Common::currency方法的典型用法代码示例。如果您正苦于以下问题:PHP Cart66Common::currency方法的具体用法?PHP Cart66Common::currency怎么用?PHP Cart66Common::currency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cart66Common
的用法示例。
在下文中一共展示了Cart66Common::currency方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMaxOrderDescription
public function getMaxOrderDescription()
{
// CHANGE AND COMBINE WITH ABOVE
$max = $this->maxOrder;
if ($max > 0) {
$max = Cart66Common::currency($max);
} else {
$max = __('Apply to All Orders', 'cart66');
}
return $max;
}
示例2: getTrialPriceDescription
public function getTrialPriceDescription()
{
$description = 'No trial';
if ($this->offerTrial > 0) {
$description = Cart66Common::currency($this->trialPrice) . ' / ';
if ($this->trialPeriod > 1) {
$description .= $this->trialPeriod . ' ';
}
$description .= $this->getTrialPeriodUnit();
}
return $description;
}
示例3: getPriceDescription
public function getPriceDescription()
{
$product = new Cart66Product();
$spreedlyProduct = $product->getOne("where spreedly_subscription_id = {$this->id}");
if (!empty($spreedlyProduct->priceDescription)) {
$out = $spreedlyProduct->priceDescription;
} else {
$price = $this->price;
$out = Cart66Common::currency($price) . ' / ' . $this->terms;
if ($this->hasFreeTrial()) {
$duration = $this->chargeLaterDurationQuantity . ' ' . $this->chargeLaterDurationUnits;
$out .= " <span class='Cart66FreePeriod'>(first {$duration} free)</span>";
}
}
return $out;
}
示例4: __
}
$price = $item->product_price * $item->quantity;
// echo "Item: " . $item->item_number . ' ' . $item->description . "\n";
echo __("Item", "cart66") . ": " . $item->description . "\n";
if ($hasDigital) {
$receiptPage = get_page_by_path('store/receipt');
$receiptPageLink = get_permalink($receiptPage);
$receiptPageLink .= strstr($receiptPageLink, '?') ? '&duid=' . $item->duid : '?duid=' . $item->duid;
echo "\n" . $receiptPageLink . "\n";
}
if ($item->quantity > 1) {
echo __("Quantity", "cart66") . ": " . $item->quantity . "\n";
}
echo __("Item Price", "cart66") . ": " . Cart66Common::currency($item->product_price) . "\n";
echo __("Item Total", "cart66") . ": " . Cart66Common::currency($item->product_price * $item->quantity) . "\n\n";
if ($product->isGravityProduct()) {
echo Cart66GravityReader::displayGravityForm($item->form_entry_ids, true);
}
}
if ($order->shipping_method != 'None' && $order->shipping_method != 'Download') {
echo __("Shipping", "cart66") . ": " . Cart66Common::currency($order->shipping) . "\n";
}
if (!empty($order->coupon) && $order->coupon != 'none') {
echo __("Coupon", "cart66") . ": " . $order->coupon . "\n";
}
if ($order->tax > 0) {
echo __("Tax", "cart66") . ": " . Cart66Common::currency($order->tax, false) . "\n";
}
echo "\n" . __("TOTAL", "cart66") . ": " . Cart66Common::currency($order->total, false) . "\n";
}
}
示例5: _e
</span>
<p id="what_is_initial_payment_answer" class="label_desc" style="max-width: 400px; display: none;">F<?php
_e('or example, this may be a setup fee. This one time fee will be charged at checkout regardless of when you decide to start collecting the recurring payments.', 'cart66');
?>
</p>
</li>
<li>
<label class="med" for="subscription-price"><?php
_e('Recurring Price', 'cart66');
?>
:</label>
<?php
echo Cart66Common::currencySymbol('before');
?>
<input class="med" style="width: 5em;" type="text" name="subscription[price]" id="subscription-price" value="<?php
echo $data['subscription']->id > 0 ? Cart66Common::currency($data['subscription']->price, true, false, false) : '';
?>
" />
<?php
echo Cart66Common::currencySymbol('after');
?>
</li>
<li>
<label class="med" for="subscription-billing_interval"><?php
_e('Bill every', 'cart66');
?>
:</label>
<input style="width: 50px;" type="text" name="subscription[billing_interval]" id="subscription-billing_interval" value="<?php
echo $data['subscription']->billingInterval;
?>
" />
示例6: paypalSubscriptionsTable
public static function paypalSubscriptionsTable()
{
$columns = array('id', 'item_number', 'name', 'feature_level', 'setup_fee', 'price', 'billing_cycles', 'offer_trial', 'start_recurring_number', 'start_recurring_unit');
$indexColumn = "id";
$tableName = Cart66Common::getTableName('products');
$where = self::dataTablesWhere($columns);
$limit = self::dataTablesLimit() == '' ? null : self::dataTablesLimit();
$order = self::dataTablesOrder($columns);
if ($where == null) {
$where = "WHERE is_paypal_subscription>0";
} else {
$where .= " AND is_paypal_subscription>0";
}
$iTotal = self::totalRows($indexColumn, $tableName, $where);
$iFilteredTotal = self::filteredRows($indexColumn, $tableName, $where);
$data = array();
$subscription = new Cart66PayPalSubscription();
$subscriptions = $subscription->getModels($where, $order, $limit);
foreach ($subscriptions as $s) {
$gfTitles = self::gfData();
if ($s->gravityFormId > 0 && isset($gfTitles) && isset($gfTitles[$s->gravityFormId])) {
$gfTitles = '<br/><em>Linked To Gravity Form: ' . $gfTitles[$s->gravityFormId] . '</em>';
} else {
$gfTitles = '';
}
$data[] = array($s->id, $s->item_number, $s->name . $gfTitles, $s->featureLevel, Cart66Common::currency($s->setupFee), $s->getPriceDescription(false), $s->getBillingCycleDescription(), $s->getTrialPriceDescription(), $s->getStartRecurringDescription());
}
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] " . json_encode($data));
$array = array('sEcho' => $_GET['sEcho'], 'iTotalRecords' => $iTotal[0], 'iTotalDisplayRecords' => $iFilteredTotal[0], 'aaData' => $data);
echo json_encode($array);
die;
}
示例7: Cart66ShippingMethod
?>
<?php
$method = new Cart66ShippingMethod();
$method->load($rule->shipping_method_id);
?>
<tr>
<td><?php
echo Cart66Common::currency($rule->min_amount);
?>
</td>
<td><?php
echo $method->name ? $method->name : "<span style='color:red;'>Please select a method</span>";
?>
</td>
<td><?php
echo Cart66Common::currency($rule->shipping_cost);
?>
</td>
<td>
<a href='?page=cart66-shipping&task=edit&id=<?php
echo $rule->id;
?>
'><?php
_e('Edit', 'cart66');
?>
</a> |
<a class='delete' href='?page=cart66-shipping&task=delete&id=<?php
echo $rule->id;
?>
'><?php
_e('Delete', 'cart66');
示例8: __
</div>
</body>
</html>
<?php
} else {
$msg = __("This is a test email receipt with test information. Please create a template in your settings to get it to look exactly the way you want.", "cart66") . "\n\n";
$msg .= __("ORDER NUMBER", "cart66") . ": TEST-TRANSACTION-ID\n\n";
$msg .= __("Order Status") . ": " . str_replace('_', ' ', strtoupper($status)) . "\n\n";
$msg .= __("Item", "cart66") . ": Test Product Name\n";
$msg .= __("Quantity", "cart66") . ": 3\n";
$msg .= __("Item Price", "cart66") . ": " . Cart66Common::currency(15.0, false) . "\n";
$msg .= __("Item Total", "cart66") . ": " . Cart66Common::currency(45.0, false) . "\n\n";
$msg .= __("Shipping", "cart66") . ": " . Cart66Common::currency(5.0, false) . "\n";
$msg .= __("Coupon", "cart66") . ": TEST-COUPON -(" . Cart66Common::currency(15.0, false) . ")\n";
$msg .= __("Tax", "cart66") . ": " . Cart66Common::currency(1.87, false) . "\n";
$msg .= "\n" . __("TOTAL", "cart66") . ": " . Cart66Common::currency(36.87, false) . "\n";
$msg .= "\n\n" . __("SHIPPING INFORMATION", "cart66") . "\n\n";
$msg .= "FirstName LastName\n";
$msg .= "1234 My Address\n";
$msg .= "Apt. 1\n";
$msg .= "My City, ST 00000\nUnited States\n";
$msg .= "\n" . __("Delivery via", "cart66") . ": UPS Ground\n";
$msg .= "\n\n" . __("BILLING INFORMATION", "cart66") . "\n\n";
$msg .= "FirstName LastName\n";
$msg .= "1234 My Address\n";
$msg .= "Apt. 1\n";
$msg .= "My City, ST 00000\nUnited States\n";
$msg .= "\n" . __("Phone", "cart66") . ": (000) 000-0000\n";
$msg .= __("Email", "cart66") . ": testemail@aol.com\n";
$msg .= "\n" . __('DOWNLOAD LINK', 'cart66') . "\n" . __('Click the link below to download your order.', 'cart66') . "\nhttp://yoursite.com/store/receipt/?ouid=randomstring\n";
$msg .= "\n" . __('VIEW RECEIPT ONLINE', 'cart66') . "\n" . __('Click the link below to view your receipt online.', 'cart66') . "\nhttp://yoursite.com/store/receipt/?ouid=randomstring\n";
示例9: _e
<p style="border: 1px solid #CCC; background-color: #eee; padding: 5px; width: 590px; -moz-border-radius: 5px; -webkit-border-radius: 5px;">
<strong><?php
_e('Current Tweak Factor', 'cart66');
?>
:</strong>
<?php
if (Cart66Setting::getValue('rate_tweak_factor')) {
$type = Cart66Setting::getValue('rate_tweak_type');
$factor = Cart66Setting::getValue('rate_tweak_factor');
if ($type == 'percentage') {
$direction = $factor > 0 ? 'increased' : 'decreased';
echo "All rates will be {$direction} by " . abs($factor) . '%';
} else {
$direction = $factor > 0 ? 'added to' : 'subtracted from';
echo Cart66Common::currency(abs($factor)) . " will be {$direction} all rates";
}
} else {
echo 'The calculated rates will not be tweaked.';
}
?>
</p>
<form action="" method="post">
<input type="hidden" name="cart66-action" value="save rate tweak" />
<select name="rate_tweak_type" id="rate_tweak_type">
<option value="percentage"><?php
_e('Tweak by percentage', 'cart66');
?>
</option>
<option value="fixed"><?php
示例10: defaultPlainEmailMessage
public function defaultPlainEmailMessage($order)
{
$msg = __("ORDER NUMBER", "cart66") . ": " . $order->trans_id . "\n\n";
$hasDigital = false;
$product = new Cart66Product();
foreach ($order->getItems() as $item) {
$product->load($item->product_id);
if ($hasDigital == false) {
$hasDigital = $product->isDigital();
}
$price = $item->product_price * $item->quantity;
// $msg .= "Item: " . $item->item_number . ' ' . $item->description . "\n";
$msg .= __("Item", "cart66") . ": " . $item->description . "\n";
if ($hasDigital) {
$receiptPage = get_page_by_path('store/receipt');
$receiptPageLink = get_permalink($receiptPage);
$receiptPageLink .= strstr($receiptPageLink, '?') ? '&duid=' . $item->duid : '?duid=' . $item->duid;
$msg .= "\n" . $receiptPageLink . "\n";
}
if ($item->quantity > 1) {
$msg .= __("Quantity", "cart66") . ": " . $item->quantity . "\n";
}
$msg .= __("Item Price", "cart66") . ": " . Cart66Common::currency($item->product_price, false) . "\n";
$msg .= __("Item Total", "cart66") . ": " . Cart66Common::currency($item->product_price * $item->quantity, false) . "\n\n";
if ($product->isGravityProduct()) {
$msg .= Cart66GravityReader::displayGravityForm($item->form_entry_ids, true);
}
}
if ($order->shipping_method != 'None' && $order->shipping_method != 'Download') {
$msg .= __("Shipping", "cart66") . ": " . Cart66Common::currency($order->shipping, false) . "\n";
}
if (!empty($order->coupon) && $order->coupon != 'none') {
$msg .= __("Coupon", "cart66") . ": " . $order->coupon . "\n";
}
if ($order->tax > 0) {
$msg .= __("Tax", "cart66") . ": " . Cart66Common::currency($order->tax, false) . "\n";
}
$msg .= "\n" . __("TOTAL", "cart66") . ": " . Cart66Common::currency($order->total, false) . "\n";
if ($order->shipping_method != 'None' && $order->shipping_method != 'Download') {
$msg .= "\n\n" . __("SHIPPING INFORMATION", "cart66") . "\n\n";
$msg .= $order->ship_first_name . ' ' . $order->ship_last_name . "\n";
$msg .= $order->ship_address . "\n";
if (!empty($order->ship_address2)) {
$msg .= $order->ship_address2 . "\n";
}
$msg .= $order->ship_city . ' ' . $order->ship_state . ' ' . $order->ship_zip . "\n" . $order->ship_country . "\n";
if (is_array($additional_fields = maybe_unserialize($order->additional_fields)) && isset($additional_fields['shipping'])) {
foreach ($additional_fields['shipping'] as $af) {
$msg .= html_entity_decode($af['label']) . ': ' . $af['value'] . "\n";
}
}
$msg .= "\n" . __("Delivery via", "cart66") . ": " . $order->shipping_method . "\n";
}
$msg .= "\n\n" . __("BILLING INFORMATION", "cart66") . "\n\n";
$msg .= $order->bill_first_name . ' ' . $order->bill_last_name . "\n";
$msg .= $order->bill_address . "\n";
if (!empty($order->bill_address2)) {
$msg .= $order->bill_address2 . "\n";
}
$msg .= $order->bill_city . ' ' . $order->bill_state;
$msg .= $order->bill_zip != null ? ', ' : ' ';
$msg .= $order->bill_zip . "\n" . $order->bill_country . "\n";
if (is_array($additional_fields = maybe_unserialize($order->additional_fields)) && isset($additional_fields['billing'])) {
foreach ($additional_fields['billing'] as $af) {
$msg .= html_entity_decode($af['label']) . ': ' . $af['value'] . "\n";
}
}
if (!empty($order->phone)) {
$phone = Cart66Common::formatPhone($order->phone);
$msg .= "\n" . __("Phone", "cart66") . ": {$phone}\n";
}
if (!empty($order->email)) {
$msg .= __("Email", "cart66") . ': ' . $order->email . "\n";
}
if (is_array($additional_fields = maybe_unserialize($order->additional_fields)) && isset($additional_fields['payment'])) {
foreach ($additional_fields['payment'] as $af) {
$msg .= html_entity_decode($af['label']) . ': ' . $af['value'] . "\n";
}
}
if (isset($order->custom_field) && $order->custom_field != '') {
if (Cart66Setting::getValue('checkout_custom_field_label')) {
$msg .= "\n" . Cart66Setting::getValue('checkout_custom_field_label');
} else {
$msg .= "\n" . __('Enter any special instructions you have for this order:', 'cart66');
}
$msg .= "\n" . $order->custom_field . "\n";
}
$receiptPage = get_page_by_path('store/receipt');
$link = get_permalink($receiptPage->ID);
if (strstr($link, "?")) {
$link .= '&ouid=' . $order->ouid;
} else {
$link .= '?ouid=' . $order->ouid;
}
if ($hasDigital) {
$msg .= "\n" . __('DOWNLOAD LINK', 'cart66') . "\n" . __('Click the link below to download your order.', 'cart66') . "\n{$link}";
} else {
$msg .= "\n" . __('VIEW RECEIPT ONLINE', 'cart66') . "\n" . __('Click the link below to view your receipt online.', 'cart66') . "\n{$link}";
}
$msgIntro = Cart66Setting::getValue('receipt_intro') && !Cart66Setting::getValue('enable_advanced_notifications') ? Cart66Setting::getValue('receipt_intro') : '';
//.........这里部分代码省略.........
示例11: _e
?>
<?php
}
?>
<?php
if ($tax > 0) {
?>
<tr class="tax">
<td colspan="2"><?php
_e('Tax', 'cart66');
?>
<span class="Cart66MetaSep">:</span>
<span class="Cart66TaxCost"><?php
echo Cart66Common::currency($tax);
?>
</span></td>
</tr>
<?php
}
?>
</table>
</form>
<div class="Cart66WidgetViewCartCheckoutItems">
<a class="Cart66WidgetViewCart" href='<?php
echo get_permalink($data['cartPage']->ID);
?>
'><?php
示例12: cart66_statistics_widget
public static function cart66_statistics_widget()
{
function totalFromRange($start, $end)
{
global $wpdb;
$tableName = Cart66Common::getTableName('orders');
$sql = "SELECT sum(total) as total from {$tableName} where ordered_on > '{$start}' AND ordered_on < '{$end}'";
$result = $wpdb->get_row($sql, ARRAY_A);
$output = $result ? (double) $result['total'] : "N/A";
return $output;
}
// TODAY
$yday = date('Y-m-d 00:00:00', strtotime('yesterday'));
$dayStart = date('Y-m-d 00:00:00', strtotime('today'));
$dayEnd = date('Y-m-d 00:00:00', strtotime('tomorrow'));
$mdayStart = date('Y-m-01 00:00:00', strtotime('today'));
$mdayEnd = date('Y-m-01 00:00:00', strtotime('next month'));
$today_total = totalFromRange($dayStart, $dayEnd);
$yesterday_total = totalFromRange($yday, $dayStart);
$month_total = totalFromRange($mdayStart, $mdayEnd);
$total_product_sales = Cart66DataTables::productsSearch();
$total_sales_amount = Cart66DataTables::totalSalesForMonth($total_product_sales);
$daily_avg = ($month_total - $today_total) / date('j', strtotime('yesterday'));
//number_format($month_total/date("j"),2);
$total_days = date('t', strtotime('now'));
$est_month = $total_days * $daily_avg;
?>
<div class="cart66Tabbed">
<ul class="tabs">
<li class="t1"><a class="t1 tab" href="javascript:void(0)"><?php
_e('Summary', 'cart66');
?>
</a></li>
<li class="t2"><a class="t2 tab" href="javascript:void(0)"><?php
_e('Today/Yesterday', 'cart66');
?>
</a></li>
<li class="t3"><a class="t3 tab" href="javascript:void(0)"><?php
echo date("F, Y", strtotime("now"));
?>
</a></li>
<li class="t4"><a class="t4 tab" href="javascript:void(0)"><?php
_e('Daily Average', 'cart66');
?>
</a></li>
<li class="t5"><a class="t5 tab" href="javascript:void(0)"><?php
_e('Estimate', 'cart66');
?>
</a></li>
</ul>
<div class="loading">
<h2 class="center"><?php
_e('loading...', 'cart66');
?>
</h2>
</div>
<div class="t1 pane">
<table id="statSummary" cellspacing="0" cellpadding="0">
<tfoot>
<tr>
<td>
<?php
_e('Last Updated', 'cart66');
?>
:
</td>
<td class="right">
<?php
echo date(get_option('date_format'), Cart66Common::localTs());
?>
<?php
echo date(get_option('time_format'), Cart66Common::localTs());
?>
</td>
</tr>
</tfoot>
<tbody>
<tr class="t4 tab summaryDetails">
<td>
<?php
echo date('F');
_e(' Daily Average', 'cart66');
?>
:
</td>
<td class="right">
<a class="t4 tab" href="javascript:void(0)"><?php
echo Cart66Common::currency($daily_avg);
?>
</a>
</td>
</tr>
<tr class="t2 tab summaryDetails">
<td>
<?php
_e('Today\'s Total', 'cart66');
?>
:
</td>
<td class="right">
//.........这里部分代码省略.........
示例13: getProRateInfo
/**
* Return information about pro-rated credit or false if there is none.
*
* Returns a standard object:
* $data->description = The description of the credit
* $data->amount = The monetary amount of the credit
* $data->money = The formated monetary amount of the credit
*
* return object or false
*/
public function getProRateInfo()
{
$data = false;
$proRateAmount = 0;
if ($this->isSpreedlySubscription()) {
if (Cart66Common::isLoggedIn() && Cart66Session::get('Cart66Cart')) {
if ($subscriptionId = Cart66Session::get('Cart66Cart')->getSpreedlySubscriptionId()) {
try {
$invoiceData = array('subscription-plan-id' => $subscriptionId, 'subscriber' => array('customer-id' => Cart66Session::get('Cart66AccountId')));
$invoice = new SpreedlyInvoice();
$invoice->createFromArray($invoiceData);
$this->_creditAmount = abs((double) $invoice->invoiceData->{'line-items'}->{'line-item'}[1]->amount);
$data = new stdClass();
$data->description = $invoice->invoiceData->{'line-items'}->{'line-item'}[1]->description;
$data->amount = $this->_creditAmount;
$data->money = Cart66Common::currency($this->_creditAmount);
if ($data->amount > 0) {
$proRateAmount = $data->amount;
}
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Spreedly Invoice: " . print_r($invoice->invoiceData, true));
} catch (SpreedlyException $e) {
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Unable to locate spreedly customer: " . Cart66Session::get('Cart66AccountId'));
}
}
}
}
Cart66Session::set('Cart66ProRateAmount', $proRateAmount, true);
return $data;
}
示例14: add_shortcode_popup
public static function add_shortcode_popup()
{
global $current_screen;
//Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Thinking about adding code for shortcode popup: $current_screen->id");
$add_popup = false;
if (in_array($current_screen->id, Cart66Dialog::cart66_get_popup_screens())) {
$add_popup = true;
}
if ($add_popup) {
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Adding code for shortcode popup");
} else {
return;
}
?>
<link type="text/css" rel="stylesheet" href="<?php
echo CART66_URL;
?>
/js/cart66.css" />
<script language="javascript" type="text/javascript">
<?php
$prices = array();
$types = array();
$options = '';
$products = Cart66Product::loadProductsOutsideOfClass();
//$products = $product->getModels("where id>0", "order by name");
if (count($products)) {
$i = 0;
foreach ($products as $p) {
$optionClasses = "";
if ($p->item_number == "") {
$id = $p->id;
$type = 'id';
$description = "";
} else {
$id = $p->item_number;
$type = 'item';
$description = '(# ' . $p->item_number . ')';
}
$types[] = htmlspecialchars($type);
if (CART66_PRO && $p->is_paypal_subscription == 1) {
$sub = new Cart66PayPalSubscription($p->id);
$subPrice = strip_tags($sub->getPriceDescription($sub->offerTrial > 0, '(trial)'));
$prices[] = htmlspecialchars($subPrice);
$optionClasses .= " subscriptionProduct ";
//Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] subscription price in dialog: $subPrice");
} else {
$priceDescription = __('Price:', 'cart66') . ' ' . Cart66Common::currency($p->price);
if ($p->price_description != null) {
$priceDescription = $p->price_description;
}
$prices[] = htmlspecialchars(strip_tags($priceDescription));
}
$options .= '<option value="' . $id . '" class="' . $optionClasses . '">' . $p->name . ' ' . $description . '</option>';
$i++;
}
} else {
$options .= '<option value="">' . __('No Products', 'cart66') . '</option>';
}
$prodTypes = implode("\",\"", $types);
$prodPrices = implode("\",\"", $prices);
?>
var prodtype = new Array("<?php
echo $prodTypes;
?>
");
var prodprices = new Array("<?php
echo $prodPrices;
?>
");
function insertProductCode(){
var type = prodtype[jQuery("#productNameSelector option:selected").index()];
var prod = jQuery("#productNameSelector option:selected").val();
if(jQuery("#productStyle").val()!=""){
var style = 'style="'+jQuery("#productStyle").val()+'"';
}
else {
var style = '';
}
if(jQuery("#buttonText").val()!=""){
var text = 'text="'+jQuery("#buttonText").val()+'"';
}
else {
var text = '';
}
var quantity = jQuery("input:radio[name=quantityOptions]:checked").val();
var defaultQuantity = jQuery("#defaultQuantity").val();
if(quantity == 'user') {
if(defaultQuantity == ''){
var quantity = 'quantity="user"';
}
else {
var quantity = 'quantity="user:'+defaultQuantity+'"';
}
}
else if(quantity == 'pre'){
//.........这里部分代码省略.........
示例15: getProductPriceDescription
public function getProductPriceDescription()
{
if ($this->_productId > 0) {
$product = new Cart66Product($this->_productId);
if ($product->isPayPalSubscription()) {
$product = new Cart66PayPalSubscription($product->id);
$priceDescription = $product->getPriceDescription($product->offerTrial > 0, '(trial)');
} elseif ($product->isSpreedlySubscription()) {
$product = new Cart66Product($product->id);
$priceDescription = $product->getPriceDescription();
} elseif ($product->is_user_price == 1 || $product->gravity_form_pricing) {
$session_var_name = "userPrice_{$this->_productId}";
if ($product->gravity_form_pricing) {
$session_var_name .= '_' . $this->getFirstFormEntryId();
}
if (Cart66Session::get($session_var_name)) {
$userPrice = Cart66Session::get($session_var_name);
if ($product->min_price > 0 && $userPrice < $product->min_price) {
$userPrice = $product->min_price;
}
if ($product->max_price > 0 && $userPrice > $product->max_price) {
$userPrice = $product->max_price;
}
$priceDescription = Cart66Common::currency($userPrice);
} else {
$priceDescription = Cart66Common::currency($product->price);
}
} else {
$priceDescription = $product->getPriceDescription($this->_priceDifference);
if (is_numeric($priceDescription)) {
$priceDescription = Cart66Common::currency($priceDescription);
}
}
}
return $priceDescription;
}