本文整理汇总了PHP中olc_format_price函数的典型用法代码示例。如果您正苦于以下问题:PHP olc_format_price函数的具体用法?PHP olc_format_price怎么用?PHP olc_format_price使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了olc_format_price函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: olc_get_products_attribute_price
function olc_get_products_attribute_price($attribute_price, $tax_class, $price_special, $quantity, $prefix, $calculate_currencies = TRUE_STRING_S)
{
if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
$attribute_tax = olc_get_tax_rate($tax_class);
// check if user is allowed to see tax rates
if ($_SESSION['customers_status']['customers_status_show_price_tax'] == '0') {
$attribute_tax = '';
}
// add tax
$price_string = olc_add_tax($attribute_price, $attribute_tax) * $quantity;
if ($_SESSION['customers_status']['customers_status_discount_attributes'] == '0') {
// format price & calculate currency
$price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
if ($price_special == '1') {
$price_string = BLANK . $prefix . BLANK . $price_string . BLANK;
}
} else {
$discount = $_SESSION['customers_status']['customers_status_discount'];
$rabatt_string = $price_string - $price_string / 100 * $discount;
$price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
$rabatt_string = olc_format_price($rabatt_string, $price_special, $calculate_currencies);
if ($price_special == '1' && $price_string != $rabatt_string) {
$price_string = BLANK . $prefix . '<font color="ff0000"><s>' . $price_string . '</s></font> ' . $rabatt_string . BLANK;
} else {
$price_string = $rabatt_string;
if ($price_special == '1') {
$price_string = BLANK . $prefix . BLANK . $price_string;
}
}
}
} else {
$price_string = ' ' . NOT_ALLOWED_TO_SEE_PRICES;
}
return $price_string;
}
示例2: quote
function quote($method = '')
{
// W. Kaiser - Show missing amount for free shipping
$CurrentAmount = $_SESSION['cart']->show_total();
// W. Kaiser - Free shipping national/international
require_once DIR_FS_INC . 'olc_get_free_shipping_amount.inc.php';
olc_get_free_shipping_amount();
if (FREE_AMOUNT > 0) {
$MissingAmount = FREE_AMOUNT - $CurrentAmount;
if ($MissingAmount > 0 && MODULE_SHIPPING_FREECOUNT_DISPLAY == FALSE_STRING_L) {
return;
}
// W. Kaiser - Free shipping national/international
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREECOUNT_TEXT_TITLE);
if ($MissingAmount > 0) {
$this->quotes['error'] = MODULE_SHIPPING_FREECOUNT_TEXT_WAY . HTML_B_START . olc_format_price($MissingAmount, 1, 1, 1) . '</b>)';
} else {
$this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREECOUNT_TEXT_WAY, 'cost' => 0));
if (olc_not_null($this->icon)) {
$this->quotes['icon'] = olc_image($this->icon, $this->title);
}
}
}
return $this->quotes;
//W. Kaiser - Show missing amount for free shippin
}
示例3: process
function process()
{
global $order, $currencies;
$this->title = $_SESSION['customers_status']['customers_status_ot_discount'] . ' % ' . SUB_TITLE_OT_DISCOUNT;
if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == '1' && $_SESSION['customers_status']['customers_status_ot_discount'] != '0.00') {
$discount_price = olc_format_price($order->info['subtotal'], $price_special = 0, $calculate_currencies = false) / 100 * $_SESSION['customers_status']['customers_status_ot_discount'] * -1;
$this->output[] = array('title' => $this->title . ':', 'text' => '<font color="ff0000">' . olc_format_price($discount_price, $price_special = 1, $calculate_currencies = false) . '</font>', 'value' => $discount_price);
}
}
示例4: process
function process()
{
global $order, $currencies;
$od_amount = $this->calculate_credit($this->get_order_total());
if ($od_amount > 0) {
$this->deduction = $od_amount;
$this->output[] = array('title' => $this->title . ':', 'text' => olc_format_price($currencies->format($od_amount), 1, false), 'value' => $od_amount);
$order->info['total'] = $order->info['total'] - $od_amount;
}
}
示例5: process
function process()
{
global $order, $currencies;
$title = $this->title;
if (!CUSTOMER_SHOW_PRICE_TAX) {
if ($_SESSION['customers_status']['customers_status_add_tax_ot'] == 0) {
$title = MODULE_ORDER_TOTAL_SUBTOTAL_TITLE_NO_TAX;
}
}
$subtotal = $order->info['subtotal'];
$this->output[] = array('title' => $title . COLON, 'text' => olc_format_price($subtotal, 1, false), 'value' => $subtotal);
}
示例6: process
function process()
{
global $order, $currencies;
if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == 1) {
$sub_total_price = $order->info['subtotal'] - $order->info['subtotal'] / 100 * $_SESSION['customers_status']['customers_status_ot_discount'];
} else {
$sub_total_price = $order->info['subtotal'];
}
$this->output[] = array('title' => $this->title . ':', 'text' => HTML_B_START . olc_format_price($sub_total_price + olc_format_price($order->info['shipping_cost'], $price_special = 0, $calculate_currencies = false), $price_special = 1, $calculate_currencies = false) . HTML_B_END, 'value' => olc_format_price($sub_total_price + olc_format_price($order->info['shipping_cost'], $price_special = 0, $calculate_currencies = false), $price_special = 0, $calculate_currencies = false));
}
}
示例7: process
function process()
{
global $order, $currencies;
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == TRUE_STRING_S) {
$pass = false;
if ($_SESSION['shipping']['id'] != 'selfpickup_selfpickup') {
$country = $order->delivery['country_id'];
switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
case 'national':
if ($country == STORE_COUNTRY) {
$pass = true;
}
break;
case 'international':
if ($country != STORE_COUNTRY) {
$pass = true;
}
break;
case 'both':
$pass = true;
break;
}
}
if ($pass) {
if ($order->info['total'] - $order->info['shipping_cost'] < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) {
$delivery_country = $order->delivery['country']['id'];
$delivery_zone_id = $order->delivery['zone_id'];
$tax = olc_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $delivery_country, $delivery_zone_id);
$tax_description = olc_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $delivery_country, $delivery_zone_id);
$low_order_fee = MODULE_ORDER_TOTAL_LOWORDERFEE_FEE;
$low_order_fee_tax = olc_calculate_tax($low_order_fee, $tax);
$low_order_fee = olc_add_tax($low_order_fee, $tax);
if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
$order->info['tax'] += $low_order_fee_tax;
$order->info['tax_groups'][TAX_ADD_TAX . "{$tax_description}"] += $low_order_fee_tax;
$order->info['total'] += $low_order_fee;
} else {
if ($_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
$order->info['tax'] += $low_order_fee_tax;
$order->info['tax_groups'][TAX_NO_TAX . "{$tax_description}"] += $low_order_fee_tax;
}
$order->info['subtotal'] += $low_order_fee;
$order->info['total'] += $low_order_fee;
}
$this->output[] = array('title' => $this->title . ':', 'text' => olc_format_price($low_order_fee, 1, 1, 1), 'value' => $low_order_fee);
}
}
}
}
示例8: process
function process()
{
global $order, $currencies, $customer_id;
// if (MODULE_ORDER_TOTAL_HANDLING_HANDLING == TRUE_STRING_S) {
$freequery = olc_db_query("SELECT SUM(cb.customers_basket_quantity) AS total FROM " . TABLE_CUSTOMERS_BASKET . " cb LEFT JOIN " . TABLE_PRODUCTS . " p ON cb.products_id = p.products_id WHERE cb.customers_id = '" . $customer_id . "' AND cb.final_price < '0.01' AND p.products_price < '0.01'");
$freestuff = olc_db_fetch_array($freequery);
$freeitems = $freestuff['total'];
$handlingfree = $order->info['subtotal'] / 100 * 0.85;
$tax = olc_get_tax_rate(MODULE_ORDER_TOTAL_HANDLING_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
$tax_description = olc_get_tax_description(MODULE_ORDER_TOTAL_HANDLING_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
$order->info['tax'] += olc_calculate_tax($handlingfree, $tax);
$order->info['tax_groups']["{$tax_description}"] += olc_calculate_tax($handlingfree, $tax);
$order->info['total'] += $handlingfree + olc_calculate_tax($handlingfree, $tax);
$this->output[] = array('title' => $this->title . ':', 'text' => olc_format_price(olc_add_tax($handlingfree, $tax), true, $order->info['currency'], $order->info['currency_value']), 'value' => olc_add_tax($handlingfree, $tax));
}
示例9: process
function process()
{
global $order, $currencies;
reset($order->info['tax_groups']);
while (list($key, $value) = each($order->info['tax_groups'])) {
if ($value > 0) {
if ($_SESSION['customers_status']['customers_status_show_price_tax'] != 0) {
$this->output[] = array('title' => $key . ':', 'text' => olc_format_price($value, $price_special = 1, $calculate_currencies = false), 'value' => olc_format_price($value, $price_special = 0, $calculate_currencies = false));
}
if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
$this->output[] = array('title' => $key . ':', 'text' => olc_format_price($value, $price_special = 1, $calculate_currencies = false), 'value' => olc_format_price($value, $price_special = 0, $calculate_currencies = false));
}
}
}
}
示例10: process
function process()
{
global $order, $currencies;
$total = $order->info['total'];
$tax = $order->info['tax'];
if (CUSTOMER_SHOW_PRICE_TAX) {
$title = $this->title;
} else {
if ($_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
$total += $tax;
$title = MODULE_ORDER_TOTAL_TOTAL_TITLE_NO_TAX_BRUTTO;
} else {
$title = MODULE_ORDER_TOTAL_TOTAL_TITLE_NO_TAX;
}
}
$this->output[] = array('title' => $title . ':', 'text' => HTML_B_START . olc_format_price($total, $price_special = 1, $calculate_currencies = false) . HTML_B_END, 'value' => olc_format_price($total, $price_special = 0, $calculate_currencies = false));
}
示例11: process
function process()
{
global $order, $currencies;
// if ($_SESSION['cot_gv']) { // old code Strider
if (isset($_SESSION['cot_gv']) && $_SESSION['cot_gv'] == true) {
$order_total = $this->get_order_total();
$od_amount = $this->calculate_credit($order_total);
if ($this->calculate_tax != "None") {
$tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);
$od_amount = $this->calculate_credit($order_total);
}
$this->deduction = $od_amount;
// if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != TRUE_STRING_S)) {
// $od_amount -= $tod_amount;
// $order->info['total'] -= $tod_amount;
// }
$order->info['total'] = $order->info['total'] - $od_amount;
if ($od_amount > 0) {
$this->output[] = array('title' => $this->title . ':', 'text' => '<b><font color="ff0000">-' . olc_format_price($od_amount, $price_special = 1, $calculate_currencies = false) . '</font></b>', 'value' => olc_format_price($od_amount, $price_special = 0, $calculate_currencies = false));
}
}
}
示例12: olc_oe_get_products_attribute_price
function olc_oe_get_products_attribute_price($attribute_price, $tax_class, $price_special, $quantity, $prefix, $calculate_currencies = TRUE_STRING_S, $customer_status)
{
$customers_status_query = olc_db_query("select * from " . TABLE_CUSTOMERS_STATUS . " where customers_status_id = '" . $customer_status . "' ");
$customers_status = olc_db_fetch_array($customers_status_query);
if ($customers_status['customers_status_show_price'] == '1') {
$attribute_tax = olc_get_tax_rate($tax_class);
// check if user is allowed to see tax rates
if ($customers_status['customers_status_show_price_tax'] == '0') {
$attribute_tax = '';
}
// add tax
$price_string = olc_add_tax($attribute_price, $attribute_tax) * $quantity;
if ($customers_status['customers_status_discount_attributes'] == '0') {
// format price & calculate currency
$price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
if ($price_special == '1') {
$price_string = BLANK . $prefix . BLANK . $price_string . BLANK;
}
} else {
$discount = $customers_status['customers_status_discount'];
$rabatt_string = $price_string - $price_string / 100 * $discount;
$price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
$rabatt_string = olc_format_price($rabatt_string, $price_special, $calculate_currencies);
if ($price_special == '1' && $price_string != $rabatt_string) {
$price_string = BLANK . $prefix . '<font color="ff0000"><s>' . $price_string . '</s></font> ' . $rabatt_string . BLANK;
} else {
$price_string = $rabatt_string;
if ($price_special == '1') {
$price_string = BLANK . $prefix . BLANK . $price_string;
}
}
}
} else {
$price_string = ' ' . NOT_ALLOWED_TO_SEE_PRICES;
}
return $price_string;
}
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:37,代码来源:olc_oe_get_products_attribute_price.inc.php
示例13: array
</td>
</tr>
</table>
</td>
</tr>
';
}
}
}
if ($session_change) {
// restore old session data
$_SESSION = array();
$_SESSION = $old_session;
}
if ($cart_total > 0) {
$main_content .= str_replace(HASH, TEXT_VALUE_OF_CARTS . olc_format_price($cart_total, true, true), $whos_online_end_row);
}
}
$main_content .= str_replace(HASH, sprintf(TEXT_NUMBER_OF_CUSTOMERS, $visitors), $whos_online_end_row);
$main_content .= '
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
';
示例14: define
Released under the GNU General Public License
-----------------------------------------------------------------------------------------
Third Party contributions:
freeamountv2-p1 Autor: dwk
(c) 2004 XT - Commerce; www.xt-commerce.com
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
define('MODULE_SHIPPING_FREECOUNT_TEXT_TITLE', 'Free Shipping');
define('MODULE_SHIPPING_FREECOUNT_TEXT_DESCRIPTION', 'Free Shipping w/ Minimum Order Amount');
//define('MODULE_SHIPPING_FREECOUNT_TEXT_WAY', 'w/ $' . MODULE_SHIPPING_FREECOUNT_AMOUNT . ' minimum order');
//W. Kaiser
require_once DIR_FS_INC . 'olc_format_price.inc.php';
// W. Kaiser - Free shipping national/international
require_once DIR_FS_INC . 'olc_get_free_shipping_amount.inc.php';
olc_get_free_shipping_amount();
// W. Kaiser - Free shipping national/international
define('MODULE_SHIPPING_FREECOUNT_TEXT_WAY', 'From <b>' . olc_format_price(FREE_AMOUNT, $price_special = 1, $calculate_currencies = false) . '</b> order value onwardswie ship your order <b>without</b> shipping cost!<br/>' . ' (<font color="red"><b>Missing order amount for free shipment: </b></font>');
//W. Kaiser
define('MODULE_SHIPPING_FREECOUNT_SORT_ORDER', 'Sort Order');
define('MODULE_SHIPPING_FREEAMOUNT_ALLOWED_TITLE', 'Allowed Zones');
define('MODULE_SHIPPING_FREEAMOUNT_ALLOWED_DESC', 'Please enter the zones <b>separately</b> which should be allowed to use this modul (e. g. AT,DE (leave empty if you want to allow all zones))');
define('MODULE_SHIPPING_FREECOUNT_STATUS_TITLE', 'Enable Free Shipping with Minimum Purchase');
define('MODULE_SHIPPING_FREECOUNT_STATUS_DESC', 'Do you want to offer free shipping?');
define('MODULE_SHIPPING_FREECOUNT_DISPLAY_TITLE', 'Enable Display');
define('MODULE_SHIPPING_FREECOUNT_DISPLAY_DESC', 'Do you want to display text way if the minimum amount is not reached?');
define('MODULE_SHIPPING_FREECOUNT_AMOUNT_TITLE', 'Minimum Cost');
define('MODULE_SHIPPING_FREECOUNT_AMOUNT_DESC', 'Minimum order amount purchased before shipping is free?');
define('MODULE_SHIPPING_FREECOUNT_SORT_ORDER_TITLE', 'Display order');
define('MODULE_SHIPPING_FREECOUNT_SORT_ORDER_DESC', 'Lowest will be displayed first.');
示例15: olc_get_products_attribute_price_checkout
$data_products .= '
<tr>
<td class="main" nowrap="nowrap" align="left" valign="top" width="">' . $products_qty . ' x ' . $order_products['name'] . ' </td>
<td class="main" align="right" valign="top">' . $single_price . '</td>
<td class="main" align="right" valign="top">' . $total_price . '</td>
</tr>
';
$products_attributes = $order_products['attributes'];
if (sizeof($products_attributes) > 0) {
for ($j = 0, $n2 = sizeof($products_attributes); $j < $n2; $j++) {
$products_attribute = $products_attributes[$j];
$products_attribute_price = $products_attribute['price'];
if ($products_attribute_price != 0) {
$products_attribute_price_single = olc_get_products_attribute_price_checkout($products_attribute_price, $order_products['tax'], 1, $products_qty, $products_attribute['prefix']);
if ($products_qty != 1) {
$products_attribute_price_total = olc_format_price($products_attribute_price * $products_qty, true, true);
} else {
$products_attribute_price_total = $products_attribute_price_single;
}
} else {
$products_attribute_price = EMPTY_STRING;
}
$data_products .= ' <tr>
<td class="main" align="left" valign="top">
<nobr><small> <i> - ' . $products_attribute['option'] . COLON_BLANK . $products_attribute['value'] . '
</i></small>
</td>
<td class="main" align="right" valign="top"><i><small>' . $products_attribute_price_single . ' </i></small></nobr>
</td>
<td class="main" align="right" valign="top"><i><small>' . $products_attribute_price_single . ' </i></small></nobr>
</td>