本文整理汇总了PHP中fn_get_image_pairs函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_image_pairs函数的具体用法?PHP fn_get_image_pairs怎么用?PHP fn_get_image_pairs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_image_pairs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fn_staff_get_staff_member_data
/**
* Returns an array of staff member data by specified user_id
*
* @param int $user_id - items per page
* @param $lang_code - staff member identifier
* @return array
*/
function fn_staff_get_staff_member_data($user_id, $lang_code = CART_LANGUAGE)
{
$where = array('user_id' => $user_id);
$data = db_get_row('SELECT * FROM ?:staff WHERE ?w', $where);
$data['main_pair'] = fn_get_image_pairs($user_id, 'staff', 'M', true, true, $lang_code);
return $data;
}
开发者ID:MrAlejandro,项目名称:cs_cart,代码行数:14,代码来源:func.php
示例2: fn_blog_get_page_data
function fn_blog_get_page_data(&$page_data, $lang_code, $preview, $area)
{
if ($page_data['page_type'] == PAGE_TYPE_BLOG) {
$page_data['main_pair'] = fn_get_image_pairs($page_data['page_id'], 'blog', 'M', true, false, $lang_code);
$page_data['author'] = db_get_field("SELECT CONCAT(u.firstname, ' ', u.lastname) FROM ?:blog_authors as b LEFT JOIN ?:users as u ON b.user_id = u.user_id WHERE b.page_id = ?i", $page_data['page_id']);
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:7,代码来源:func.php
示例3: fn_get_aff_banner_image_data
function fn_get_aff_banner_image_data($banner_id, $image_key = 'image', $lang_code = CART_LANGUAGE)
{
$image_data = fn_get_image_pairs($banner_id, 'aff_banners', 'M', true, false, $lang_code);
if (!empty($image_data['image_id'])) {
$image_data[$image_key]['image_path'] = empty($image_data[$image_key]['image_path']) ? '' : 'http://' . Registry::get('config.http_host') . $image_data[$image_key]['image_path'];
}
return empty($image_data) ? false : $image_data;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:8,代码来源:func.php
示例4: fn_get_banner_data
function fn_get_banner_data($banner_id, $lang_code = CART_LANGUAGE)
{
$status_condition = AREA == 'A' ? '' : " AND ?:banners.status IN ('A', 'H') ";
$banner = db_get_row("SELECT ?:banners.banner_id, ?:banners.status, ?:banners.url, ?:banner_descriptions.banner, ?:banners.type, ?:banners.target, ?:banners.localization, ?:banners.timestamp, ?:banner_descriptions.description FROM ?:banners LEFT JOIN ?:banner_descriptions ON ?:banner_descriptions.banner_id = ?:banners.banner_id AND ?:banner_descriptions.lang_code = ?s WHERE ?:banners.banner_id = ?i ?p", $lang_code, $banner_id, $status_condition);
if (!empty($banner)) {
$banner['main_pair'] = fn_get_image_pairs($banner['banner_id'], 'banner', 'M', true, false, $lang_code);
}
return $banner;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:9,代码来源:func.php
示例5: fn_get_paypal_settings
function fn_get_paypal_settings($lang_code = DESCR_SL)
{
$pp_settings = Settings::instance()->getValues('paypal', 'ADDON');
if (!empty($pp_settings['general']['pp_statuses'])) {
$pp_settings['general']['pp_statuses'] = unserialize($pp_settings['general']['pp_statuses']);
}
$pp_settings['general']['main_pair'] = fn_get_image_pairs(fn_paypal_get_logo_id(), 'paypal_logo', 'M', false, true, $lang_code);
return $pp_settings['general'];
}
开发者ID:askzap,项目名称:ultimate,代码行数:9,代码来源:func.php
示例6: fn_get_store_location
function fn_get_store_location($store_location_id, $lang_code = CART_LANGUAGE)
{
$fields = array('?:store_locations.*', '?:store_location_descriptions.*', '?:country_descriptions.country as country_title');
$join = db_quote(" LEFT JOIN ?:store_location_descriptions ON ?:store_locations.store_location_id = ?:store_location_descriptions.store_location_id AND ?:store_location_descriptions.lang_code = ?s", $lang_code);
$join .= db_quote(" LEFT JOIN ?:country_descriptions ON ?:store_locations.country = ?:country_descriptions.code AND ?:country_descriptions.lang_code = ?s", $lang_code);
$condition = db_quote(" ?:store_locations.store_location_id = ?i ", $store_location_id);
$condition .= AREA == 'C' && defined('CART_LOCALIZATION') ? fn_get_localizations_condition('?:store_locations.localization') : '';
$store_location = db_get_row('SELECT ?p FROM ?:store_locations ?p WHERE ?p', implode(', ', $fields), $join, $condition);
$store_location["image_pairs"] = fn_get_image_pairs($store_location_id, 'store_locations', 'M', true, true, $lang_code);
$store_location["additional_image_pairs"] = fn_get_image_pairs($store_location_id, 'store_locations', 'A', true, true, $lang_code);
return $store_location;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:12,代码来源:func.php
示例7: fn_exim_mailru_get_image_url
function fn_exim_mailru_get_image_url($product_id, $object_type, $pair_type, $get_icon, $get_detailed, $lang_code)
{
$image_pair = fn_get_image_pairs($product_id, $object_type, $pair_type, $get_icon, $get_detailed, $lang_code);
$image_data = fn_image_to_display($image_pair, Registry::get('settings.Thumbnails.product_details_thumbnail_width'), Registry::get('settings.Thumbnails.product_details_thumbnail_height'));
if (strpos($image_data['image_path'], '.php')) {
$image_data['image_path'] = fn_generate_thumbnail($image_data['detailed_image_path'], $image_data['width'], $image_data['height']);
}
if (!empty($image_data['image_path'])) {
$url = $image_data['image_path'];
} else {
$url = '';
}
return htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
}
开发者ID:ambient-lounge,项目名称:site,代码行数:14,代码来源:tovary_mailru.functions.php
示例8: fn_advanced_menu_get_categories_post
function fn_advanced_menu_get_categories_post(&$categories_list, $params, $lang_code)
{
if (!empty($categories_list)) {
if (isset($params['block_data']) && $params['block_data']['properties']['template'] == 'blocks/categories/categories_dropdown_horizontal.tpl') {
foreach ($categories_list as $k => $v) {
$categories_list[$k]['background_image_pair'] = fn_get_image_pairs($v['category_id'], 'menu', 'M', true, true, CART_LANGUAGE);
$advanced_menu = unserialize($v['advanced_menu']);
$categories_list[$k]['advanced_menu'] = $advanced_menu;
if (isset($advanced_menu['feature_id']) && !empty($advanced_menu['feature_id'])) {
$categories_list[$k]['subcategories'][] = fn_get_feature_by_id($advanced_menu['feature_id'], $v['category_id'], $v['id_path'], $advanced_menu['number_of_variants']);
}
}
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:15,代码来源:func.php
示例9: fn_get_product_option_data
function fn_get_product_option_data($option_id, $product_id, $lang_code = DESCR_SL)
{
$extra_variant_fields = '';
$fields = "a.*, b.option_name, b.option_text, b.description, b.inner_hint, b.incorrect_message, b.comment, c.product_id";
$join = db_quote(" LEFT JOIN ?:product_options_descriptions as b ON a.option_id = b.option_id AND b.lang_code = ?s" . " LEFT JOIN ?:product_global_option_links as c ON c.option_id = a.option_id", $lang_code);
$condition = db_quote("a.option_id = ?i AND a.product_id = ?i", $option_id, $product_id);
/**
* Changes params before option data selecting
*
* @param int $option_id Option identifier
* @param int $product_id Product identifier
* @param string $fields Fields to be selected
* @param string $condition String containing SQL-query condition possibly prepended with a logical operator (AND or OR)
* @param string $join String with the complete JOIN information (JOIN type, tables and fields) for an SQL-query
* @param string $extra_variant_fields Additional variant fields to be selected
* @param string $lang_code 2-letters language code
*/
fn_set_hook('get_product_option_data_pre', $option_id, $product_id, $fields, $condition, $join, $extra_variant_fields, $lang_code);
$opt = db_get_row("SELECT " . $fields . " FROM ?:product_options as a" . $join . " WHERE " . $condition . " ORDER BY a.position");
if (!empty($opt)) {
$_cond = $opt['option_type'] == 'C' ? ' AND a.position = 1' : '';
$join = '';
if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
$extra_variant_fields .= 'IF(shared_option_variants.variant_id IS NOT NULL, shared_option_variants.modifier, a.modifier) as modifier, ';
$extra_variant_fields .= 'IF(shared_option_variants.variant_id IS NOT NULL, shared_option_variants.modifier_type, a.modifier_type) as modifier_type, ';
$join .= db_quote(' LEFT JOIN ?:ult_product_option_variants shared_option_variants ON shared_option_variants.variant_id = a.variant_id AND shared_option_variants.company_id = ?i', Registry::get('runtime.company_id'));
}
$join .= db_quote(' LEFT JOIN ?:product_option_variants_link povl ON povl.option_variant_id = a.variant_id ');
$opt['variants'] = db_get_hash_array("SELECT a.variant_id, a.position, a.modifier, a.modifier_type, a.weight_modifier, a.weight_modifier_type, a.status, a.set_by_user, {$extra_variant_fields} b.variant_name, povl.product_id AS required_product_id FROM ?:product_option_variants as a LEFT JOIN ?:product_option_variants_descriptions as b ON a.variant_id = b.variant_id AND b.lang_code = ?s {$join} WHERE a.option_id = ?i {$_cond} ORDER BY a.position", 'variant_id', $lang_code, $option_id);
if (!empty($opt['variants'])) {
foreach ($opt['variants'] as $k => $v) {
$opt['variants'][$k]['image_pair'] = fn_get_image_pairs($v['variant_id'], 'variant_image', 'V', true, true, $lang_code);
}
}
}
/**
* Changes option data
*
* @param array $opt Option data
* @param int $product_id Product identifier
* @param string $lang_code 2-letters language code
*/
fn_set_hook('get_product_option_data_post', $opt, $product_id, $lang_code);
return $opt;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:45,代码来源:fn.catalog.php
示例10: fn_get_logos
/**
* Gets all logos
* @TODO Remove "create" functionality from Getter
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
* @return array logos list
*/
function fn_get_logos($company_id = null, $layout_id = 0, $style_id = '')
{
/**
* Changes params before selecting logo
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
*/
fn_set_hook('get_logos_pre', $company_id, $layout_id, $style_id);
$condition = array();
$company_condition = '';
if (is_null($company_id)) {
if (Registry::get('runtime.company_id')) {
$company_id = Registry::get('runtime.company_id');
} elseif (fn_allowed_for('MULTIVENDOR')) {
$company_id = 0;
}
}
if (!is_null($company_id)) {
$company_condition = db_quote(' AND company_id = ?i', $company_id);
}
if (!empty($company_id) && fn_allowed_for('ULTIMATE')) {
$layout_data = Layout::instance($company_id)->getDefault();
} else {
$layout_data = array('layout_id' => Registry::get('runtime.layout.layout_id'), 'style_id' => Registry::get('runtime.layout.style_id'));
}
$layout_id = !empty($layout_id) ? $layout_id : $layout_data['layout_id'];
$style_id = !empty($style_id) ? $style_id : $layout_data['style_id'];
$condition[] = db_quote('IF(layout_id = 0, 1, IF(layout_id = ?i, 1, 0))', $layout_id);
if (!empty($style_id)) {
$condition[] = db_quote('IF(style_id = \'\', 1, IF(style_id = ?s, 1, 0))', $style_id);
}
/**
* Changes conditions before selecting logo
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
* @param array $condition Selecting conditions
* @param string $company_condition Condition by companies
*/
fn_set_hook('get_logos', $company_id, $layout_id, $style_id, $condition, $company_condition);
$logos = db_get_hash_array("SELECT * FROM ?:logos WHERE ?p ?p", 'type', implode(' AND ', $condition), $company_condition);
$logo_ids = array();
foreach ($logos as $l) {
$logo_ids[] = $l['logo_id'];
}
$images = fn_get_image_pairs($logo_ids, 'logos', 'M', true, false);
foreach ($logos as $k => $v) {
if (empty($images[$v['logo_id']])) {
$logos[$k]['image'] = array();
continue;
}
$image = reset($images[$v['logo_id']]);
$logos[$k]['image'] = $image['icon'];
}
/**
* Changes logos before returning
*
* @param int $company_id company ID
* @param int $layout_id layout ID
* @param string $style_id Style ID
* @param array $logos Selected logos
*/
fn_set_hook('get_logos_post', $company_id, $layout_id, $style_id, $logos);
return $logos;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:77,代码来源:fn.common.php
示例11: db_get_hash_array
$_products[$_k] = $_v;
if (in_array($_v['product_id'], $selected_ids)) {
$_products[$_k]['selected'] = 'Y';
$c_price += $_products[$_k]['price'];
} else {
$_products[$_k]['selected'] = 'N';
}
// Recommended products
if (in_array($_v['product_id'], $default_ids)) {
$_products[$_k]['recommended'] = 'Y';
}
$_products[$_k]['compatible_classes'] = db_get_hash_array("SELECT ?:conf_compatible_classes.slave_class_id, ?:conf_classes.group_id FROM ?:conf_compatible_classes LEFT JOIN ?:conf_classes ON ?:conf_classes.class_id = ?:conf_compatible_classes.slave_class_id WHERE ?:conf_compatible_classes.master_class_id = ?i AND ?:conf_classes.status = 'A'", 'slave_class_id', $_v['class_id']);
}
$product_configurator_groups[$k]['products_count'] = count($_products);
$product_configurator_groups[$k]['products'] = $_products;
$product_configurator_groups[$k]['main_pair'] = fn_get_image_pairs($v['group_id'], 'conf_group', 'M');
}
}
if (empty($product_configurator_groups)) {
unset($product_configurator_steps[$step_id]);
continue;
}
if (empty($current_step_id)) {
$current_step_id = $step_id;
}
Registry::set('navigation.tabs.pc_' . $step_id, array('title' => $step_value['step_name'], 'section' => 'configurator', 'js' => true));
// Substitute configuration price instead of product price
if (!empty($c_price)) {
$product['price'] = $c_price;
}
// Define list of incompatible products
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:products.post.php
示例12: fn_get_credit_cards_images
function fn_get_credit_cards_images()
{
$data = db_get_array("SELECT ?:static_data.param_id, ?:static_data_descriptions.descr FROM ?:static_data INNER JOIN ?:images_links ON ?:static_data.param_id = ?:images_links.object_id AND ?:images_links.object_type = 'credit_card' LEFT JOIN ?:static_data_descriptions ON ?:static_data.param_id = ?:static_data_descriptions.param_id WHERE ?:static_data.status = 'A' AND ?:static_data.section = 'C' ORDER BY ?:static_data.position, ?:static_data_descriptions.descr ");
if (empty($data)) {
return array();
}
$images = array();
foreach ($data as $key => $entry) {
$image = fn_get_image_pairs($entry['param_id'], 'credit_card', 'M');
if (!empty($image['icon'])) {
$image['icon']['alt'] = empty($image['icon']['alt']) ? $entry['descr'] : $image['icon']['alt'];
$images[] = $image['icon'];
}
}
return $images;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:16,代码来源:fn.common.php
示例13: fn_banners_install
function fn_banners_install()
{
// FIXME
if (DEFAULT_LANGUAGE != 'en') {
db_query("UPDATE ?:banner_images SET lang_code = ?s WHERE lang_code = ?s", DEFAULT_LANGUAGE, 'en');
// Demo data
}
$banners = db_get_array("SELECT ?:banners.banner_id, ?:banner_images.banner_image_id FROM ?:banners LEFT JOIN ?:banner_images ON ?:banner_images.banner_id = ?:banners.banner_id AND ?:banner_images.lang_code = ?s", DEFAULT_LANGUAGE);
foreach ($banners as $k => $v) {
$banners[$k]['main_pair'] = fn_get_image_pairs($v['banner_image_id'], 'promo', 'M', true, false, DEFAULT_LANGUAGE);
}
foreach (Languages::getAll() as $lang_code => $v) {
fn_banners_clone($banners, $lang_code);
}
return true;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:16,代码来源:func.php
示例14: fn_exim_get_detailed_image_url
function fn_exim_get_detailed_image_url($product_id, $object_type, $pair_type, $lang_code)
{
$image_pair = fn_get_image_pairs($product_id, $object_type, $pair_type, false, true, $lang_code);
return !empty($image_pair['detailed']['http_image_path']) ? $image_pair['detailed']['http_image_path'] : '';
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:5,代码来源:exim.php
示例15: fn_get_theme_path
//fn_set_notification('I','view>',print_r($view));
$view->assign('total_print', $total_print);
$view->assign('order_info', $order_info);
$view->assign('fonts_path', fn_get_theme_path('[relative]/[theme]/media/fonts'));
if ($order_info['shipping_cost'] != 0) {
$view->assign('shipping_cost', true);
}
if ($mode == "send_account_payment") {
if (!empty($order_info['email'])) {
fn_disable_live_editor_mode();
$html = array($view->displayMail('addons/rus_payments/print_invoice_payment.tpl', false, 'C'));
Pdf::render($html, fn_get_files_dir_path() . 'account_payment.pdf', 'save');
$data = array('order_info' => $order_info, 'total_print' => $total_print, 'fonts_path' => fn_get_theme_path('[relative]/[theme]/media/fonts'));
Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'default_company_orders_department', 'data' => $data, 'attachments' => array(fn_get_files_dir_path() . 'account_payment.pdf'), 'tpl' => 'addons/rus_payments/print_invoice_payment.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_invoice_payment.tpl', true, 'C');
}
exit;
} elseif ($mode == 'get_stamp') {
Header("Content-Type: image/png");
Header("Content-Type: image/jpg");
Header("Content-Type: image/jpeg");
Header("Content-Type: image/gif");
$path_stamp = fn_get_image_pairs($_REQUEST['payment_id'], 'stamp', 'M', true, true, DESCR_SL);
$image = fn_get_contents($path_stamp['icon']['absolute_path']);
fn_echo($image);
exit;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:orders.post.php
示例16: fn_exim_get_detailed_image_url
function fn_exim_get_detailed_image_url($product_id, $object_type, $pair_type, $lang_code)
{
$image_pair = fn_get_image_pairs($product_id, $object_type, $pair_type, false, true, $lang_code);
$protocol = fn_get_storefront_protocol();
return !empty($image_pair['detailed'][$protocol . '_image_path']) ? $image_pair['detailed'][$protocol . '_image_path'] : '';
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:6,代码来源:exim.php
示例17: prepareImages
public function prepareImages($params, $product_id = 0, $object_name = '', $main_type = 'M')
{
if (isset($params['main_pair'])) {
$_REQUEST['file_product_main_image_icon'] = array();
$_REQUEST['type_product_main_image_icon'] = array();
$_REQUEST['file_product_main_image_detailed'] = array();
$_REQUEST['type_product_main_image_detailed'] = array();
$_REQUEST['product_main_image_data'] = array();
if ($product_id != 0) {
$products_images = fn_get_image_pairs($product_id, 'product', 'M', true, true, DEFAULT_LANGUAGE);
if (!empty($products_images)) {
fn_delete_image_pair($products_images['pair_id']);
}
}
if (!empty($params['main_pair']['detailed']['image_path'])) {
$_REQUEST['file_product_main_image_detailed'][] = $params['main_pair']['detailed']['image_path'];
$_REQUEST['type_product_main_image_detailed'][] = strpos($params['main_pair']['detailed']['image_path'], '://') === false ? 'server' : 'url';
}
if (!empty($params['main_pair']['icon']['image_path'])) {
$_REQUEST['file_product_main_image_icon'][] = $params['main_pair']['icon']['image_path'];
$_REQUEST['type_product_main_image_icon'][] = strpos($params['main_pair']['icon']['image_path'], '://') === false ? 'server' : 'url';
}
$_REQUEST['product_main_image_data'][] = array('pair_id' => 0, 'type' => 'M', 'object_id' => 0, 'image_alt' => !empty($params['main_pair']['icon']['alt']) ? $params['main_pair']['icon']['alt'] : '', 'detailed_alt' => !empty($params['main_pair']['detailed']['alt']) ? $params['main_pair']['detailed']['alt'] : '');
}
if (isset($params['image_pairs'])) {
$_REQUEST['file_product_add_additional_image_icon'] = array();
$_REQUEST['type_product_add_additional_image_icon'] = array();
$_REQUEST['file_product_add_additional_image_detailed'] = array();
$_REQUEST['type_product_add_additional_image_detailed'] = array();
$_REQUEST['product_add_additional_image_data'] = array();
if ($product_id != 0) {
$additional_images = fn_get_image_pairs($product_id, 'product', 'A', true, true, DEFAULT_LANGUAGE);
foreach ($additional_images as $pair) {
fn_delete_image_pair($pair['pair_id']);
}
}
foreach ($params['image_pairs'] as $pair_id => $pair) {
if (!empty($pair['icon']['image_path'])) {
$_REQUEST['file_product_add_additional_image_icon'][] = $pair['icon']['image_path'];
$_REQUEST['type_product_add_additional_image_icon'][] = strpos($pair['icon']['image_path'], '://') === false ? 'server' : 'url';
}
if (!empty($pair['detailed']['image_path'])) {
$_REQUEST['file_product_add_additional_image_detailed'][] = $pair['detailed']['image_path'];
$_REQUEST['type_product_add_additional_image_detailed'][] = strpos($pair['detailed']['image_path'], '://') === false ? 'server' : 'url';
}
$_REQUEST['product_add_additional_image_data'][] = array('position' => !empty($pair['position']) ? $pair['position'] : 0, 'pair_id' => 0, 'type' => 'A', 'object_id' => 0, 'image_alt' => !empty($pair['icon']['alt']) ? $pair['icon']['alt'] : '', 'detailed_alt' => !empty($pair['detailed']['alt']) ? $pair['detailed']['alt'] : '');
}
}
}
开发者ID:askzap,项目名称:ultimate,代码行数:49,代码来源:Products.php
示例18: fn_yml_get_rees46_yml
function fn_yml_get_rees46_yml($filename)
{
$arr_category = array();
$company = Registry::get('addons.my_yml.company_name');
$location = Registry::get('config.http_location');
$lmod = date('Y-m-d H:i');
$modification = Registry::get('addons.rees46.modification');
header("Content-Type: text/xml;charset=utf-8");
/*============================================================================*/
// Вывод заголовка файла
$f = fopen($filename, "wb");
fwrite($f, '<?xml version="1.0" encoding="utf-8"?>' . chr(10));
fwrite($f, '<!DOCTYPE yml_catalog SYSTEM "shops.dtd">' . chr(10));
fwrite($f, '<yml_catalog date="' . $lmod . '">' . chr(10));
fwrite($f, '<shop>' . chr(10));
/*============================================================================*/
// Вывод данных о компании
fwrite($f, chr(9) . '<name>' . Registry::get('settings.Company.company_name') . '</name>' . chr(10));
fwrite($f, chr(9) . '<company>' . Registry::get('settings.Company.company_name') . '</company>' . chr(10));
fwrite($f, chr(9) . '<url>' . $location . '</url>' . chr(10));
/*============================================================================*/
fwrite($f, chr(9) . '<currencies>' . chr(10));
// <currency id="RUR" rate="1"/>
// <currency id="USD" rate="CBRF"/>
// <currency id="EUR" rate="CBRF" plus="3"/>
// <currency id="UAH" rate="5.6"/>
// <currency id="KZT" rate="0.19"/>
// Получаем список валют (только активных)
$currencies = db_get_array("SELECT * FROM ?:currencies WHERE status='A'", USERGROUP_ALL);
foreach ($currencies as $currency) {
fwrite($f, chr(9) . chr(9) . '<currency id="' . $currency['currency_code'] . '" rate="' . $currency['coefficient'] . '"/>' . chr(10));
}
fwrite($f, chr(9) . '</currencies>' . chr(10));
/*============================================================================*/
// Загружаем дерево разделов каталога
recursive_category(0, $f, $arr_category);
/*============================================================================*/
fwrite($f, chr(9) . '<offers>' . chr(10));
/*----------------------------------------------------------------------------*/
// <offer id="12341" type="vendor.model" available="true" bid="13">
// <url>http://best.seller.ru/product_page.asp?pid=12344</url>
// <price>700</price>
// <currencyId>USD</currencyId>
// <categoryId> 6 </categoryId>
// <picture>http://best.seller.ru/img/device12345.jpg</picture>
// <delivery> true </delivery>
// <local_delivery_cost>300</local_delivery_cost>
// <typePrefix> Принтер </typePrefix>
// <vendor> НP </vendor>
// <vendorCode> Q7533A </vendorCode>
// <model> Color LaserJet 3000</model>
// <description>
// A4, 64Mb, 600x600 dpi, USB 2.0, 29стр/мин ч/б / 15стр/мин цв, лотки на 100л и 250л, плотность до 175г/м, до 60000 стр/месяц
// </description>
// <manufacturer_warranty>true</manufacturer_warranty>
// <country_of_origin>Япония</country_of_origin>
// </offer>
$query = "SELECT DISTINCT\n p.product_id AS id,\n pdesc.product AS name,\n pdesc.full_description AS descript\n\t\tFROM cscart_products AS p\n\t\t\tLEFT JOIN cscart_product_features_values AS pfval\n\t\t\tON p.product_id = pfval.product_id\n\t\t\tLEFT JOIN cscart_product_descriptions AS pdesc\n \t\tON p.product_id=pdesc.product_id\n LEFT JOIN cscart_product_prices AS prices\n ON p.product_id = prices.product_id\n\t\tWHERE pdesc.lang_code='RU' AND p.status='A' AND p.amount > 0 AND prices.price > 0";
$products = db_get_array($query, USERGROUP_ALL);
foreach ($products as $product) {
$offer = 'offer id="' . $product['id'] . '" available="true"';
fwrite($f, chr(9) . chr(9) . '<' . $offer . '>' . chr(10));
// // пишем ссылку на страницу.
fwrite($f, chr(9) . chr(9) . chr(9) . '<url>' . fn_url(htmlentities('products.view?product_id=' . $product["id"])) . '</url>' . chr(10));
// вытаскиваем цену товара
$query = "SELECT price FROM\n cscart_product_prices\n WHERE product_id=" . $product['id'] . " AND usergroup_id=0";
$line1 = db_get_row($query);
$i = intval($line1['price']);
fwrite($f, chr(9) . chr(9) . chr(9) . '<price>' . $i . '</price>' . chr(10));
// здесь ставится валюта цены. в данном случае рубли
$query = "SELECT currency_code AS currency FROM cscart_currencies WHERE is_primary='Y'";
$line1 = db_get_row($query);
fwrite($f, chr(9) . chr(9) . chr(9) . '<currencyId>' . $line1['currency'] . '</currencyId>' . chr(10));
// список категорий для маркета именовали через ID категорий, и теперь получаем
// ID категории конкретного товара
$query = "SELECT category_id FROM\n cscart_products_categories WHERE product_id=" . $product['id'] . " AND link_type='M' ORDER BY category_id";
$result1 = db_get_array($query);
if (count($result1) > 0) {
$line1 = db_get_row($query);
}
fwrite($f, chr(9) . chr(9) . chr(9) . '<categoryId>' . $line1['category_id'] . '</categoryId>' . chr(10));
// изображения.
$img = fn_get_image_pairs($product["id"], "product", "M", false, true);
fwrite($f, chr(9) . chr(9) . chr(9) . '<picture>' . $img["detailed"]["http_image_path"] . '</picture>' . chr(10));
fwrite($f, chr(9) . chr(9) . chr(9) . '<delivery>true</delivery>' . chr(10));
$query = "SELECT \n\t\tp.product_id AS id,\n pfvdesc.variant AS vendor\n\tFROM cscart_products AS p\n LEFT JOIN cscart_product_features_values AS pfval\n ON pfval.product_id = p.product_id\n LEFT JOIN cscart_product_feature_variant_descriptions AS pfvdesc\n ON pfvdesc.variant_id = pfval.variant_id\n LEFT JOIN cscart_product_features_descriptions AS pfdesc\n ON pfdesc.feature_id = pfval.feature_id \n\tWHERE p.product_id =" . $product['id'] . " AND pfval.feature_id AND \n\t\t(pfdesc.description LIKE 'brand' OR \n\t\tpfdesc.description LIKE 'vendor' OR\n\t\tpfdesc.description LIKE 'бренд' OR\n\t\tpfdesc.description LIKE 'брэнд' OR\n\t\tpfdesc.description LIKE 'производитель' OR\n\t\tpfdesc.description LIKE 'торговая марка' OR\n\t\tpfdesc.description LIKE 'вендор')";
$line = db_get_row($query);
if (!empty($line['vendor'])) {
$vendor = check_xml($line['vendor']);
}
if (!empty($vendor)) {
fwrite($f, chr(9) . chr(9) . chr(9) . '<vendor>' . $vendor . '</vendor>' . chr(10));
}
// описание получаем из короткого описания товара
fwrite($f, chr(9) . chr(9) . chr(9) . '<name> ' . check_xml($product["name"]) . '</name>' . chr(10));
// описание
fwrite($f, chr(9) . chr(9) . chr(9) . '<description>' . chr(10));
fwrite($f, chr(9) . chr(9) . chr(9) . chr(9) . check_xml(strip_tags($product["descript"])) . chr(10));
fwrite($f, chr(9) . chr(9) . chr(9) . '</description>' . chr(10));
if ($modification && $modification != 'none') {
//.........这里部分代码省略.........
开发者ID:vivok,项目名称:rees46_cscart_embedded,代码行数:101,代码来源:rees46_yml.php
示例19: fn_prepare_checkout_payment_methods
function fn_prepare_checkout_payment_methods(&$cart, &$auth, $lang_code = CART_LANGUAGE)
{
static $payment_methods, $payment_groups;
// Get payment methods
if (empty($payment_methods)) {
$payment_methods = fn_get_payments(array('usergroup_ids' => $auth['usergroup_ids']));
}
// Check if payment method has surcharge rates
foreach ($payment_methods as $k => $v) {
if ($payment_methods[$k]['processor_type'] == 'C') {
continue;
}
$payment_methods[$k]['surcharge_value'] = 0;
if (floatval($v['a_surcharge'])) {
$payment_methods[$k]['surcharge_value'] += $v['a_surcharge'];
}
if (floatval($v['p_surcharge']) && !empty($cart['total'])) {
$payment_methods[$k]['surcharge_value'] += fn_format_price($cart['total'] * $v['p_surcharge'] / 100);
}
$payment_methods[$k]['image'] = fn_get_image_pairs($v['payment_id'], 'payment', 'M', true, true, $lang_code);
$payment_groups[$v['payment_category']][$k] = $payment_methods[$k];
}
if (!empty($payment_groups)) {
ksort($payment_groups);
}
fn_set_hook('prepare_checkout_payment_methods', $cart, $auth, $payment_groups);
return $payment_groups;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:28,代码来源:fn.cart.php
示例20: foreach
$addons = Registry::get('addons');
foreach ($addons as $addon_id => $addon) {
if ($view->templateExists('addons/' . $addon_id . '/views/payments/components/cc_processors/' . $processor_template)) {
$view->assign('processor_template', 'addons/' . $addon_id . '/views/payments/components/cc_processors/' . $processor_template);
break;
}
}
}
$view->assign('processor_params', $processor_data['processor_params']);
$view->assign('processor_name', $processor_data['processor']);
$view->assign('callback', $processor_data['callback']);
$view->assign('payment_id', $_REQUEST['payment_id']);
// Show methods list
} elseif ($mode == 'manage') {
$payments = fn_get_payments(DESCR_SL);
Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL));
Tygh::$app['view']->assign('payments', $payments);
Tygh::$app['view']->assign('templates', fn_get_payment_templates());
Tygh::$app['view']->assign('payment_processors', fn_get_payment_processors());
} elseif ($mode == 'update') {
$payment = fn_get_payment_method_data($_REQUEST['payment_id'], DESCR_SL);
$payment['icon'] = fn_get_image_pairs($payment['payment_id'], 'payment', 'M', true, true, DESCR_SL);
Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL));
Tygh::$app['view']->assign('payment', $payment);
Tygh::$app['view']->assign('templates', fn_get_payment_templates($payment));
Tygh::$app['view']->assign('payment_processors', fn_get_payment_processors());
Tygh::$app['view']->assign('taxes', fn_get_taxes());
if (Registry::get('runtime.company_id') && Registry::get('runtime.company_id') != $payment['company_id']) {
Tygh::$app['view']->assign('hide_for_vendor', true);
}
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:payments.php
注:本文中的fn_get_image_pairs函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论