• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP fn_format_rate_value函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fn_format_rate_value函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_format_rate_value函数的具体用法?PHP fn_format_rate_value怎么用?PHP fn_format_rate_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fn_format_rate_value函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: smarty_modifier_format_price

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     modifier<br>
 * Name:     price<br>
 * Purpose:  getting formatted price with grouped thousands and
 *           decimal separators
 * Example:  {$price|price:"2":".":","}
 * -------------------------------------------------------------
 */
function smarty_modifier_format_price($price, $currency, $span_id = '', $class = '', $is_secondary = false, $live_editor_name = '', $live_editor_phrase = '')
{
    $value = fn_format_rate_value($price, $number_type, $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
    if (!empty($span_id) && $is_secondary) {
        $span_id = 'sec_' . $span_id;
    }
    $span_id = !empty($span_id) ? ' id="' . $span_id . '"' : '';
    $class = !empty($class) ? ' class="' . $class . '"' : '';
    $live_editor_attrs = '';
    if (Registry::get('runtime.customization_mode.live_editor') && !empty($live_editor_name)) {
        $live_editor_attrs = ' data-ca-live-editor-obj="' . $live_editor_name . '"';
        if (!empty($live_editor_phrase)) {
            $live_editor_attrs .= ' data-ca-live-editor-phrase="' . $live_editor_phrase . '"';
        }
    }
    if ($class) {
        $currency['symbol'] = '<span' . $class . '>' . $currency['symbol'] . '</span>';
    }
    $data = array('<span' . $span_id . $class . $live_editor_attrs . '>', $value, '</span>');
    if ($currency['after'] == 'Y') {
        array_push($data, '&nbsp;' . $currency['symbol']);
    } else {
        array_unshift($data, $currency['symbol']);
    }
    return implode('', $data);
}
开发者ID:askzap,项目名称:ultimate,代码行数:36,代码来源:modifier.format_price.php


示例2: fn_get_single_map_data

function fn_get_single_map_data($order_info, $auth = null)
{
    $data = array();
    $data["order_date"] = date('d-m-Y', $order_info['timestamp']);
    $data["email"] = $order_info['email'];
    $data["customer_name"] = $order_info['firstname'] . ' ' . $order_info['lastname'];
    $data["order_id"] = $order_info['order_id'];
    $products = $order_info['products'];
    $products_arr = array();
    $currencies = Registry::get('currencies');
    $currency = isset($order_info['secondary_currency']) ? $currencies[$order_info['secondary_currency']] : $currencies[CART_SECONDARY_CURRENCY];
    #modified by Hungryweb 12.10.2015
    //$data["currency_iso"] = $currency['currency_code'];
    $data["currency_iso"] = 'USD';
    foreach ($products as $product) {
        $product_id = is_array($product) ? $product['product_id'] : intval($product);
        $product_data = array();
        $product_data['url'] = fn_get_product_url($product_id);
        #modified by Hungryweb 12.10.2015
        //$product_data['name'] = fn_get_product_name($product_id,CART_LANGUAGE,false);
        $product_data['name'] = fn_specific_development_get_category($product['product_id']) . ' ' . fn_get_product_name($product_id, CART_LANGUAGE, false);
        $product_data['description'] = db_get_field("SELECT full_description FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $product_id, CART_LANGUAGE);
        if (isset($product_data['description'])) {
            $product_data['description'] = strip_tags(html_entity_decode($product_data['description'], ENT_NOQUOTES, 'UTF-8'));
        }
        $product_data['image'] = fn_get_product_image_url($product_id);
        $price = is_array($product) ? $product['base_price'] : fn_get_product_price($product_id, 1, $auth);
        $product_data['price'] = fn_format_rate_value($price, 'F', '2', '.', ',', $currency['coefficient']);
        $products_arr[$product_id] = $product_data;
    }
    $data['products'] = $products_arr;
    return $data;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:33,代码来源:func.php


示例3: formBill

 public function formBill($order_transaction, $order_info, $processor_data)
 {
     $order_total = fn_format_rate_value($order_info['total'], 'F', 2, '.', '', '');
     $user = str_replace(array('+', ' ', '(', ')', '-'), '', $order_info['payment_info']['phone']);
     $data = array('txn_id' => $order_transaction, 'from' => $processor_data['processor_params']['shop_id'], 'to' => '+' . $user, 'summ' => $order_total, 'currency' => $this->_currency, 'successUrl' => fn_url("payment_notification.return?payment=qiwi_rest"), 'failUrl' => fn_url("payment_notification.return?payment=qiwi_rest"), 'lifetime' => $processor_data['processor_params']['lifetime'] * 60, 'comm' => !empty($order_info['notice']) ? $order_info['notice'] : '');
     return $data;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:7,代码来源:Qiwi.php


示例4: register

 public function register($order_info, $protocol = 'current')
 {
     $order_total = fn_format_rate_value($order_info['total'], 'F', 2, '.', '', '');
     $order_id = $order_info['order_id'];
     $orderNumber = $order_id . '_' . substr(md5($order_id . TIME), 0, 3);
     $data = array('userName' => $this->_login, 'password' => $this->_password, 'orderNumber' => $orderNumber, 'amount' => $order_total * 100, 'returnUrl' => fn_url("payment_notification.return?payment=alfabank&ordernumber={$order_id}", AREA, $protocol), 'failUrl' => fn_url("payment_notification.error?payment=alfabank&ordernumber={$order_id}", AREA, $protocol));
     $this->_response = Http::post($this->_url . 'register.do', $data);
     $this->_response = json_decode($this->_response, true);
     if (!empty($this->_response['errorCode'])) {
         $this->_error_code = $this->_response['errorCode'];
         $this->_error_text = $this->_response['errorMessage'];
     }
     return $this->_response;
 }
开发者ID:askzap,项目名称:ask-zap,代码行数:14,代码来源:Alfabank.php


示例5: smarty_modifier_format_price

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     modifier<br>
 * Name:     price<br>
 * Purpose:  getting formatted price with grouped thousands and
 *           decimal separators
 * Example:  {$price|price:"2":".":","}
 * -------------------------------------------------------------
 */
function smarty_modifier_format_price($price, $currency, $span_id, $class = '', $is_secondary = false)
{
    $value = fn_format_rate_value($price, $number_type, $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
    if (!empty($class)) {
        $currency['symbol'] = '<span class="' . $class . '">' . $currency['symbol'] . '</span>';
    }
    if (!empty($span_id) && $is_secondary == true) {
        $span_id = 'sec_' . $span_id;
    }
    if (!empty($class) || !empty($span_id)) {
        $data = array('<span' . (!empty($span_id) ? ' id="' . $span_id . '"' : '') . (!empty($class) ? ' class="' . $class . '"' : '') . '>', $value, '</span>');
    } else {
        $data = array($value);
    }
    if ($currency['after'] == 'Y') {
        array_push($data, '&nbsp;' . $currency['symbol']);
    } else {
        array_unshift($data, $currency['symbol']);
    }
    return implode('', $data);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:modifier.format_price.php


示例6: convertSum

 public static function convertSum($price)
 {
     if (CART_PRIMARY_CURRENCY != 'RUB') {
         $currencies = Registry::get('currencies');
         if (!empty($currencies['RUB'])) {
             $currency = $currencies['RUB'];
             $price = fn_format_rate_value($price, 'F', 2, '.', '', $currency['coefficient']);
         }
     }
     return sprintf('%.2f', $price);
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:11,代码来源:Sberbank.php


示例7: array

            $data = array('order_info' => $order_info, 'total_print' => $total_print, 'fonts_path' => fn_get_theme_path('[relative]/[theme]/media/fonts'), 'url_qr_code' => $url_qr_code, 'email_subj' => __("sbrf_receipt_for_payment", array('[order_id]' => $order_info['order_id'])));
            Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'default_company_orders_department', 'data' => $data, 'attachments' => array(fn_get_files_dir_path() . 'sberbank_receipt.pdf'), 'tpl' => 'addons/rus_payments/print_sbrf_receipt.tpl', 'is_html' => true), 'A');
            fn_set_notification('N', __('notice'), __('text_email_sent'));
        }
    } else {
        $view->assign('show_print_button', true);
        $view->displayMail('addons/rus_payments/print_sbrf_receipt.tpl', true, 'C');
    }
    exit;
} elseif ($mode == 'print_invoice_payment' || $mode == 'send_account_payment') {
    $month = array(1 => 'Января', 2 => 'Февраля', 3 => 'Марта', 4 => 'Апреля', 5 => 'Мая', 6 => 'Июня', 7 => 'Июля', 8 => 'Августа', 9 => 'Сентября', 10 => 'Октября', 11 => 'Ноября', 12 => 'Декабря');
    $order_info = fn_get_order_info($_REQUEST['order_id']);
    $currencies = Registry::get('currencies');
    if (CART_SECONDARY_CURRENCY == 'RUB' && isset($currencies['RUB'])) {
        $currency = $currencies['RUB'];
        $for_rub = fn_format_rate_value($order_info['total'], 'F', $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
        if ($currency['decimals'] != 0) {
            $length_for_rub = $currency['decimals'] + 1;
            $rub = substr($for_rub, 0, -$length_for_rub);
            $length_for_kop = $currency['decimals'];
            $kop = substr($for_rub, -$length_for_kop);
            $total_print = '<strong>' . $rub . '</strong>&nbsp;' . __("sbrf_rub") . '&nbsp;<strong>' . $kop . '</strong>&nbsp;' . __("sbrf_kop");
        } else {
            $total_print = '<strong>' . $for_rub . '</strong>&nbsp;' . __("sbrf_rub");
        }
    } else {
        $total_print = fn_format_price_by_currency($order_info['total']);
    }
    $order_info['sum_tax'] = 0;
    if (!empty($order_info['taxes'])) {
        foreach ($order_info['taxes'] as $data_tax) {
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:orders.post.php


示例8: fn_get_review_ratings

function fn_get_review_ratings($thread_id, $no_attributes = false)
{
    if (!empty($thread_id) && !$no_attributes) {
        $_rating = db_get_array("SELECT a.rating, a.attr_id, a.post_id FROM ?:review_rating AS a LEFT JOIN ?:discussion_posts AS b ON a.post_id = b.post_id WHERE b.thread_id = ?i AND b.status = 'A'", $thread_id);
        if (!$_rating) {
            return array();
        }
        $post_count = db_get_field("SELECT COUNT(post_id) FROM ?:discussion_posts WHERE thread_id = ?i AND status = 'A'", $thread_id);
        $average = 0;
        ////Ruslan
        //		$attributes = Registry::get('view')->getTemplateVars('attributes');
        //
        //		foreach ($attributes as $k => $v) {
        //			$attr_ids[] = $v['attr_id'];
        //		}
        ////Ruslan/
        $average_by_attr = $_average_by_attr = $average_by_post = array();
        //
        //		foreach ($_rating as $k => $v) {
        //// 			if ($v['attr_id'] <= 6) {
        //// 				unset($_rating[$k]);
        //// 			}
        ////Ruslan
        //			if (is_array($attr_ids) && !in_array($v['attr_id'], $attr_ids)) {
        //				unset($_rating[$k]);
        //			}
        ////Ruslan/
        //		}
        $num = count($_rating);
        foreach ($_rating as $v) {
            $rating[$v['post_id']][$v['attr_id']] = $v['rating'];
            $average_by_attr[$v['attr_id']] += $v['rating'];
            $average_by_post[$v['post_id']] += $v['rating'];
            $average += $v['rating'];
        }
        foreach ($average_by_attr as $k => $v) {
            $_average_by_attr[$k]['value'] = $v / count($average_by_post);
            $_average_by_attr[$k]['value'] = fn_format_rate_value($_average_by_attr[$k]['value'], 'F');
            $_average_by_attr[$k]['percent'] = fn_format_rate_value($_average_by_attr[$k]['value'] * 100 / 5, 'P', 0);
        }
        $average_by_attr = $_average_by_attr;
        foreach ($average_by_post as $k => $v) {
            $average_by_post[$k] = $v / count($average_by_attr);
            $average_by_post[$k] = fn_format_rate_value($average_by_post[$k], 'F');
        }
        $average = $average / $num;
        return array('rating' => isset($rating) ? $rating : false, 'average_by_attr' => isset($average_by_attr) ? $average_by_attr : false, 'average_by_post' => isset($average_by_post) ? $average_by_post : false, 'average' => fn_format_rate_value($average, 'F'), 'count' => $post_count);
    } elseif (!empty($thread_id) && $no_attributes) {
        $average = db_get_field("SELECT AVG(a.rating_value) as val FROM ?:discussion_rating as a LEFT JOIN ?:discussion_posts as b ON a.post_id = b.post_id WHERE a.thread_id = ?i and b.status = 'A'", $thread_id);
        $post_count = db_get_field("SELECT COUNT(post_id) FROM ?:discussion_posts WHERE thread_id = ?i AND status = 'A'", $thread_id);
        return array('average' => $average, 'count' => $post_count);
    } else {
        return array();
    }
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:55,代码来源:func.php


示例9: fn_exim_mailru_export_price

function fn_exim_mailru_export_price($price, $decimals_separator)
{
    return fn_format_rate_value($price, 'F', 2, $decimals_separator, '', '');
}
开发者ID:ambient-lounge,项目名称:site,代码行数:4,代码来源:tovary_mailru.functions.php


示例10: fn_apply_text_placeholders

function fn_apply_text_placeholders($matches)
{
    if (isset($matches[1]) && !empty($matches[2])) {
        if ($matches[2] == 'price') {
            $currencies = Registry::get('currencies');
            $currency = $currencies[CART_SECONDARY_CURRENCY];
            $value = fn_format_rate_value($matches[1], 'F', $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
            return $currency['after'] == 'Y' ? $value . $currency['symbol'] : $currency['symbol'] . $value;
        } elseif ($matches[2] == 'weight') {
            return $matches[1] . '&nbsp;' . Registry::get('settings.General.weight_symbol');
        }
    }
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:13,代码来源:fn.common.php


示例11: fn_format_price_by_currency

function fn_format_price_by_currency($price, $currency_code = CART_SECONDARY_CURRENCY)
{
    $currencies = Registry::get('currencies');
    $currency = $currencies[$currency_code];
    $result = fn_format_rate_value($price, 'F', $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
    if ($currency['after'] == 'Y') {
        $result .= ' ' . $currency['symbol'];
    } else {
        $result = $currency['symbol'] . $result;
    }
    return $result;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:12,代码来源:fn.cart.php


示例12: fn_yandex_money_get_sum

function fn_yandex_money_get_sum($order_info, $processor_data)
{
    $price = $order_info['total'];
    if (CART_PRIMARY_CURRENCY != $processor_data['processor_params']['currency']) {
        $currencies = Registry::get('currencies');
        $currency = $currencies[$processor_data['processor_params']['currency']];
        $price = fn_format_rate_value($price, 'F', $currency['decimals'], '.', '', $currency['coefficient']);
    }
    return sprintf('%.2f', $price);
}
开发者ID:askzap,项目名称:ask-zap,代码行数:10,代码来源:yandex_money.php


示例13: fn_mailru_prepare_offer

function fn_mailru_prepare_offer($products, $options, $enclosure)
{
    //array error
    $error_products = array('products_zero_price' => '', 'disabled_products' => '', 'out_of_stock' => '', 'empty_brand' => '', 'empty_model' => '', 'disable_cat_list' => '', 'disable_cat_list_d' => '');
    //data addons mail
    $addon_settings = Registry::get('addons.rus_tovary_mailru');
    $delivery_type = $addon_settings['delivery_type'];
    list($products, $product_ids) = fn_mailru_filter_products($products, $addon_settings, $error_products);
    if (empty($products)) {
        return true;
    }
    //category
    $visible_categories = fn_mailru_get_visible_categories($addon_settings);
    $fields = array('p.product_id', 'p.mailru_brand', 'p.mailru_model', 'p.mailru_delivery', 'p.mailru_pickup', 'p.mailru_cost', 'p.mailru_type_prefix', 'p.mailru_mcp');
    $fields[] = "(\n        SELECT GROUP_CONCAT(IF(pc2.link_type = 'M', CONCAT(pc2.category_id, 'M'), pc2.category_id))\n        FROM ?:products_categories as pc2\n        WHERE product_id = p.product_id\n    ) as category_ids";
    $mailru_products = db_get_hash_array('SELECT ' . implode(', ', $fields) . ' FROM ?:products as p WHERE product_id IN (?n)', 'product_id', $product_ids);
    $products_zero_price = '';
    foreach ($products as $key => $product) {
        $products[$key]['category_ids'] = $mailru_products[$product['product_id']]['category_ids'];
    }
    $params = array('get_options' => false, 'get_taxed_prices' => false, 'detailed_params' => false);
    fn_gather_additional_products_data($products, $params);
    foreach ($products as $data) {
        $yml = array();
        if ($data['status'] != 'A') {
            continue;
        }
        if ($addon_settings['disable_cat_d'] == "Y") {
            if (!in_array($data['category'], $visible_categories)) {
                $error_products['disable_cat_list_d'] .= $data['product_name'] . ', ';
                continue;
            }
        }
        $avail = fn_is_accessible_product(array('product_id' => $data['product_id'])) ? 'true' : 'false';
        $currency = Registry::get('currencies.' . CART_PRIMARY_CURRENCY);
        $data['price'] = !empty($data['price']) ? $data['price'] : $data['price'];
        $data['price'] = fn_format_price($data['price'], $currency['currency_code'], $currency['decimals'], false);
        if (CART_PRIMARY_CURRENCY != "RUB") {
            $currencies = Registry::get('currencies');
            if (isset($currencies['RUB'])) {
                $currency = $currencies['RUB'];
                $price = fn_format_rate_value($data['price'], 'F', $currency['decimals'], $currency['decimals_separator'], $currency['thousands_separator'], $currency['coefficient']);
            } else {
                $price = $data['price'];
            }
            $price = !floatval($price) ? fn_parse_price($price) : $price;
            $delivery_cost = fn_mailru_format_price($mailru_products[$data['product_id']]['mailru_cost'], "RUB");
            $delivery_cost = !floatval($delivery_cost) ? fn_parse_price($delivery_cost) : $delivery_cost;
        } else {
            $price = !floatval($data['price']) ? fn_parse_price($data['price']) : $data['price'];
            $delivery_cost = !floatval($mailru_products[$data['product_id']]['mailru_cost']) ? fn_parse_price($mailru_products[$data['product_id']]['mailru_cost']) : $mailru_products[$data['product_id']]['mailru_cost'];
        }
        if (empty($price)) {
            $products_zero_price .= $data['product'] . ', ';
            continue;
        }
        $brand = fn_mailru_get_brand($data, $mailru_products[$data['product_id']], $addon_settings);
        $url = fn_url($data['product_url']);
        $url = htmlentities($url);
        $offer_attrs = '';
        if (!empty($mailru_products[$data['product_id']]['mailru_mcp'])) {
            $offer_attrs .= '@cbid=' . $mailru_products[$data['product_id']]['mailru_mcp'];
        }
        if (CART_PRIMARY_CURRENCY == "RUB") {
            $currency_id = "RUR";
        } elseif (CART_PRIMARY_CURRENCY == "EUR") {
            $currency_id = "EURO";
        } else {
            $currency_id = CART_PRIMARY_CURRENCY;
        }
        $image_url = fn_tovary_mailru_c_encode($data['image_url']);
        $s = urlencode("–");
        $image_url = str_replace("–", $s, $image_url);
        $yml['url'] = $url;
        $yml['price'] = $price;
        $yml['currencyId'] = $currency_id;
        $yml['categoryId'] = $data['category'];
        if (!empty($image_url)) {
            $yml['picture'] = $image_url;
        }
        if ($addon_settings['mail_settings'] == "type_name") {
            $yml['name'] = htmlspecialchars($data['product_name']);
        } elseif ($addon_settings['mail_settings'] == "type_detailed" && !empty($mailru_products[$data['product_id']]['mailru_model'])) {
            if ($addon_settings['type_prefix'] == "Y") {
                if (!empty($mailru_products[$data['product_id']]['mailru_type_prefix'])) {
                    $yml['typePrefix'] = $mailru_products[$data['product_id']]['mailru_type_prefix'];
                } else {
                    $yml['typePrefix'] = $data['category_descriptions'];
                }
            }
            if (empty($brand)) {
                $error_products['empty_brand'] .= $data['product_name'] . ', ';
            } else {
                $yml['vendor'] = $brand;
            }
            $yml['model'] = $mailru_products[$data['product_id']]['mailru_model'];
        } else {
            continue;
        }
        if (!empty($data['full_description'])) {
//.........这里部分代码省略.........
开发者ID:ambient-lounge,项目名称:site,代码行数:101,代码来源:func.php


示例14: fn_rbk_convert_price

function fn_rbk_convert_price($price, $currency_to)
{
    if (CART_PRIMARY_CURRENCY != $currency_to) {
        $currencies = Registry::get('currencies');
        $currency = $currencies[$currency_to];
        $price = fn_format_rate_value($price, 'F', $currency['decimals'], '.', '', $currency['coefficient']);
    }
    return sprintf('%.2f', $price);
}
开发者ID:ambient-lounge,项目名称:site,代码行数:9,代码来源:rbk.php


示例15: offer

 protected function offer($product)
 {
     $yml_data = array();
     $offer_attrs = '';
     $market_categories = $this->getMarketCategories();
     if (!empty($product['yml_bid'])) {
         $offer_attrs .= '@bid=' . $product['yml_bid'];
     }
     if (!empty($product['yml_cbid'])) {
         $offer_attrs .= '@cbid=' . $product['yml_cbid'];
     }
     $price_fields = array('price', 'yml_cost', 'list_price', 'base_price');
     $currency_data = Registry::get('currencies.' . CART_PRIMARY_CURRENCY);
     foreach ($price_fields as $field) {
         $product[$field] = fn_format_price($product[$field], $currency_data['currency_code'], $currency_data['decimals'], false);
     }
     if (CART_PRIMARY_CURRENCY != "RUB" && CART_PRIMARY_CURRENCY != "UAH" && CART_PRIMARY_CURRENCY != "BYR" && CART_PRIMARY_CURRENCY != "KZT") {
         $currencies = Registry::get('currencies');
         if (isset($currencies['RUB'])) {
             $currency = $currencies['RUB'];
         } elseif (isset($currencies['UAH'])) {
             $currency = $currencies['UAH'];
         } elseif (isset($currencies['BYR'])) {
             $currency = $currencies['BYR'];
         } elseif (isset($currencies['KZT'])) {
             $currency = $currencies['KZT'];
         }
         if (!empty($currency)) {
             foreach ($price_fields as $field) {
                 $product[$field] = fn_format_rate_value($product[$field], 'F', $currency['decimals'], '.', '', $currency['coefficient']);
             }
         }
     }
     foreach ($price_fields as $field) {
         if (empty($product[$field])) {
             $product[$field] = floatval($product[$field]) ? $product[$field] : fn_parse_price($product[$field]);
         }
     }
     $yml_data['url'] = $product['product_url'];
     $yml_data['price'] = !empty($product['price']) ? $product['price'] : "0.00";
     if (!empty($product['base_price']) && $product['price'] < $product['base_price'] * 0.95) {
         $yml_data['oldprice'] = $product['base_price'];
     } elseif (!empty($product['list_price']) && $product['price'] < $product['list_price'] * 0.95) {
         $yml_data['oldprice'] = $product['list_price'];
     }
     $yml_data['currencyId'] = !empty($currency) ? $currency['currency_code'] : CART_PRIMARY_CURRENCY;
     $yml_data['categoryId'] = $product['category_id'];
     if ($this->options['market_category'] == "Y") {
         if ($this->options['market_category_object'] == "category" && isset($market_categories[$product['category_id']])) {
             $yml_data['market_category'] = $market_categories[$product['category_id']];
         } elseif ($this->options['market_category_object'] == "product" && !empty($product['yml_market_category'])) {
             $yml_data['market_category'] = $product['yml_market_category'];
         }
     }
     // Images
     $picture_index = 0;
     while ($image = array_shift($product['images'])) {
         $key = 'picture';
         if ($picture_index) {
             $key .= '+' . $picture_index;
         }
         $yml_data[$key] = $this->getImageUrl($image);
         $picture_index++;
     }
     $yml_data['store'] = $product['yml_store'] == 'Y' ? 'true' : 'false';
     $yml_data['pickup'] = $product['yml_pickup'] == 'Y' ? 'true' : 'false';
     $yml_data['delivery'] = $product['yml_delivery'] == 'Y' ? 'true' : 'false';
     if ($product['yml_adult'] == 'Y') {
         $yml_data['adult'] = 'true';
     }
     if ($this->options['local_delivery_cost'] == "Y") {
         $yml_data['local_delivery_cost'] = $product['yml_cost'] == 0 ? '0' : $product['yml_cost'];
     }
     $type = '';
     if ($this->options['export_type'] == 'vendor_model') {
         $type = '@type=vendor.model';
         if ($this->options['type_prefix'] == "Y") {
             if (!empty($product['yml_type_prefix'])) {
                 $yml_data['typePrefix'] = $product['yml_type_prefix'];
             } else {
                 $yml_data['typePrefix'] = $product['category'];
             }
         }
         $yml_data['vendor'] = $product['brand'];
         if ($this->options['export_vendor_code'] == 'Y') {
             $vendor_code = $this->getVendorCode($product);
             if (!empty($vendor_code)) {
                 $yml_data['vendorCode'] = $vendor_code;
             }
         }
         $yml_data['model'] = !empty($product['yml_model']) ? $product['yml_model'] : '';
     } elseif ($this->options['export_type'] == 'simple') {
         $yml_data['name'] = $product['product'];
         if (!empty($product['brand'])) {
             $yml_data['vendor'] = $product['brand'];
         }
         if ($this->options['export_vendor_code'] == 'Y') {
             $vendor_code = $this->getVendorCode($product);
             if (!empty($vendor_code)) {
                 $yml_data['vendorCode'] = $vendor_code;
//.........这里部分代码省略.........
开发者ID:askzap,项目名称:ask-zap,代码行数:101,代码来源:Yml.php


示例16: array

             $order['items'][] = array('title' => __('tax'), 'category' => '', 'qty' => 1, 'price' => fn_format_rate_value($tax['tax_subtotal'], 'F', 0, '.', '', ''));
         }
     }
 }
 $surcharge = isset($order_info['payment_surcharge']) ? intval($order_info['payment_surcharge']) : 0;
 if ($surcharge != 0) {
     $order['items'][] = array('title' => __('payment_surcharge'), 'category' => '', 'qty' => 1, 'price' => fn_format_rate_value($order_info['payment_surcharge'], 'F', 0, '.', '', ''));
 }
 $order['details'] = array('firstname' => $order_info['b_firstname'], 'lastname' => $order_info['b_lastname'], 'middlename' => '', 'email' => $order_info['email'], 'cellphone' => $order_info['b_phone']);
 $order['partnerId'] = $processor_data['processor_params']['kvk_shop_id'];
 $order['partnerName'] = Registry::get('settings.Company.company_name');
 $order['partnerOrderId'] = $kvk_order_id;
 $order['deliveryType'] = '';
 $base = base64_encode(json_encode($order));
 $sig = fn_rus_kupivkredit_hash_order($base, $processor_data['processor_params']['kvk_secret']);
 $order_total = fn_format_rate_value($order_info['total'], 'F', 2, '.', '', '');
 $view = Registry::get('view');
 $view->assign('order_id', $order_info['order_id']);
 $view->assign('data', $order);
 $view->assign('base', $base);
 $view->assign('sig', $sig);
 $view->assign('url', $url);
 $view->assign('order_total', $order_total);
 $view->assign('url_return', fn_url("payment_notification.close?payment=kupivkredit&order_id={$order_id}", AREA, 'current'));
 $view->assign('url_decision', fn_url("payment_notification.decision?payment=kupivkredit&order_id={$order_id}", AREA, 'current'));
 if (AREA == 'A') {
     $view->display('views/orders/components/kupivkredit.tpl');
 } else {
     $view->display('views/orders/processors/kupivkredit.tpl');
 }
 exit;
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:kupivkredit.php


示例17: content_55d42e47d2cd88_81573964


//.........这里部分代码省略.........
            ?>
</label>
    <input type="text" id="gift_cert_recipient" name="gift_cert_data[recipient]" class="ty-input-text-full" size="50" maxlength="255" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['gift_cert_data']->value['recipient'], ENT_QUOTES, 'UTF-8');
            ?>
" />
</div>

<div class="ty-control-group">
    <label for="gift_cert_sender" class="ty-control-group__title cm-required"><?php 
            echo $_smarty_tpl->__("purchasers_name");
            ?>
</label>
    <input type="text" id="gift_cert_sender" name="gift_cert_data[sender]" class="ty-input-text-full" size="50" maxlength="255" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['gift_cert_data']->value['sender'], ENT_QUOTES, 'UTF-8');
            ?>
" />
</div>

<div class="ty-control-group ty-gift-certificate__amount">
    <label for="gift_cert_amount" class="ty-control-group__title cm-required cm-gc-validate-amount"><?php 
            echo $_smarty_tpl->__("amount");
            ?>
</label>
    <span class="ty-gift-certificate__currency"><?php 
            echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['secondary_currency']->value]['symbol'];
            ?>
</span>
    <input type="text" id="gift_cert_amount" name="gift_cert_data[amount]" class="ty-gift-certificate__amount-input cm-numeric" data-p-sign="s" data-a-sep="" data-a-dec="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['secondary_currency']->value]['decimals_separator'], ENT_QUOTES, 'UTF-8');
            ?>
" size="5" value="<?php 
            if ($_smarty_tpl->tpl_vars['gift_cert_data']->value) {
                echo htmlspecialchars(fn_format_rate_value($_smarty_tpl->tpl_vars['gift_cert_data']->value['amount'], '', $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['secondary_currency']->value]['decimals'], ".", '', $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['secondary_currency']->value]['coefficient']), ENT_QUOTES, 'UTF-8');
            } else {
                echo htmlspecialchars(fn_format_rate_value($_smarty_tpl->tpl_vars['addons']->value['gift_certificates']['min_amount'], '', $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['secondary_currency']->value]['decimals'], ".", '', $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['secondary_currency']->value]['coefficient']), ENT_QUOTES, 'UTF-8');
            }
            ?>
" />
    
    <div class="ty-gift-certificate__amount-alert form-field-desc"><?php 
            echo $_smarty_tpl->tpl_vars['text_gift_cert_amount_alert']->value;
            ?>
</div>
</div>

<div class="ty-control-group">
    <label for="gift_cert_message" class="ty-control-group__title"><?php 
            echo $_smarty_tpl->__("gift_comment");
            ?>
</label>
    <textarea id="gift_cert_message" name="gift_cert_data[message]" cols="72" rows="4" class="ty-input-text-full" <?php 
            if ($_smarty_tpl->tpl_vars['is_text']->value == "Y") {
                ?>
readonly="readonly"<?php 
            }
            ?>
><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['gift_cert_data']->value['message'], ENT_QUOTES, 'UTF-8');
            ?>
</textarea>
</div>

<?php 
            if ($_smarty_tpl->tpl_vars['addons']->value['gift_certificates']['free_products_allow'] == "Y") {
                ?>
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:0b2594808eeb67e6885f10bd2e698131ea71ee87.tygh.update.tpl.php



注:本文中的fn_format_rate_value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fn_gather_additional_product_data函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_format_price函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap