本文整理汇总了PHP中displayCurrencyType函数的典型用法代码示例。如果您正苦于以下问题:PHP displayCurrencyType函数的具体用法?PHP displayCurrencyType怎么用?PHP displayCurrencyType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayCurrencyType函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
if (strstr($product_image, "http://")) {
$imageurl = "<img class='product_img' src='" . $product_image . "' border='0' >";
} elseif (is_file(BASE_URL . "/" . $prodimagedir . $product_image) && file_exists(BASE_URL . "/" . $prodimagedir . $product_image)) {
$imageurl = "<img class='product_img' src='" . SITE_URL . "/" . $prodimagedir . $product_image . "' border='0' >";
} else {
$imageurl = "<img class='product_img' src='" . SITE_URL . "/" . $prodimagedir . "noimage.jpg' >";
}
}
if (strlen($row["product_name"]) > 30) {
$prd_name = stripslashes(substr($row["product_name"], 0, 30));
} else {
$prd_name = stripslashes($row["product_name"]);
}
$price = $row['product_price'];
$discountstr = "";
$currency_attributes = displayCurrencyType();
$conversionRate = ConvertedCurrencyRate($currency_attributes[2]);
$converted_price = $price * $conversionRate;
$discountprice = 0;
if ($row["discount"] != "0") {
$discountprice = $converted_price - $converted_price * $row["discount"] / 100;
$discountprice = number_format($discountprice, 2, ".", "");
$discountstr = "<br>discount(" . $row["discount"] . "%)";
}
$display_product_price = number_format($converted_price, 2, ".", "");
$no_margin_class = $count_row == $cells ? 'nomargin' : '';
?>
<div class="pcm_productitem <?php
echo $no_margin_class;
?>
示例2: getCartTotalcouponCodeDicountamount
function getCartTotalcouponCodeDicountamount($userid, $couponCode)
{
global $tableprefix;
$sql = "SELECT c.*, (p.product_price+po.additional_price) AS product_price,p.product_artist_id,po.discount\n FROM " . $tableprefix . "cart c\n INNER JOIN " . $tableprefix . "product_options po ON po.product_option_id = c.product_option_id\n INNER JOIN " . $tableprefix . "products p ON p.product_id = po.product_id WHERE c.user_id = '" . addslashes($userid) . "' ";
$result = mysql_query($sql);
$total = 0;
$itemcount = 0;
$currency_attributes = displayCurrencyType();
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_array($result)) {
$converted_price = $row['product_price'];
$converted_price = number_format($converted_price, 2, ".", "");
$rate = $converted_price;
$qty = $row["quantity"];
$price = $qty * $rate;
$discountstr = "";
$discountprice = 0;
if ($row["discount"] != "0") {
$price = number_format($price, 2, ".", "");
$discountprice = $rate - $rate * $row["discount"] / 100;
$discountprice = number_format($discountprice, 2, ".", "");
$discountrate = $discountprice * $qty;
$price = $discountrate;
}
$total += $price;
}
}
$total = number_format($total, 2, ".", "");
if ($couponCode['ccDiscount'] != "") {
$total = $total * $couponCode['ccDiscount'] / 100;
}
return $total;
}
示例3: getShippingControlProduct
public static function getShippingControlProduct($productid = 0, $productOptionId = 0, $userId = "", $destination_country = "", $destination_state = "", $destination_zip = "")
{
// get shipping price for product
$resultShippingArray = clsGenerateShippingControl::getShippingPriceProduct($productid, $productOptionId, $userId, $destination_country, $destination_state, $destination_zip);
$currency_attributes = displayCurrencyType();
$shippingPrice = 0;
if (count($resultShippingArray) == 0) {
$shippingControl .= " <option value='0'>Shipping rates not available</option>";
} else {
// foreach ($productArray AS $key=>$val) {
if (count($resultShippingArray[$productOptionId]) > 0) {
$chkCnt = 0;
$error = 0;
foreach ($resultShippingArray[$productOptionId] as $eachShippingArr) {
$chkCnt++;
$radiochecked = "";
$serviceName = $val;
$display_shipping_rate = ConvertUSDollorToUserCurrency($currency_attributes[2]) * $eachShippingArr['rate'];
$display_shipping_rate = number_format($display_shipping_rate, 2, ".", "");
if ($chkCnt == 1) {
$shippingPrice = $display_shipping_rate;
}
$value1 = $eachShippingArr['service_name'] . '=>' . number_format($eachShippingArr['rate'], 2, '.', '');
$shippingControl .= "<option value='" . $value1 . "'>" . $eachShippingArr['service_name'] . " " . $currency_attributes[0] . " " . $display_shipping_rate . "</option>";
}
// for each product shipping
} else {
$shippingControl .= " <option value='0'>Shipping rates not available</option>";
}
}
$selectControl = "<select name='shipping_option_" . $productOptionId . "' id='productshipping_" . $productOptionId . "' onchange=calculateCartTotal('" . $productOptionId . "') class='chk_shipping_price' >" . $shippingControl . "</select>";
$currentControle = array("selectControl" => $selectControl, "shipppingPrice" => $shippingPrice);
// $shippingControl = "<select name='shipping_option_"+$productOptionId+"' id='productshipping"+$productOptionId+"'>". $shippingControl "</select>";
return $currentControle;
}
示例4: displayCurrencyType
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="2%"> </td>
<td>
<?php
if ($payment_completed == "false") {
?>
<table width="60%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<td width="31%" class="maintext">Total Amount</td>
<?php
$currency_attributes_gift = displayCurrencyType();
//echo $currency_attributes_gift[0];
$display_gift_total = number_format($currency_attributes_gift[1] * getCartTotal($_SESSION["sess_userid"]), 2, ".", "");
//$gift_cart_total = number_format(($currency_attributes_gift[1] * getCartTotal($_SESSION["sess_userid"]),2,".",""));
?>
<td>
<?php
echo $currency_attributes_gift[0];
echo " ";
echo $display_gift_total;
?>
</td>
</tr>
<?php
$check_shipping_enable = checkShippingEnable();