本文整理汇总了PHP中fn_format_rate_value函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_format_rate_value函数的具体用法?PHP fn_format_rate_value怎么用?PHP fn_format_rate_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_format_rate_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, ' ' . $currency['symbol']);
} else {
array_unshift($data, $currency['symbol']);
}
return implode('', $data);
}
示例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;
}
示例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;
}
示例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;
}
示例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, ' ' . $currency['symbol']);
} else {
array_unshift($data, $currency['symbol']);
}
return implode('', $data);
}
示例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);
}
示例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> ' . __("sbrf_rub") . ' <strong>' . $kop . '</strong> ' . __("sbrf_kop");
} else {
$total_print = '<strong>' . $for_rub . '</strong> ' . __("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) {
示例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();
}
}
示例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, '', '');
}
示例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] . ' ' . Registry::get('settings.General.weight_symbol');
}
}
}
示例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;
}
示例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);
}
示例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'])) {
//.........这里部分代码省略.........
示例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);
}
示例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;
//.........这里部分代码省略.........