本文整理汇总了PHP中fn_get_selected_product_options_info函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_selected_product_options_info函数的具体用法?PHP fn_get_selected_product_options_info怎么用?PHP fn_get_selected_product_options_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_selected_product_options_info函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: empty
}
}
}
$prev_cart_products = empty($cart['products']) ? array() : $cart['products'];
fn_add_product_to_cart($_REQUEST['product_data'], $cart, $auth);
fn_save_cart_content($cart, $auth['user_id']);
$previous_state = md5(serialize($cart['products']));
$cart['change_cart_products'] = true;
fn_calculate_cart_content($cart, $auth, 'S', true, 'F', true);
if (md5(serialize($cart['products'])) != $previous_state && empty($cart['skip_notification'])) {
$product_cnt = 0;
$added_products = array();
foreach ($cart['products'] as $key => $data) {
if (empty($prev_cart_products[$key]) || !empty($prev_cart_products[$key]) && $prev_cart_products[$key]['amount'] != $data['amount']) {
$added_products[$key] = $data;
$added_products[$key]['product_option_data'] = fn_get_selected_product_options_info($data['product_options']);
if (!empty($prev_cart_products[$key])) {
$added_products[$key]['amount'] = $data['amount'] - $prev_cart_products[$key]['amount'];
}
$product_cnt += $added_products[$key]['amount'];
}
}
if (!empty($added_products)) {
Tygh::$app['view']->assign('added_products', $added_products);
if (Registry::get('config.tweaks.disable_dhtml') && Registry::get('config.tweaks.redirect_to_cart')) {
Tygh::$app['view']->assign('continue_url', !empty($_REQUEST['redirect_url']) && empty($_REQUEST['appearance']['details_page']) ? $_REQUEST['redirect_url'] : $_SESSION['continue_url']);
}
$msg = Tygh::$app['view']->fetch('views/checkout/components/product_notification.tpl');
fn_set_notification('I', __($product_cnt > 1 ? 'products_added_to_cart' : 'product_added_to_cart'), $msg, 'I');
$cart['recalculate'] = true;
} else {
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:checkout.php
示例2: content_55d42e47dff943_86175395
//.........这里部分代码省略.........
$_smarty_tpl->tpl_vars["product_id"]->value = $_smarty_tpl->tpl_vars["product"]->key;
?>
<?php
$_smarty_tpl->_capture_stack[0][] = array("product_options", null, null);
ob_start();
?>
<?php
$_smarty_tpl->tpl_vars["prod_opts"] = new Smarty_variable(fn_get_product_options($_smarty_tpl->tpl_vars['product']->value['product_id']), null, 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['prod_opts']->value && !$_smarty_tpl->tpl_vars['product']->value['product_options']) {
?>
<strong><?php
echo $_smarty_tpl->__("options");
?>
: </strong> <?php
echo $_smarty_tpl->__("any_option_combinations");
?>
<?php
} else {
?>
<?php
if ($_smarty_tpl->tpl_vars['product']->value['product_options_value']) {
?>
<?php
echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options_value']), 0);
?>
<?php
} else {
?>
<?php
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
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:cd66c416cafa55a618f2bc5b3c74cdfd0bf93d5c.tygh.picker.tpl.php
示例3: fn_buy_together_calculate
function fn_buy_together_calculate($items, $auth = array())
{
$total_price = 0;
$product = fn_get_product_data($items['product_id'], $auth, CART_LANGUAGE, '', true, true, true, true);
fn_gather_additional_product_data($product, true, true);
$total_price += $product['price'] * $product['min_qty'];
foreach ($items['item_data']['products'] as $hash => $product) {
if (!is_integer($hash)) {
continue;
}
$_product = fn_get_product_data($product['product_id'], $auth, CART_LANGUAGE, '', true, true, true, true);
fn_gather_additional_product_data($_product, true, true);
$price = $_product['price'] * $product['amount'];
if (!empty($product['product_options'])) {
$options = fn_get_selected_product_options_info($product['product_options'], DESCR_SL);
if (!empty($options)) {
foreach ($options as $option) {
if ($option['modifier_type'] == 'A') {
$price += $option['modifier'] * $product['amount'];
} else {
$price += ($_product['price'] + $_product['price'] * $option['modifier'] / 100) * $product['amount'];
}
}
}
}
$total_price += $price;
}
$discounted_price = $total_price;
switch ($items['discount_type']) {
case 'to_fixed':
$discounted_price = $items['discount_value'];
$discount = $total_price - $items['discount_value'];
break;
case 'by_fixed':
$discounted_price -= $items['discount_value'];
$discount = $items['discount_value'];
break;
case 'to_percentage':
$discounted_price = $discounted_price / 100 * $items['discount_value'];
$discount = $total_price - $total_price / 100 * $items['discount_value'];
break;
case 'by_percentage':
$discounted_price = $discounted_price - $discounted_price / 100 * $items['discount_value'];
$discount = $total_price / 100 * $items['discount_value'];
break;
}
if ($discounted_price < 0) {
$discounted_price = 0;
}
if ($discount < 0 || $discount > $total_price) {
$discount = $total_price;
}
return array(fn_format_price($total_price), fn_format_price($discount), fn_format_price($discounted_price));
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:54,代码来源:func.php
示例4: 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
示例5: fn_twg_api_get_cart_products
function fn_twg_api_get_cart_products($cart_items, $lang_code = CART_LANGUAGE)
{
if (empty($cart_items)) {
return array();
}
$api_products = array();
$image_params = TwigmoSettings::get('images.cart');
foreach ($cart_items as $k => $item) {
$product = array('product' => db_get_field("SELECT product\n FROM ?:product_descriptions\n WHERE product_id = ?i AND lang_code = ?s", $item['product_id'], $lang_code), 'product_id' => $item['product_id'], 'cart_id' => $k, 'price' => $item['display_price'], 'exclude_from_calculate' => !empty($item['extra']['exclude_from_calculate']) ? $item['extra']['exclude_from_calculate'] : null, 'amount' => $item['amount'], 'company_id' => $item['company_id'], 'company_name' => fn_get_company_name($item['company_id']), 'extra' => !empty($item['extra']) ? $item['extra'] : array());
$qty_data = db_get_row('SELECT min_qty, max_qty, qty_step FROM ?:products WHERE product_id = ?i', $item['product_id']);
$product = array_merge($product, $qty_data);
$main_pair = !empty($item['main_pair']) ? $item['main_pair'] : fn_get_image_pairs($item['product_id'], 'product', 'M', true, true, $lang_code);
if (!empty($main_pair)) {
$product['icon'] = Api::getAsApiObject('images', TwigmoImage::getApiImageData($main_pair, 'product', 'icon', $image_params));
}
if (!empty($item['product_options'])) {
$advanced_options = fn_get_selected_product_options_info($item['product_options']);
$api_options = Api::getAsList('cart_product_options', $advanced_options);
if (!empty($api_options['option'])) {
$product['product_options'] = $api_options['option'];
}
}
$api_products[] = $product;
}
return $api_products;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:26,代码来源:func.php
示例6: content_55d31250106d44_89089488
//.........这里部分代码省略.........
?>
<div class="ty-cart-content-products__item">
<div>
<a href="<?php
echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
?>
" title="<?php
echo $_smarty_tpl->tpl_vars['product']->value['product'];
?>
"><?php
echo smarty_modifier_truncate(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['product']->value['product']), 70, "...", true);
?>
</a>
<?php
if ($_smarty_tpl->tpl_vars['use_ajax']->value == true) {
?>
<?php
$_smarty_tpl->tpl_vars["ajax_class"] = new Smarty_variable("cm-ajax", null, 0);
?>
<?php
}
?>
<a class="<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['ajax_class']->value, ENT_QUOTES, 'UTF-8');
?>
ty-delete-big" href="<?php
echo htmlspecialchars(fn_url("checkout.delete?cart_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['c_url']->value), ENT_QUOTES, 'UTF-8');
?>
" data-ca-target-id="cart_items,checkout_totals,cart_status*,checkout_steps" title="<?php
echo $_smarty_tpl->__("remove");
?>
"><i class="ty-delete-big__icon ty-icon-cancel-circle"></i></a>
<?php
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['cart']->value['products'][$_smarty_tpl->tpl_vars['key']->value]['product_options']), 'fields_prefix' => "cart_products[" . (string) $_smarty_tpl->tpl_vars['key']->value . "][product_options]"), 0);
?>
<?php
$_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:product_info"));
$_block_repeat = true;
echo smarty_block_hook(array('name' => "checkout:product_info"), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();
$_block_content = ob_get_clean();
$_block_repeat = false;
echo smarty_block_hook(array('name' => "checkout:product_info"), $_block_content, $_smarty_tpl, $_block_repeat);
}
array_pop($_smarty_tpl->smarty->_tag_stack);
?>
<input type="hidden" name="cart_products[<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
?>
][extra][parent][certificate]" value="<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['gift_key']->value, ENT_QUOTES, 'UTF-8');
?>
" />
</div>
<div class="ty-control-group">
<strong class="ty-control-group__label"><?php
echo $_smarty_tpl->__("price");
?>
</strong>
<span class="ty-control-group__item">
<?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['original_price']), 0);
?>
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:67,代码来源:a96091ca678122b9eba0cd489acd578889471464.tygh.extra_list.post.tpl.php
示例7: fn_order_placement_routines
}
fn_order_placement_routines('route', $order_id, false);
exit;
} elseif (!empty($_payment_id) && !fn_cart_is_empty($cart)) {
$base_domain = 'https://' . ($processor_data['processor_params']['test'] != 'Y' ? 'payments.amazon.com' : 'payments-sandbox.amazon.com');
$merchant_id = $processor_data['processor_params']['merchant_id'];
$_currency = $processor_data['processor_params']['currency'];
$amazon_products = $cart['products'];
fn_set_hook('amazon_products', $amazon_products, $cart);
// Get cart items
$amazon_order = array();
foreach ($amazon_products as $key => $product) {
// Get product options
$item_options = ' ';
if (!empty($product['product_options'])) {
$_options = fn_get_selected_product_options_info($cart['products'][$key]['product_options']);
foreach ($_options as $opt) {
$item_options .= $opt['option_name'] . ': ' . $opt['variant_name'] . '; ';
}
$item_options = ' [' . trim($item_options, '; ') . ']';
}
$amazon_order['Cart']['Items']['Item'][] = array('SKU' => empty($product['product_code']) ? 'pid_' . $product['product_id'] : substr(strip_tags($product['product_code']), 0, 250), 'MerchantId' => $processor_data['processor_params']['merchant_id'], 'Title' => substr(strip_tags($product['product']), 0, 250) . $item_options, 'Price' => array('Amount' => fn_format_price($product['price']), 'CurrencyCode' => $_currency), 'Quantity' => $product['amount'], 'ItemCustomData' => array('CartID' => $key));
}
$amazon_order['Cart']['CartCustomData'] = array('ClientRequestId' => base64_encode(Tygh::$app['session']->getID() . ';' . $_payment_id));
// Activate the Amazon callbacks functionality
$amazon_order['ReturnUrl'] = Registry::get('config.http_location') . '/' . Registry::get('config.customer_index') . '?dispatch=payment_notification.placement&payment=amazon_checkout';
$amazon_order['CancelUrl'] = fn_url('checkout.cart');
$amazon_order['OrderCalculationCallbacks'] = array('CalculateTaxRates' => 'true', 'CalculatePromotions' => 'true', 'CalculateShippingRates' => 'true', 'OrderCallbackEndpoint' => Registry::get('config.origin_http_location') . '/app/payments/amazon_checkout.php', 'ProcessOrderOnCallbackFailure' => $processor_data['processor_params']['process_on_failure'] == 'Y' ? 'true' : 'false');
$amazon_order['DisablePromotionCode'] = 'true';
$amazon_cart = '<?xml version="1.0" encoding="UTF-8"?>' . '<Order xmlns="http://payments.amazon.com/checkout/2009-05-15/">' . fn_array_to_xml($amazon_order) . '</Order>';
// Calculate cart signature
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:amazon_checkout.php
示例8: fn_get_order_info
function fn_get_order_info($order_id, $native_language = false, $format_info = true, $get_edp_files = false, $skip_static_values = false)
{
if (!empty($order_id)) {
$condition = fn_get_company_condition('?:orders.company_id');
$order = db_get_row("SELECT * FROM ?:orders WHERE ?:orders.order_id = ?i {$condition}", $order_id);
if (!empty($order)) {
$lang_code = $native_language == true ? $order['lang_code'] : CART_LANGUAGE;
if (isset($order['ip_address'])) {
$order['ip_address'] = fn_ip_from_db($order['ip_address']);
}
$order['payment_method'] = fn_get_payment_method_data($order['payment_id'], $lang_code);
// Get additional profile fields
$additional_fields = db_get_hash_single_array("SELECT field_id, value FROM ?:profile_fields_data " . "WHERE object_id = ?i AND object_type = 'O'", array('field_id', 'value'), $order_id);
$order['fields'] = $additional_fields;
$order['products'] = db_get_hash_array("SELECT ?:order_details.*, ?:product_descriptions.product, ?:products.status as product_status FROM ?:order_details " . "LEFT JOIN ?:product_descriptions ON ?:order_details.product_id = ?:product_descriptions.product_id AND ?:product_descriptions.lang_code = ?s " . "LEFT JOIN ?:products ON ?:order_details.product_id = ?:products.product_id " . "WHERE ?:order_details.order_id = ?i ORDER BY ?:product_descriptions.product", 'item_id', $lang_code, $order_id);
$order['promotions'] = unserialize($order['promotions']);
if (!empty($order['promotions'])) {
// collect additional data
$params = array('promotion_id' => array_keys($order['promotions']));
list($promotions) = fn_get_promotions($params);
foreach ($promotions as $pr_id => $p) {
$order['promotions'][$pr_id]['name'] = $p['name'];
$order['promotions'][$pr_id]['short_description'] = $p['short_description'];
}
}
// Get additional data
$additional_data = db_get_hash_single_array("SELECT type, data FROM ?:order_data WHERE order_id = ?i", array('type', 'data'), $order_id);
$order['taxes'] = array();
$order['tax_subtotal'] = 0;
$order['display_shipping_cost'] = $order['shipping_cost'];
// Replace country, state and title values with their descriptions
$order_company_id = isset($order['company_id']) ? $order['company_id'] : '';
// company_id will be rewritten by user field, so need to save it.
fn_add_user_data_descriptions($order, $lang_code);
$order['company_id'] = $order_company_id;
$order['need_shipping'] = false;
$deps = array();
// Get shipping information
if (!empty($additional_data['L'])) {
$order['shipping'] = unserialize($additional_data['L']);
foreach ($order['shipping'] as $key => $v) {
$shipping_id = isset($v['shipping_id']) ? $v['shipping_id'] : 0;
$shipping_name = fn_get_shipping_name($shipping_id, $lang_code);
if ($shipping_name) {
$order['shipping'][$key]['shipping'] = $shipping_name;
}
}
}
if (!fn_allowed_for('ULTIMATE:FREE')) {
// Get shipments common information
$order['shipment_ids'] = db_get_fields("SELECT sh.shipment_id FROM ?:shipments AS sh LEFT JOIN ?:shipment_items AS s_items ON (sh.shipment_id = s_items.shipment_id) " . "WHERE s_items.order_id = ?i GROUP BY s_items.shipment_id", $order_id);
$_products = db_get_array("SELECT item_id, SUM(amount) AS amount FROM ?:shipment_items WHERE order_id = ?i GROUP BY item_id", $order_id);
$shipped_products = array();
if (!empty($_products)) {
foreach ($_products as $_product) {
$shipped_products[$_product['item_id']] = $_product['amount'];
}
}
unset($_products);
}
foreach ($order['products'] as $k => $v) {
//Check for product existance
if (empty($v['product'])) {
$order['products'][$k]['deleted_product'] = true;
} else {
$order['products'][$k]['deleted_product'] = false;
}
$order['products'][$k]['discount'] = 0;
$v['extra'] = @unserialize($v['extra']);
if ($order['products'][$k]['deleted_product'] == true && !empty($v['extra']['product'])) {
$order['products'][$k]['product'] = $v['extra']['product'];
} else {
$order['products'][$k]['product'] = fn_get_product_name($v['product_id'], $lang_code);
}
$order['products'][$k]['company_id'] = empty($v['extra']['company_id']) ? 0 : $v['extra']['company_id'];
if (!empty($v['extra']['discount']) && floatval($v['extra']['discount'])) {
$order['products'][$k]['discount'] = $v['extra']['discount'];
$order['use_discount'] = true;
}
if (!empty($v['extra']['promotions'])) {
$order['products'][$k]['promotions'] = $v['extra']['promotions'];
}
if (isset($v['extra']['base_price'])) {
$order['products'][$k]['base_price'] = floatval($v['extra']['base_price']);
} else {
$order['products'][$k]['base_price'] = $v['price'];
}
$order['products'][$k]['original_price'] = $order['products'][$k]['base_price'];
// Form hash key for this product
$order['products'][$k]['cart_id'] = $v['item_id'];
$deps['P_' . $order['products'][$k]['cart_id']] = $k;
// Unserialize and collect product options information
if (!empty($v['extra']['product_options'])) {
if ($format_info == true) {
if (!empty($v['extra']['product_options_value'])) {
$order['products'][$k]['product_options'] = $v['extra']['product_options_value'];
} else {
$order['products'][$k]['product_options'] = fn_get_selected_product_options_info($v['extra']['product_options'], $lang_code);
}
}
//.........这里部分代码省略.........
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:101,代码来源:fn.cart.php
示例9: array
}
return array(CONTROLLER_STATUS_REDIRECT, "events.search");
} elseif ($mode == 'unsubscribe') {
db_query("DELETE FROM ?:giftreg_event_subscribers WHERE event_id = ?i AND email = ?s", $_REQUEST['event_id'], $_REQUEST['email']);
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('text_event_unsubscribe'));
return array(CONTROLLER_STATUS_REDIRECT, "events.search");
} elseif ($mode == 'view') {
$event_data = db_get_row("SELECT * FROM ?:giftreg_events WHERE event_id = ?i", $_REQUEST['event_id']);
fn_add_breadcrumb($event_data['title']);
$event_data['fields'] = db_get_hash_single_array("SELECT * FROM ?:giftreg_event_fields WHERE ?:giftreg_event_fields.event_id = ?i", array('field_id', 'value'), $_REQUEST['event_id']);
$event_data['products'] = fn_get_event_product($_REQUEST['event_id'], Registry::get('settings.Appearance.products_per_page'), empty($_REQUEST['page']) ? 1 : $_REQUEST['page']);
foreach ($event_data['products'] as $k => &$product) {
$product['extra'] = unserialize($product['extra']);
$product_options = $product['extra'];
$product['product_options_ids'] = $product_options;
$product['product_options'] = fn_get_selected_product_options_info($product_options, CART_LANGUAGE);
$product['price'] = fn_get_product_price($product['product_id'], 1, $auth);
$product['avail_amount'] = $product['amount'] - $product['ordered_amount'];
// selected options combination
$product['product_options_combination'] = fn_get_options_combination($product_options);
fn_gather_additional_product_data($product, true, false, false, true);
// If option combination image is exists than replace the main image with it
$_options = $product_options;
if (!empty($product['product_options']) && is_array($product['product_options'])) {
foreach ($product['product_options'] as $_k => $_v) {
if ($_v['inventory'] == 'N') {
unset($_options[$_v['option_id']]);
}
}
}
$combination_hash = fn_generate_cart_id($product['product_id'], array('product_options' => $_options));
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:events.php
示例10: fn_get_order_info
function fn_get_order_info($order_id, $native_language = false, $format_info = true, $get_edp_files = false, $skip_static_values = false)
{
if (!empty($order_id)) {
$condition = fn_get_company_condition();
$order = db_get_row("SELECT * FROM ?:orders WHERE ?:orders.order_id = ?i {$condition}", $order_id);
if (empty($order)) {
return false;
}
$lang_code = $native_language == true ? $order['lang_code'] : CART_LANGUAGE;
$order['payment_method'] = fn_get_payment_method_data($order['payment_id'], $lang_code);
if (!empty($order)) {
// Get additional profile fields
$additional_fields = db_get_hash_single_array("SELECT field_id, value FROM ?:profile_fields_data WHERE object_id = ?i AND object_type = 'O'", array('field_id', 'value'), $order_id);
$order['fields'] = $additional_fields;
$order['items'] = db_get_hash_array("SELECT ?:order_details.*, ?:product_descriptions.product, ?:product_descriptions.short_description FROM ?:order_details LEFT JOIN ?:product_descriptions ON ?:order_details.product_id = ?:product_descriptions.product_id AND ?:product_descriptions.lang_code = ?s WHERE ?:order_details.order_id = ?i ORDER BY ?:product_descriptions.product", 'item_id', $lang_code, $order_id);
$order['promotions'] = unserialize($order['promotions']);
if (!empty($order['promotions'])) {
// collect additional data
$params = array('promotion_id' => array_keys($order['promotions']));
list($promotions) = fn_get_promotions($params);
foreach ($promotions as $pr_id => $p) {
$order['promotions'][$pr_id]['name'] = $p['name'];
$order['promotions'][$pr_id]['short_description'] = $p['short_description'];
}
}
// Get additional data
$additional_data = db_get_hash_single_array("SELECT type, data FROM ?:order_data WHERE order_id = ?i", array('type', 'data'), $order_id);
$order['taxes'] = array();
$order['tax_subtotal'] = 0;
$order['display_shipping_cost'] = $order['shipping_cost'];
// Replace country, state and title values with their descriptions
fn_add_user_data_descriptions($order, $lang_code);
$order['need_shipping'] = false;
$deps = array();
// Get shipments common information
if (Registry::get('settings.General.use_shipments') == 'Y') {
$order['shipment_ids'] = db_get_fields('SELECT sh.shipment_id FROM ?:shipments AS sh LEFT JOIN ?:shipment_items AS s_items ON (sh.shipment_id = s_items.shipment_id) WHERE s_items.order_id = ?i GROUP BY s_items.shipment_id', $order_id);
$_products = db_get_array("SELECT item_id, SUM(amount) AS amount FROM ?:shipment_items WHERE order_id = ?i GROUP BY item_id", $order_id);
$shipped_products = array();
if (!empty($_products)) {
foreach ($_products as $_product) {
$shipped_products[$_product['item_id']] = $_product['amount'];
}
}
unset($_products);
}
foreach ($order['items'] as $k => $v) {
//Check for product existance
if (empty($v['product'])) {
$order['items'][$k]['deleted_product'] = true;
}
$order['items'][$k]['discount'] = 0;
$v['extra'] = @unserialize($v['extra']);
if ($skip_static_values == false && !empty($v['extra']['product'])) {
$order['items'][$k]['product'] = $v['extra']['product'];
preg_match("/\\[(.*?)\\]/", $v['extra']['product'], $resmath);
$order['items'][$k]['art'] = $resmath[1];
}
$order['items'][$k]['company_id'] = empty($v['extra']['company_id']) ? 0 : $v['extra']['company_id'];
if (!empty($v['extra']['discount']) && floatval($v['extra']['discount'])) {
$order['items'][$k]['discount'] = $v['extra']['discount'];
$order['use_discount'] = true;
}
if (!empty($v['extra']['promotions'])) {
$order['items'][$k]['promotions'] = $v['extra']['promotions'];
}
if (isset($v['extra']['base_price'])) {
$order['items'][$k]['base_price'] = floatval($v['extra']['base_price']);
} else {
$order['items'][$k]['base_price'] = $v['price'];
}
$order['items'][$k]['original_price'] = $order['items'][$k]['base_price'];
// Form hash key for this product
$order['items'][$k]['cart_id'] = $v['item_id'];
$deps['P_' . $order['items'][$k]['cart_id']] = $k;
//$order['items'][$k]['sklad'] = fn_numsklad($order['items'][$k]['product']);
// Unserialize and collect product options information
if (!empty($v['extra']['product_options'])) {
if ($format_info == true) {
$order['items'][$k]['product_options'] = $skip_static_values == false && !empty($v['extra']['product_options_value']) ? $v['extra']['product_options_value'] : fn_get_selected_product_options_info($v['extra']['product_options'], $lang_code);
}
if (empty($v['extra']['stored_price'])) {
// apply modifiers if this is not the custom price
$order['items'][$k]['original_price'] = fn_apply_options_modifiers($v['extra']['product_options'], $order['items'][$k]['base_price'], 'P', $skip_static_values == false && !empty($v['extra']['product_options_value']) ? $v['extra']['product_options_value'] : array());
}
}
$img = db_get_field("SELECT cscart_images.image_path FROM cscart_images_links LEFT \nJOIN cscart_images ON cscart_images_links.image_id = cscart_images.image_id \nWHERE cscart_images_links.object_id = ?i", $order['items'][$k]['product_id']);
$imgid = db_get_field("SELECT cscart_images_links.image_id FROM cscart_images_links \nWHERE cscart_images_links.object_id = ?i", $order['items'][$k]['product_id']);
$order['items'][$k]['extra'] = $v['extra'];
$order['items'][$k]['img'] = fn_get_image($imgid, "product");
$order['items'][$k]['tax_value'] = 0;
$order['items'][$k]['display_subtotal'] = $order['items'][$k]['subtotal'] = $v['price'] * $v['amount'];
$order['items'][$k]['display_per_subtotal'] = $order['items'][$k]['original_price'] * $v['amount'];
// Get information about edp
if ($get_edp_files == true && $order['items'][$k]['extra']['is_edp'] == 'Y') {
$order['items'][$k]['files'] = db_get_array("SELECT ?:product_files.file_id, ?:product_files.activation_type, ?:product_files.max_downloads, ?:product_file_descriptions.file_name, ?:product_file_ekeys.active, ?:product_file_ekeys.downloads, ?:product_file_ekeys.ekey, ?:product_file_ekeys.ttl FROM ?:product_files LEFT JOIN ?:product_file_descriptions ON ?:product_file_descriptions.file_id = ?:product_files.file_id AND ?:product_file_descriptions.lang_code = ?s LEFT JOIN ?:product_file_ekeys ON ?:product_file_ekeys.file_id = ?:product_files.file_id AND ?:product_file_ekeys.order_id = ?i WHERE ?:product_files.product_id = ?i", $lang_code, $order_id, $v['product_id']);
}
// Get shipments information
if (Registry::get('settings.General.use_shipments') == 'Y') {
if (isset($shipped_products[$k])) {
//.........这里部分代码省略.........
开发者ID:diedsmiling,项目名称:busenika,代码行数:101,代码来源:fn.cart.php
示例11: content_55dc81a5ed2a88_04135619
//.........这里部分代码省略.........
if ($_smarty_tpl->tpl_vars['display']->value) {
?>
<?php
$_smarty_tpl->_capture_stack[0][] = array("product_options", null, null);
ob_start();
?>
<?php
$_smarty_tpl->tpl_vars["prod_opts"] = new Smarty_variable(fn_get_product_options($_smarty_tpl->tpl_vars['product']->value['product_id']), null, 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['prod_opts']->value && !$_smarty_tpl->tpl_vars['product']->value['product_options']) {
?>
<span><?php
echo $_smarty_tpl->__("options");
?>
: </span> <?php
echo $_smarty_tpl->__("any_option_combinations");
?>
<?php
} elseif ($_smarty_tpl->tpl_vars['product']->value['product_options']) {
?>
<?php
if ($_smarty_tpl->tpl_vars['product']->value['product_options_value']) {
?>
<?php
echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options_value']), 0);
?>
<?php
} else {
?>
<?php
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
}
?>
<?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
开发者ID:AlanIsrael0,项目名称:market,代码行数:67,代码来源:0f764cd54e3b4c6cb9eb7122203a1dc82afeeb4a.tygh.picker.tpl.php
注:本文中的fn_get_selected_product_options_info函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论