本文整理汇总了PHP中Shopp::percentage方法的典型用法代码示例。如果您正苦于以下问题:PHP Shopp::percentage方法的具体用法?PHP Shopp::percentage怎么用?PHP Shopp::percentage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopp
的用法示例。
在下文中一共展示了Shopp::percentage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: column_rate
public function column_rate($Item)
{
extract($Item);
$rate = Shopp::percentage(Shopp::floatval($rate), array('precision' => 4));
$location = $this->countries[$country];
$label = "{$rate} — {$location}";
$edit_link = wp_nonce_url(add_query_arg('id', $id), 'shopp_edit_taxrate');
$delete_link = wp_nonce_url(add_query_arg('delete', $id), 'shopp_delete_taxrate');
echo '<a class="row-title edit" href="' . esc_url($edit_link) . '" title="' . Shopp::__('Edit') . ' "' . esc_attr($label) . '"">' . esc_html($label) . '</a>';
echo $this->row_actions(array('edit' => '<a class="edit" href="' . $edit_link . '">' . __('Edit') . '</a>', 'delete' => '<a class="delete" href="' . $delete_link . '">' . __('Delete') . '</a>'));
}
示例2: percentage
/**
* @deprecated Use Shopp::percentage()
**/
function percentage($amount, $format = array())
{
return Shopp::percentage($amount, $format);
}
示例3: _e
""><?php
_e('Disable', 'Shopp');
?>
</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' : '';
?>
示例4: _e
}
if (count($rates) == 0 && $edit === false) {
?>
<tr id="no-taxrates"><td colspan="5"><?php
_e('No tax rates, yet.', 'Shopp');
?>
</td></tr>
<?php
}
$hidden = get_hidden_columns('shopp_page_shopp-settings-taxrates');
$even = false;
foreach ($rates as $index => $taxrate) {
$defaults = array('rate' => 0, 'country' => false, 'zone' => false, 'rules' => array(), 'locals' => array(), 'haslocals' => false);
$taxrate = array_merge($defaults, $taxrate);
extract($taxrate);
$rate = Shopp::percentage(Shopp::floatval($rate), array('precision' => 4));
$location = $countries[$country];
if (isset($zone) && !empty($zone)) {
$location = $zones[$country][$zone] . ", {$location}";
}
$editurl = wp_nonce_url(add_query_arg(array('id' => $index), $this->url));
$deleteurl = wp_nonce_url(add_query_arg(array('delete' => $index), $this->url), 'shopp_delete_taxrate');
$classes = array();
if (!$even) {
$classes[] = 'alternate';
}
$even = !$even;
if ($edit !== false && $edit === $index) {
$conditions = array();
foreach ($rules as $ruleid => $rule) {
$condition_template_data = array('${id}' => $edit, '${ruleid}' => $ruleid, '${property_menu}' => menuoptions($propertymenu, $rule['p'], true), '${rulevalue}' => esc_attr($rule['v']));