本文整理汇总了PHP中Shopp::money方法的典型用法代码示例。如果您正苦于以下问题:PHP Shopp::money方法的具体用法?PHP Shopp::money怎么用?PHP Shopp::money使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopp
的用法示例。
在下文中一共展示了Shopp::money方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_meta_box
function save_meta_box($Customer)
{
?>
<div id="misc-publishing-actions">
<?php
if ($Customer->id > 0) {
?>
<p><strong><a href="<?php
echo esc_url(add_query_arg(array('page' => 'shopp-orders', 'customer' => $Customer->id), admin_url('admin.php')));
?>
"><?php
_e('Orders', 'Shopp');
?>
</a>: </strong><?php
echo $Customer->orders;
?>
— <strong><?php
echo Shopp::money($Customer->total);
?>
</strong></p>
<p><strong><a href="<?php
echo esc_url(add_query_arg(array('page' => 'shopp-customers', 'range' => 'custom', 'start' => date('n/j/Y', $Customer->created), 'end' => date('n/j/Y', $Customer->created)), admin_url('admin.php')));
?>
"><?php
_e('Joined', 'Shopp');
?>
</a>: </strong><?php
echo date(get_option('date_format'), $Customer->created);
?>
</p>
<?php
}
do_action('shopp_customer_editor_info', $Customer);
?>
</div>
<div id="major-publishing-actions">
<input type="submit" class="button-primary" name="save" value="<?php
_e('Save Changes', 'Shopp');
?>
" />
</div>
<?php
}
示例2: strtolower
echo $statesmenu;
?>
</select>
<br />
<?php
Shopp::_e('Select your primary business location.');
?>
<br />
<?php
if (!empty($operations['country'])) {
?>
<strong><?php
Shopp::_e('Currency');
?>
: </strong><?php
echo Shopp::money(1000.0);
?>
<?php
if (shopp_setting_enabled('tax_inclusive')) {
?>
<strong>(+<?php
echo strtolower(Shopp::__('Tax'));
?>
)</strong><?php
}
?>
<?php
}
?>
</td>
</tr>
示例3: manage_meta_box
//.........这里部分代码省略.........
<?php
if (!$Purchase->isvoid()) {
?>
<script id="refund-ui" type="text/x-jquery-tmpl">
<?php
ob_start();
?>
<div class="refund misc-pub-section">
<div class="refunding">
<h4><big>${title}</big></h4>
An email will be sent to notify the customer.
<input type="hidden" name="order-action" value="${action}" />
<div><label for="message"><?php
_e('Message to the customer', 'Shopp');
?>
</label>
<textarea name="message" id="message" cols="50" rows="7" ></textarea></div>
<div class="alignright">
<div class="inline-fields">
<span>
<select name="reason">
<option>— Select —</option>
<?php
echo Shopp::menuoptions(stripslashes_deep(shopp_setting('cancel_reasons')), false, true);
?>
</select><br />
<label>${reason}</label>
</span>
<span><input type="text" name="amount" value="<?php
echo Shopp::money($Purchase->total);
?>
" ${disable_amount} /><br />
<label><?php
_e('Amount', 'Shopp');
?>
</label></span>
</div>
</div>
<div class="clear"></div>
<div class="submit">
<input type="submit" id="cancel-refund" name="cancel-refund" value="${cancel}" class="button-secondary" />
<div class="alignright">
<span class="mark-status">
<input type="hidden" name="send" value="off" />
<label title="<?php
printf(__('Enable to process through the payment gateway (%s) and set the Shopp payment status. Disable to update only the Shopp payment status.', 'Shopp'), $Gateway->name);
?>
"><input type="checkbox" name="send" value="on" <?php
if ($Gateway && $Gateway->refunds) {
echo ' checked="checked"';
}
?>
/> ${send}</label>
</span>
<input type="submit" name="process-refund" value="${process}" class="button-primary" />
</div>
</div>
</div>
</div>
<?php
$refundui = ob_get_contents();
示例4: in_array
</a></span>
<?php
}
?>
</div>
</td>
<td class="discount column-discount<?php
echo in_array('discount', $hidden) ? ' hidden' : '';
?>
"><?php
if ($Promotion->type == "Percentage Off") {
echo Shopp::percentage((double) $Promotion->discount);
}
if ($Promotion->type == "Amount Off") {
echo Shopp::money((double) $Promotion->discount);
}
if ($Promotion->type == "Free Shipping") {
echo shopp_setting("free_shipping_text");
}
if ($Promotion->type == "Buy X Get Y Free") {
Shopp::esc_html_e('Buy %s Get %s Free', $Promotion->buyqty, $Promotion->getqty);
}
?>
</td>
<td class="applied column-applied<?php
echo in_array('applied', $hidden) ? ' hidden' : '';
?>
"><?php
echo $Promotion->target;
?>
示例5: addon
/**
* Provides product addon input markup or properties for the current addon in the loop
*
* Used with `shopp('product.addons')` looping.
*
* @api `shopp('product.addon')`
* @since 1.1
*
* @param string $result The output
* @param array $options The options
* - **separator**: ` ` The separator to use between properties when requesting multiple properties
* - **units**: `on` (on,off) Include the weight unit when weight is requested as a property
* - **discounts**: `on` (on,off) When used with the **saleprice** property, shows the discounted price of the addon
* - **taxes**: `null` (on,off) Include or exclude taxes from prices
* - **input**: `null` (text,checkbox,radio,hidden) Sets the type of input to create
* - **money**: `on` (on, off) Format the amount in the current currency format
* - **number**: `off` (on, off) Provide the unformatted number (floating point)
* @param ShoppProduct $O The working object
* @return string The addon input markup or property value
**/
public static function addon($result, $options, $O)
{
$defaults = array('separator' => ' ', 'units' => 'on', 'discounts' => 'on', 'taxes' => null, 'input' => null, 'money' => 'on', 'number' => 'off');
$options = array_merge($defaults, $options);
extract($options, EXTR_SKIP);
if (isset($promos)) {
$discounts = $promos;
}
// @deprecated support for deprecated `promos` option
$types = array('hidden', 'checkbox', 'radio');
$addon = current($O->prices);
$taxes = isset($taxes) ? Shopp::str_true($taxes) : null;
$weightunit = Shopp::str_true($units) ? shopp_setting('weight_unit') : '';
$_ = array();
if (array_key_exists('id', $options)) {
$_[] = $addon->id;
}
if (array_key_exists('label', $options)) {
$_[] = $addon->label;
}
if (array_key_exists('type', $options)) {
$_[] = $addon->type;
}
if (array_key_exists('sku', $options)) {
$_[] = $addon->sku;
}
if (array_key_exists('price', $options)) {
$price = Shopp::roundprice(self::_taxed((double) $addon->price, $O, $addon->tax, $taxes));
if (Shopp::str_true($money)) {
$_[] = Shopp::money($price);
} else {
$_[] = $price;
}
}
if (array_key_exists('saleprice', $options)) {
$saleprice = Shopp::str_true($discounts) ? $addon->promoprice : $addon->saleprice;
$saleprice = Shopp::roundprice(self::_taxed((double) $addon->promoprice, $O, $addon->tax, $taxes));
if (Shopp::str_true($money)) {
$_[] = Shopp::money($saleprice);
} else {
$_[] = $saleprice;
}
}
if (array_key_exists('stock', $options)) {
$_[] = $addon->stock;
}
if (array_key_exists('weight', $options)) {
$_[] = round($addon->weight, 3) . (false !== $weightunit ? " {$weightunit}" : false);
}
if (array_key_exists('shipfee', $options)) {
$shipfee = Shopp::roundprice($addon->shipfee);
if (Shopp::str_true($money)) {
$_[] = Shopp::money($shipfee);
} else {
$_[] = $shipfee;
}
}
if (array_key_exists('sale', $options)) {
return Shopp::str_true($addon->sale);
}
if (array_key_exists('shipping', $options)) {
return Shopp::str_true($addon->shipping);
}
if (array_key_exists('tax', $options)) {
return Shopp::str_true($addon->tax);
}
if (array_key_exists('inventory', $options)) {
return Shopp::str_true($addon->inventory);
}
if (in_array($input, $types)) {
$_[] = '<input type="' . $input . '" name="products[' . (int) $O->id . '][addons][]" value="' . esc_attr($addon->id) . '"' . inputattrs($options) . ' />';
}
return join($separator, $_);
}
示例6: money
/**
* @deprecated Use Shopp::money()
**/
function money($amount, $format = array())
{
return Shopp::money($amount, $format);
}
示例7:
" class="add-new-h2"><?php
Shopp::_e('Add New');
?>
</a>
<?php
if (current_user_can('shopp_financials')) {
?>
<span class="summary"><strong><?php
echo Shopp::money($Table->ordercount->sales);
?>
</strong> <span><?php
Shopp::_e('Total Sales');
?>
</span>
<strong><?php
echo Shopp::money($Table->ordercount->avgsale);
?>
</strong> <span><?php
Shopp::_e('Average Sale');
?>
</span></span>
<?php
}
?>
</h2>
<?php
do_action('shopp_admin_notices');
?>
<form action="<?php
示例8:
<textarea name="message" id="message" cols="50" rows="7" ></textarea></div>
<div class="alignright">
<div class="inline-fields">
<span>
<select name="reason">
<option>— Select —</option>
<?php
echo Shopp::menuoptions(stripslashes_deep(shopp_setting('cancel_reasons')), false, true);
?>
</select><br />
<label>${reason}</label>
</span>
<span><input type="text" name="amount" value="<?php
echo Shopp::money($Purchase->total);
?>
" ${disable_amount} /><br />
<label><?php
_e('Amount', 'Shopp');
?>
</label></span>
</div>
</div>
<div class="clear"></div>
<div class="submit">
<input type="submit" id="cancel-refund" name="cancel-refund" value="${cancel}" class="button-secondary" />
<div class="alignright">
<span class="mark-status">
<input type="hidden" name="send" value="off" />
<label title="<?php
示例9: _e
<li><strong><?php
echo $ordercount->total;
?>
</strong> <span><?php
_e('Orders', 'Shopp');
?>
</span></li>
<li><strong><?php
echo Shopp::money($ordercount->sales);
?>
</strong> <span><?php
_e('Total Sales', 'Shopp');
?>
</span></li>
<li><strong><?php
echo Shopp::money($ordercount->avgsale);
?>
</strong> <span><?php
_e('Average Sale', 'Shopp');
?>
</span></li>
</ul>
<?php
}
?>
<div class="tablenav">
<div class="alignleft actions">
<?php
if (current_user_can('shopp_delete_orders')) {
?>
示例10: _money
/**
* Filter callback to add standard monetary option behaviors
*
* @internal
* @since 1.2
*
* @param string $result The output
* @param array $options The options
* - **money**: `on` (on, off) Format the amount in the current currency format
* - **number**: `off` (on, off) Provide the unformatted number (floating point)
* @param string $property The tag property name
* @param ShoppPurchase $O The working object
* @return ShoppPurchase The active ShoppPurchase context
**/
public static function _money($result, $options, $property, $O)
{
// Passthru for non-monetary results
$monetary = array('freight', 'subtotal', 'discount', 'shipping', 'itemaddon', 'itemtotal', 'itemunitprice', 'tax', 'total');
if (!in_array($property, $monetary) || !is_numeric($result)) {
return $result;
}
// Special case for purchase.item-addon `unitprice` option
if ('itemaddon' == $property && !in_array('uniprice', $options)) {
return $result;
}
// @deprecated currency parameter
if (isset($options['currency'])) {
$options['money'] = $options['currency'];
}
$defaults = array('money' => 'on', 'number' => false);
$options = array_merge($defaults, $options);
extract($options);
if (Shopp::str_true($number)) {
return $result;
}
if (Shopp::str_true($money)) {
$result = Shopp::money(Shopp::roundprice($result));
}
return $result;
}
示例11: get_price_html
/**
* Gets the product price in the correct money format per store settings.
*
* @param int|object $product
* @return string
*/
public function get_price_html($product)
{
$product = shopp_product($product);
if (false === $product) {
return '';
}
return Shopp::money($this->get_single_price($product));
}
示例12: esc_url
<div id="misc-publishing-actions">
<?php
if ($Customer->id > 0) {
?>
<p><strong><a href="<?php
echo esc_url(add_query_arg(array('page' => 'shopp-orders', 'customer' => $Customer->id), admin_url('admin.php')));
?>
"><?php
_e('Orders', 'Shopp');
?>
</a>: </strong><?php
echo $Customer->orders;
?>
— <strong><?php
echo Shopp::money($Customer->total);
?>
</strong></p>
<p><strong><a href="<?php
echo esc_url(add_query_arg(array('page' => 'shopp-customers', 'range' => 'custom', 'start' => date('n/j/Y', $Customer->created), 'end' => date('n/j/Y', $Customer->created)), admin_url('admin.php')));
?>
"><?php
_e('Joined', 'Shopp');
?>
</a>: </strong><?php
echo date(get_option('date_format'), $Customer->created);
?>
</p>
<?php
}
do_action('shopp_customer_editor_info', $Customer);
?>