本文整理汇总了PHP中fn_get_product_name函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_product_name函数的具体用法?PHP fn_get_product_name怎么用?PHP fn_get_product_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_product_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: fn_qwintry_create_shipment
function fn_qwintry_create_shipment($order_info, $qwintry_data = array())
{
$shipping = fn_qwintry_find_qwintry_shipping($order_info);
if (empty($shipping)) {
return false;
}
$shipping_settings = fn_get_shipping_params($shipping['shipping_id']);
$package_info = fn_qwintry_get_package_from_order_info($order_info);
$dimensions = fn_qwintry_get_biggest_package($package_info);
$invoice = fn_qwintry_save_order_invoice($order_info['order_id']);
if (!$dimensions) {
$dimensions = $shipping_settings['dimensions'];
}
$weight_data = fn_expand_weight($package_info['W']);
$pounds = $weight_data['pounds'];
if (!empty($qwintry_data['box_length']) && !empty($qwintry_data['box_width']) && !empty($qwintry_data['box_height'])) {
$dimensions = $qwintry_data;
}
if (!empty($qwintry_data['box_weight'])) {
$pounds = $qwintry_data['box_weight'];
}
$data = array('Shipment' => array('first_name' => $order_info['s_firstname'], 'last_name' => $order_info['s_lastname'], 'phone' => empty($order_info['s_phone']) ? $order_info['phone'] : $order_info['s_phone'], 'email' => $order_info['email'], 'customer_notes' => $order_info['notes'], 'weight' => $pounds > 0.1 ? $pounds : (empty($shipping_settings['default_weight']) ? 4 : $shipping_settings['default_weight']), 'dimensions' => $dimensions['box_length'] . 'x' . $dimensions['box_width'] . 'x' . $dimensions['box_height'], 'insurance' => false, 'external_id' => $order_info['order_id'], 'hub_code' => empty($shipping_settings['hub']) ? 'DE1' : $shipping_settings['hub']), 'invoices' => array(0 => array('base64_data' => base64_encode(file_get_contents($invoice)), 'base64_extension' => 'pdf')));
$data['Shipment']['addr_line1'] = $order_info['s_address'];
$data['Shipment']['addr_line2'] = $order_info['s_address_2'];
$data['Shipment']['addr_zip'] = $order_info['s_zipcode'];
$data['Shipment']['addr_state'] = fn_get_state_name($order_info['s_state'], $order_info['s_country']);
$data['Shipment']['addr_city'] = $order_info['s_city'];
$data['Shipment']['addr_country'] = $order_info['s_country'];
if (empty($shipping['extra']['type']) || $shipping['extra']['type'] == 'courier') {
$data['Shipment']['delivery_type'] = 'courier';
} elseif ($shipping['extra']['type'] == 'pickup' && !empty($shipping['extra']['point'])) {
$data['Shipment']['delivery_type'] = 'pickup';
$data['Shipment']['delivery_pickup'] = $shipping['extra']['point'];
}
if ($shipping_settings['mode'] == 'test') {
$data['Shipment']['test'] = true;
}
$cart = fn_qwintry_fn_form_cart($order_info);
foreach ($cart['products'] as $product) {
$rus_name = fn_get_product_name($product['product_id'], 'RU');
$data['items'][] = array('descr' => $product['product'], 'descr_ru' => empty($rus_name) ? $product['product'] : $rus_name, 'count' => $product['amount'], 'line_value' => fn_qwintry_get_price($product['price']), 'line_weight' => empty($product['weight']) ? 0.1 : $product['weight'], 'link' => fn_url('products.view&product_id=' . $product['product_id'], 'C'));
}
$result = fn_qwintry_send_api_request('package-create', $data, $shipping_settings);
if (!$result || empty($result->success) || !$result->success || empty($result->result->tracking)) {
if (empty($result->errorMessage)) {
return false;
}
return array('[error]' => (string) $result->errorMessage);
}
$shipment_data = array('order_id' => $order_info['order_id'], 'shipping_id' => $shipping['shipping_id'], 'tracking_number' => $result->result->tracking);
fn_qwintry_update_shipment($shipment_data, 0, 0, true);
if (fn_qwintry_save_label($order_info['order_id'] . '.pdf', $result->result->tracking, $shipping_settings) !== false) {
return true;
}
return false;
}
开发者ID:qwintry,项目名称:logistics-cscart,代码行数:56,代码来源:func.php
示例3: fn_required_products_pre_add_to_cart
function fn_required_products_pre_add_to_cart(&$product_data, &$cart, $auth, $update)
{
foreach ($product_data as $key => $entry) {
if (!empty($entry['amount']) && !empty($entry['product_id'])) {
$ids = db_get_fields('SELECT req_prod.required_id FROM ?:product_required_products as req_prod LEFT JOIN ?:products ON req_prod.required_id = ?:products.product_id WHERE req_prod.product_id = ?i AND ?:products.status != ?s', $entry['product_id'], 'D');
if (!empty($ids)) {
$have = fn_required_products_get_existent($auth, $ids);
if (empty($have) || count($have) != count($ids)) {
$products_to_cart = array_diff($ids, $have);
$out_of_stock = array();
$amounts = array();
foreach ($products_to_cart as $id) {
$amounts[$id] = fn_check_amount_in_stock($id, 1, fn_get_default_product_options($id), 0, 'N', 0, $cart);
if (!$amounts[$id]) {
$out_of_stock[] = $id;
}
}
if (empty($out_of_stock)) {
$msg = fn_get_lang_var('required_products_added');
foreach ($amounts as $id => $v) {
$product_data[$id] = array('product_id' => $id, 'amount' => $v);
$msg .= "<br />" . fn_get_product_name($id);
}
} else {
unset($product_data[$key]);
$msg = fn_get_lang_var('required_products_out_of_stock');
foreach ($out_of_stock as $id) {
$msg .= "<br />" . fn_get_product_name($id);
}
}
fn_set_notification('N', fn_get_lang_var('notice'), $msg);
}
}
}
}
return true;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:37,代码来源:func.php
示例4: fn_ult_check_store_permission
function fn_ult_check_store_permission($params, &$redirect_controller)
{
$result = true;
$controller = Registry::get('runtime.controller');
$redirect_controller = $controller;
// FIXME: move in schema
switch ($controller) {
case 'products':
if (!empty($params['product_id'])) {
$key = 'product_id';
$key_id = $params[$key];
$table = 'products';
$object_name = fn_get_product_name($key_id, DESCR_SL);
$object_type = __('product');
$check_store_permission = array('func' => 'fn_ult_check_store_permission_product', 'args' => array('$table', '$key', '$key_id'));
}
break;
case 'categories':
if (!empty($params['category_id'])) {
$key = 'category_id';
$key_id = $params[$key];
$table = 'categories';
$object_name = fn_get_category_name($key_id, DESCR_SL);
$object_type = __('category');
}
break;
case 'orders':
if (!empty($params['order_id'])) {
$key = 'order_id';
$key_id = $params[$key];
$table = 'orders';
$object_name = '#' . $key_id;
$object_type = __('order');
}
break;
case 'shippings':
if (!empty($params['shipping_id'])) {
$key = 'shipping_id';
$key_id = $params[$key];
$table = 'shippings';
$object_name = fn_get_shipping_name($key_id, DESCR_SL);
$object_type = __('shipping');
}
break;
case 'promotions':
if (!empty($params['promotion_id'])) {
$key = 'promotion_id';
$key_id = $params[$key];
$table = 'promotions';
$object_name = fn_get_promotion_name($key_id, DESCR_SL);
$object_type = __('promotion');
}
break;
case 'pages':
if (!empty($params['page_id'])) {
$key = 'page_id';
$key_id = $params[$key];
$table = 'pages';
$object_name = fn_get_page_name($key_id, DESCR_SL);
$object_type = __('content');
}
break;
case 'profiles':
if (!empty($params['user_id'])) {
$key = 'user_id';
$key_id = $params[$key];
$table = 'users';
$object_name = fn_get_user_name($key_id, DESCR_SL);
$object_type = __('user');
$check_store_permission = array('func' => 'fn_ult_check_store_permission_profiles', 'args' => array('$params', '$table', '$key', '$key_id'));
}
break;
case 'settings':
if (!empty($params['section_id'])) {
$object_name = $params['section_id'];
$object_type = __('section');
$table = 'settings';
$check_store_permission = array('func' => 'fn_ult_check_store_permission_settings', 'args' => array('$object_name'));
}
break;
case 'shipments':
if (!empty($params['shipment_id'])) {
$key = 'shipment_id';
$key_id = $params[$key];
$table = 'shipments';
$object_name = '#' . $key_id;
$object_type = __('shipment');
$check_store_permission = array('func' => 'fn_ult_check_store_permission_shipments', 'args' => array('$key_id'));
}
break;
case 'static_data':
if (!empty($params['menu_id'])) {
$key = 'menu_id';
$key_id = $params[$key];
$table = 'menus';
$object_name = fn_get_menu_name($key_id);
$object_type = __('menu');
$redirect_controller = 'menus';
}
break;
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:fn.ultimate.php
示例5: content_55d42e47dff943_86175395
//.........这里部分代码省略.........
echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => fn_get_selected_product_options_info($_smarty_tpl->tpl_vars['product']->value['product_options'])), 0);
?>
<?php
}
?>
<?php
}
?>
<?php
list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
if (isset($_capture_assign)) {
$_smarty_tpl->assign($_capture_assign, ob_get_contents());
}
if (isset($_capture_append)) {
$_smarty_tpl->append($_capture_append, ob_get_contents());
}
Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
} else {
$_smarty_tpl->capture_error();
}
?>
<?php
if ($_smarty_tpl->tpl_vars['product']->value['product']) {
?>
<?php
$_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product'], null, 0);
?>
<?php
} else {
?>
<?php
$_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable(($tmp = @htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8', true)) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp, null, 0);
?>
<?php
}
?>
<?php
echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('options' => Smarty::$_smarty_vars['capture']['product_options'], 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'product' => $_smarty_tpl->tpl_vars['product_name']->value, 'delete_id' => $_smarty_tpl->tpl_vars['product_id']->value, 'product_id' => $_smarty_tpl->tpl_vars['product']->value['product_id'], 'amount' => $_smarty_tpl->tpl_vars['product']->value['amount'], 'amount_input' => "text", 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'] . "]", 'options_array' => $_smarty_tpl->tpl_vars['product']->value['product_options']), 0);
?>
<?php
}
?>
<?php
}
?>
</table>
<?php
}
}
?>
<?php
if ($_smarty_tpl->tpl_vars['view_mode']->value != "list") {
?>
<?php
if ($_smarty_tpl->tpl_vars['extra_var']->value) {
?>
<?php
$_smarty_tpl->tpl_vars["extra_var"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['extra_var']->value), null, 0);
?>
<?php
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:cd66c416cafa55a618f2bc5b3c74cdfd0bf93d5c.tygh.picker.tpl.php
示例6: db_get_field
$inv_count = db_get_field("SELECT COUNT(*) FROM ?:product_options_inventory WHERE product_id = ?i", $_REQUEST['product_id']);
$limit = fn_paginate(empty($_REQUEST['page']) ? 1 : $_REQUEST['page'], $inv_count, Registry::get('settings.Appearance.admin_elements_per_page'));
$inventory = db_get_array("SELECT * FROM ?:product_options_inventory WHERE product_id = ?i ORDER BY position {$limit}", $_REQUEST['product_id']);
foreach ($inventory as $k => $v) {
$inventory[$k]['combination'] = fn_get_product_options_by_combination($v['combination']);
$inventory[$k]['image_pairs'] = fn_get_image_pairs($v['combination_hash'], 'product_option', 'M', true, true, DESCR_SL);
}
$product_options = fn_get_product_options($_REQUEST['product_id'], DESCR_SL, true, true);
$view->assign('product_inventory', db_get_field("SELECT tracking FROM ?:products WHERE product_id = ?i", $_REQUEST['product_id']));
$view->assign('product_options', $product_options);
$view->assign('inventory', $inventory);
//
// Product options exceptions
//
} elseif ($mode == 'exceptions') {
fn_add_breadcrumb(fn_get_product_name($_REQUEST['product_id']), "products.update?product_id={$_REQUEST['product_id']}&selected_section=options");
// I think this should be removed, not good, must be done on xml menu level
Registry::set('navigation.selected_tab', 'catalog');
Registry::set('navigation.subsection', 'products');
$exceptions = fn_get_product_exceptions($_REQUEST['product_id']);
$product_options = fn_get_product_options($_REQUEST['product_id'], DESCR_SL, true);
$product_data = fn_get_product_data($_REQUEST['product_id'], $auth, DESCR_SL, '', true, true, true, true);
$view->assign('product_options', $product_options);
$view->assign('exceptions', $exceptions);
$view->assign('product_data', $product_data);
//
// Options list
//
} elseif ($mode == 'manage') {
$params = $_REQUEST;
list($product_options, $search, $product_options_count) = fn_get_product_global_options($params, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:product_options.php
示例7: content_55dc759df31203_27161610
//.........这里部分代码省略.........
while ($_block_repeat) {
ob_start();
?>
<?php
if (!$_smarty_tpl->tpl_vars['product']->value['extra']['parent']) {
?>
<li class="ty-cart-items__list-item">
<?php
$_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart_product_info"));
$_block_repeat = true;
echo smarty_block_hook(array('name' => "checkout:minicart_product_info"), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();
?>
<?php
if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") {
?>
<div class="ty-cart-items__list-item-image">
<?php
echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "40", 'image_height' => "40", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true), 0);
?>
</div>
<?php
}
?>
<div class="ty-cart-items__list-item-desc">
<a href="<?php
echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
?>
"><?php
echo fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']);
?>
</a>
<p>
<span><?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8');
?>
</span><span> x </span><?php
echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value . "_" . (string) $_smarty_tpl->tpl_vars['dropdown_id']->value, 'class' => "none"), 0);
?>
</p>
</div>
<?php
if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") {
?>
<div class="ty-cart-items__list-item-tools cm-cart-item-delete">
<?php
if ((!$_smarty_tpl->tpl_vars['runtime']->value['checkout'] || $_smarty_tpl->tpl_vars['force_items_deletion']->value) && !$_smarty_tpl->tpl_vars['product']->value['extra']['exclude_from_calculate']) {
?>
<?php
echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete.from_status?cart_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value, 'but_meta' => "cm-ajax cm-ajax-full-render", 'but_target_id' => "cart_status*", 'but_role' => "delete", 'but_name' => "delete_cart_item"), 0);
?>
<?php
}
?>
</div>
<?php
}
?>
<?php
$_block_content = ob_get_clean();
开发者ID:AlanIsrael0,项目名称:market,代码行数:67,代码来源:2f5feee11b24b4da90e53495546e1efb944e5f3e.tygh.cart_content.tpl.php
示例8: fn_fill_certificate_products
function fn_fill_certificate_products(&$certificate_products, $stored_products = array(), $lang_code = CART_LANGUAGE)
{
if (!empty($certificate_products)) {
foreach ($certificate_products as $cp_id => $cp) {
if (!empty($stored_products)) {
$ok = false;
foreach ($stored_products as $sp_id => $sp) {
if ($cp['product_id'] == $sp['product_id']) {
if (!empty($cp['product_options']) && !empty($sp['extra']['product_options']) && array_diff($cp['product_options'], $sp['extra']['product_options']) == array() || empty($cp['product_options']) && empty($sp['extra']['product_options'])) {
if (!empty($sp['extra']['product_options_value'])) {
$certificate_products[$cp_id]['product_options_value'] = $sp['extra']['product_options_value'];
}
if (!empty($sp['extra']['product'])) {
$certificate_products[$cp_id]['product'] = $sp['extra']['product'];
}
break;
}
}
}
}
if (empty($certificate_products[$cp_id]['product_options_value']) && !empty($cp['product_options'])) {
$certificate_products[$cp_id]['product_options_value'] = fn_get_selected_product_options_info($cp['product_options']);
}
if (empty($certificate_products[$cp_id]['product'])) {
$certificate_products[$cp_id]['product'] = fn_get_product_name($cp['product_id'], $lang_code);
}
}
}
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:29,代码来源:func.php
示例9: fn_global_update
function fn_global_update($update_data)
{
$table = $field = $value = $type = array();
$msg = '';
$currencies = Registry::get('currencies');
if (!empty($update_data['product_ids'])) {
$update_data['product_ids'] = explode(',', $update_data['product_ids']);
}
// Update prices
if (!empty($update_data['price'])) {
$table[] = '?:product_prices';
$field[] = 'price';
$value[] = $update_data['price'];
$type[] = $update_data['price_type'];
$msg .= ($update_data['price'] > 0 ? fn_get_lang_var('price_increased') : fn_get_lang_var('price_decreased')) . ' ' . abs($update_data['price']) . ($update_data['price_type'] == 'A' ? $currencies[CART_PRIMARY_CURRENCY]['symbol'] : '%') . '.<br />';
}
// Update list prices
if (!empty($update_data['list_price'])) {
$table[] = '?:products';
$field[] = 'list_price';
$value[] = $update_data['list_price'];
$type[] = $update_data['list_price_type'];
$msg .= ($update_data['list_price'] > 0 ? fn_get_lang_var('list_price_increased') : fn_get_lang_var('list_price_decreased')) . ' ' . abs($update_data['list_price']) . ($update_data['list_price_type'] == 'A' ? $currencies[CART_PRIMARY_CURRENCY]['symbol'] : '%') . '.<br />';
}
// Update amount
if (!empty($update_data['amount'])) {
$table[] = '?:products';
$field[] = 'amount';
$value[] = $update_data['amount'];
$type[] = 'A';
$table[] = '?:product_options_inventory';
$field[] = 'amount';
$value[] = $update_data['amount'];
$type[] = 'A';
$msg .= ($update_data['amount'] > 0 ? fn_get_lang_var('amount_increased') : fn_get_lang_var('amount_decreased')) . ' ' . abs($update_data['amount']) . '.<br />';
}
fn_set_hook('global_update', $table, $field, $value, $type, $msg, $update_data);
$where = !empty($update_data['product_ids']) ? db_quote(" WHERE product_id IN (?n)", $update_data['product_ids']) : '';
foreach ($table as $k => $v) {
$_value = db_quote("?d", $value[$k]);
$sql_expression = $type[$k] == 'A' ? $field[$k] . ' + ' . $_value : $field[$k] . ' * (1 + ' . $_value . '/ 100)';
db_query("UPDATE {$v} SET " . $field[$k] . " = IF({$sql_expression} < 0, 0, {$sql_expression}) {$where}");
}
if (empty($update_data['product_ids'])) {
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('all_products_have_been_updated') . '<br />' . $msg);
} else {
$products = fn_get_product_name($update_data['product_ids']);
$msg = fn_get_lang_var('text_products_updated') . '<br />' . implode('<br />', $products) . '<br /><br />' . $msg;
fn_set_notification('N', fn_get_lang_var('notice'), $msg);
}
return true;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:52,代码来源:fn.products.php
示例10: fn_check_added_required_products
/**
* Checks product list and adds required products
*
* @param array $product_data Products data
* @param mixed $auth Array with authorization data
* @param array $cart
* @param array $added_products Products that are checked for further products that need to be added
* @return bool False if some products were removed, otherwise - true
*/
function fn_check_added_required_products(&$product_data, $auth, &$cart, $added_products = array())
{
$result = true;
foreach ($product_data as $key => $entry) {
if (!empty($entry['amount']) && !empty($key)) {
$product_id = !empty($entry['product_id']) ? $entry['product_id'] : $key;
$added_products[$product_id] = $entry;
$ids = fn_get_required_products_ids($product_id);
if (!empty($ids)) {
$have = fn_required_products_get_existent($auth, $ids, $cart);
if (empty($have) || count($have) != count($ids)) {
$products_to_cart = array_diff($ids, $have);
$out_of_stock = array();
$check_products = array();
foreach ($products_to_cart as $id) {
if (!empty($added_products[$id])) {
continue;
}
$amount = fn_check_amount_in_stock($id, 1, fn_get_default_product_options($id), 0, 'N', 0, $cart);
if (!$amount) {
$out_of_stock[] = $id;
} else {
$check_products[$id] = array('product_id' => $id, 'amount' => $amount);
}
}
if (empty($out_of_stock) && fn_check_added_required_products($check_products, $auth, $cart, $added_products)) {
$cart['change_cart_products'] = true;
$msg = __('required_products_added');
foreach ($check_products as $id => $v) {
if (empty($added_products[$id])) {
$added_products[$id] = $v;
$product_data[$id] = $v;
$msg .= "<br />" . fn_get_product_name($id);
$cart['amount'] = !isset($cart['amount']) ? $v['amount'] : $cart['amount'] + $v['amount'];
}
}
} else {
unset($product_data[$key]);
unset($added_products[$product_id]);
$result = false;
$msg = __('required_products_out_of_stock');
foreach ($out_of_stock as $id) {
$msg .= "<br />" . fn_get_product_name($id);
}
}
fn_set_notification('N', __('notice'), $msg);
}
}
}
}
return $result;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:61,代码来源:func.php
示例11: fn_add_breadcrumb
}
Registry::get('view')->assign('page_title', $title);
fn_add_breadcrumb($title);
if (!empty($products) || !empty($pages)) {
Registry::get('view')->assign('tag_objects_exist', true);
}
// summary mode: tag - product list, tag - product list
} elseif ($mode == 'summary') {
fn_add_breadcrumb(__('tags'));
if (!empty($auth['user_id'])) {
list($user_tags) = fn_get_tags(array('user_id' => $auth['user_id']));
foreach ($user_tags as &$tag) {
$tag['total'] = 0;
if (Registry::get('addons.tags.tags_for_products') == 'Y') {
$product_ids = db_get_fields("SELECT object_id FROM ?:tag_links WHERE object_type = ?s AND user_id = ?i AND tag_id = ?i", 'P', $auth['user_id'], $tag['tag_id']);
$tag['products'] = fn_get_product_name($product_ids);
$tag['total'] += count($product_ids);
}
if (Registry::get('addons.tags.tags_for_products') == 'Y') {
$page_ids = db_get_fields("SELECT object_id FROM ?:tag_links WHERE object_type = ?s AND user_id = ?i AND tag_id = ?i", 'A', $auth['user_id'], $tag['tag_id']);
$tag['pages'] = fn_get_page_name($page_ids);
$tag['total'] += count($page_ids);
}
}
Registry::get('view')->assign('tags_summary', $user_tags);
}
// ajax autocomplete mode
} elseif ($mode == 'list') {
if (defined('AJAX_REQUEST')) {
$tags = fn_get_tag_names(array('tag' => $_REQUEST['q']));
Registry::get('ajax')->assign('autocomplete', $tags);
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:tags.php
示例12: fn_get_groups_list
$all_groups_list = fn_get_groups_list();
$view->assign('all_groups_list', $all_groups_list);
$banners['groups'] = fn_get_aff_banners($_REQUEST['banner_type'], 'G', true);
if (!empty($banners['groups'])) {
foreach ($banners['groups'] as $k => $banner) {
if (empty($banner['group_name'])) {
unset($banners['groups'][$k]);
continue;
}
$banners['groups'][$k]['groups'] = fn_get_group_data($banner['group_id']);
if ($banners['groups'][$k]['groups']['status'] == 'D') {
unset($banners['groups'][$k]);
continue;
}
if (!empty($banners['groups'][$k]['groups']['product_ids'])) {
$banners['groups'][$k]['groups']['products'] = fn_get_product_name($banners['groups'][$k]['groups']['product_ids']);
}
}
}
// [/Groups banners]
}
if ($selected_section == 'categories') {
// [Categoties banners]
$all_categories_list = fn_get_plain_categories_tree(0, false);
$view->assign('all_categories_list', $all_categories_list);
$banners['categories'] = fn_get_aff_banners($_REQUEST['banner_type'], 'C', true);
// [/Categoties banners]
}
if ($selected_section == 'products') {
// [Products banners]
$banners['products'] = fn_get_aff_banners($_REQUEST['banner_type'], 'P', true);
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:banners_manager.php
示例13: content_55d2f42f109d54_48353855
//.........这里部分代码省略.........
}
?>
<?php
if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) {
?>
<ul class="ty-shipping-options__products">
<?php
$_smarty_tpl->tpl_vars["product"] = new Smarty_Variable();
$_smarty_tpl->tpl_vars["product"]->_loop = false;
$_from = $_smarty_tpl->tpl_vars['group']->value['products'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) {
$_smarty_tpl->tpl_vars["product"]->_loop = true;
?>
<?php
if (!($_smarty_tpl->tpl_vars['product']->value['is_edp'] == 'Y' && $_smarty_tpl->tpl_vars['product']->value['edp_shipping'] != 'Y' || $_smarty_tpl->tpl_vars['product']->value['free_shipping'] == 'Y')) {
?>
<li class="ty-shipping-options__products-item">
<?php
if ($_smarty_tpl->tpl_vars['product']->value['product']) {
?>
<?php
echo $_smarty_tpl->tpl_vars['product']->value['product'];
?>
<?php
} else {
?>
<?php
echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
?>
<?php
}
?>
</li>
<?php
}
?>
<?php
}
?>
</ul>
<?php
}
?>
<?php
if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) {
?>
<?php
if ($_smarty_tpl->tpl_vars['display']->value == "select") {
?>
<p>
<select id="ssr_<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8');
?>
" name="shipping_ids[<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8');
?>
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:918e50cdefb8f29d33a84a552077431fc82e301e.tygh.shipping_rates.tpl.php
示例14: elseif
$mail->AddAttachment("images/phpmailer_mini.gif");
// attachment
if (!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
$view->display('/views/products/autocomplete.tpl');
} elseif ($mode == 'ajax_search') {
//ini_set('display_errors', 2);
//var_dump($_GET['q']);
$key = mysql_real_escape_string($_GET['q']);
$result = array();
$product_id_row = db_get_fields("SELECT product_id, MATCH(product) AGAINST ('{$key}' IN BOOLEAN MODE) AS relevance FROM `cscart_product_descriptions` WHERE MATCH(product) AGAINST ('{$key}' IN BOOLEAN MODE) AND `lang_code` = 'RU' ORDER BY relevance DESC LIMIT 8");
foreach ($product_id_row as $product) {
$product_name = fn_get_product_name($product);
$product_amount = db_get_fields("SELECT amount, list_price FROM cscart_products WHERE `product_id` = {$product}");
if ($product_amount[0] > 0) {
$am = 'availability_ok';
} else {
$am = 'availability_no';
}
$product_price = db_get_fields("SELECT price FROM cscart_product_prices WHERE `product_id` = {$product}");
$product_img = fn_get_image_pairs($product, 'product', 'M', true, true, CART_LANGUAGE);
$result[] = $product_name . '@' . $am . '@' . $product_price[0] . '@' . $product_img['icon']['image_path'] . '@' . $product;
}
foreach ($result as $a) {
echo $a . "\n";
}
die;
} elseif ($mode == 'parseup') {
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:products.php
示例15: content_55dc81a5ed2a88_04135619
//.........这里部分代码省略.........
echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8');
?>
" class="<?php
if (!$_smarty_tpl->tpl_vars['item_ids']->value) {
?>
hidden<?php
}
?>
cm-picker-product">
<?php
echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('clone' => true, 'product' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'delete_id' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "delete_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'type' => "product", 'position_field' => $_smarty_tpl->tpl_vars['positions']->value, 'position' => "0"), 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['item_ids']->value) {
?>
<?php
$_smarty_tpl->tpl_vars["product"] = new Smarty_Variable();
$_smarty_tpl->tpl_vars["product"]->_loop = false;
$_from = $_smarty_tpl->tpl_vars['item_ids']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$_smarty_tpl->tpl_vars["product"]->index = -1;
$_smarty_tpl->tpl_vars['smarty']->value['foreach']["items"]['iteration'] = 0;
foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) {
$_smarty_tpl->tpl_vars["product"]->_loop = true;
$_smarty_tpl->tpl_vars["product"]->index++;
$_smarty_tpl->tpl_vars["product"]->first = $_smarty_tpl->tpl_vars["product&q
|
请发表评论