function content_55ccecb48c3e32_52503072($_smarty_tpl) { if (!$_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate'] && $_smarty_tpl->tpl_vars['object']->value['company_id']) { ?> <?php if (!$_smarty_tpl->tpl_vars['object']->value['company_name']) { ?> <?php $_smarty_tpl->tpl_vars['_company_name'] = new Smarty_variable(fn_get_company_name($_smarty_tpl->tpl_vars['object']->value['company_id']), null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['simple']->value) { ?> <small class="muted"><?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['object']->value['company_name']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['_company_name']->value : $tmp, ENT_QUOTES, 'UTF-8'); ?> </small> <?php } else { ?> <p class="muted"><small><?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['object']->value['company_name']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['_company_name']->value : $tmp, ENT_QUOTES, 'UTF-8'); ?> </small></p> <?php } } }
function content_55db8f5836e306_87643168($_smarty_tpl) { fn_preload_lang_vars(array('search_by_vendor', 'search_by_owner', 'all_vendors')); $_smarty_tpl->tpl_vars["id"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['id']->value) === null || $tmp === '' ? "company_id" : $tmp, null, 0); $_smarty_tpl->tpl_vars["name"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['name']->value) === null || $tmp === '' ? "company_id" : $tmp, null, 0); ?> <?php if (fn_allowed_for("MULTIVENDOR")) { ?> <?php $_smarty_tpl->tpl_vars["lang_search_by_vendor"] = new Smarty_variable($_smarty_tpl->__("search_by_vendor"), null, 0); } elseif (fn_allowed_for("ULTIMATE")) { ?> <?php $_smarty_tpl->tpl_vars["lang_search_by_vendor"] = new Smarty_variable($_smarty_tpl->__("search_by_owner"), null, 0); } ?> <?php if (!$_smarty_tpl->tpl_vars['runtime']->value['company_id'] && !$_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate']) { ?> <div class="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['class']->value) === null || $tmp === '' ? "control-group" : $tmp, ENT_QUOTES, 'UTF-8'); ?> "> <input type="hidden" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['name']->value, ENT_QUOTES, 'UTF-8'); ?> " id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8'); ?> " value="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['search']->value['company_id']) === null || $tmp === '' ? '' : $tmp, ENT_QUOTES, 'UTF-8'); ?> " /> <label class="control-label"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['lang_search_by_vendor']->value, ENT_QUOTES, 'UTF-8'); ?> </label> <div class="controls"> <?php echo $_smarty_tpl->getSubTemplate("common/ajax_select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_url' => "companies.get_companies_list?show_all=Y&search=Y", 'text' => ($tmp = @fn_get_company_name($_smarty_tpl->tpl_vars['search']->value['company_id'])) === null || $tmp === '' ? $_smarty_tpl->__("all_vendors") : $tmp, 'result_elm' => $_smarty_tpl->tpl_vars['id']->value, 'id' => (string) $_smarty_tpl->tpl_vars['id']->value . "_selector"), 0); ?> </div> </div> <?php } }
function fn_yml_export_import_settings() { db_query("INSERT INTO ?:exim_layouts (name, cols, pattern_id, active) VALUES ('general', 'Option ID,Option name,Product ID,Product name,YML option,YML option param', 'product_yml_options', 'Y')"); $companies_ids = fn_get_available_company_ids(); foreach ($companies_ids as $company_id) { $offers_params = array('vendorCode' => array('type' => 'product', 'value' => 'product_code'), 'description' => array('type' => 'product', 'value' => 'full_description'), 'model' => array('type' => 'product', 'value' => 'yml2_model'), 'typePrefix' => array('type' => 'product', 'value' => 'yml2_type_prefix'), 'vendor' => array('type' => 'product', 'value' => 'yml2_brand')); $brand_id = db_get_field("SELECT feature_id FROM ?:product_features WHERE status = 'A' AND feature_type = 'E' AND company_id = ?i", $company_id); if (!empty($brand_id)) { $offers_params['vendor'] = array('type' => 'feature', 'value' => $brand_id); } $data = array('param_type' => 'offer', 'param_key' => 'common', 'param_data' => serialize($offers_params), 'company_id' => $company_id); db_query("INSERT INTO ?:yml_param ?e ON DUPLICATE KEY UPDATE ?u", $data, $data); $shop_name = fn_yml_get_setting_value('shop_name', $company_id); if (empty($shop_name)) { $shop_name = fn_get_company_name($company_id); } $key = fn_yml_rand_code(); $price_params = array('enable_authorization' => fn_yml_get_setting_value('enable_authorization', $company_id), 'company_id' => $company_id, 'access_key' => $key, 'name_price_list' => 'Яндекс.Маркет', 'shop_name' => $shop_name, 'export_encoding' => fn_yml_get_setting_value('export_encoding', $company_id), 'detailed_generation' => 'Y', 'utm_link' => '', 'export_stock' => fn_yml_get_setting_value('export_stock', $company_id), 'export_null_price' => fn_yml_get_setting_value('export_null_price', $company_id), 'market_category' => fn_yml_get_setting_value('market_category', $company_id), 'weight' => 'N', 'dimensions' => 'N', 'image_type' => fn_yml_get_setting_value('image_type', $company_id), 'thumbnail_width' => fn_yml_get_setting_value('thumbnail_width', $company_id), 'thumbnail_height' => fn_yml_get_setting_value('thumbnail_height', $company_id), 'store' => 'N', 'pickup' => 'N', 'delivery' => 'Y', 'delivery_options' => array(), 'export_hidden_categories' => 'N', 'exclude_categories_not_logging' => 'Y', 'exclude_categories' => ''); fn_yml_get_categories_data($price_params); $data = array('param_type' => 'price_list', 'param_key' => $key, 'param_data' => serialize($price_params), 'company_id' => $company_id); db_query("INSERT INTO ?:yml_param ?e ON DUPLICATE KEY UPDATE ?u", $data, $data); } }
function fn_get_shared_companies($mailing_lists) { if (!empty($mailing_lists)) { foreach ($mailing_lists as $list_id => $list_data) { $shared_for_companies = db_get_fields("SELECT share_company_id FROM ?:ult_objects_sharing WHERE share_object_type = 'mailing_lists' AND share_object_id = ?i", $list_id); $mailing_lists[$list_id]['shared_for_companies'] = array(0 => __('ult_shared_with')); if (!empty($shared_for_companies)) { foreach ($shared_for_companies as $company_id) { $mailing_lists[$list_id]['shared_for_companies'][] = fn_get_company_name($company_id); } } } } return $mailing_lists; }
function content_55d5c758c30951_62619282($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php'; } if (!is_callable('smarty_modifier_date_format')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php'; } if (!is_callable('smarty_function_math')) { include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.math.php'; } fn_preload_lang_vars(array('new_shipment', 'new_shipment', 'product', 'price', 'quantity', 'discount', 'tax', 'subtotal', 'sku', 'ls_shipping_estimation', 'free', 'shipped', 'free', 'ls_shipping_estimation', 'totals', 'subtotal', 'shipping_cost', 'including_discount', 'order_discount', 'discount_coupon', 'taxes', 'included', 'tax_exempt', 'payment_surcharge', 'total', 'customer_notes', 'staff_only_notes', 'status', 'payment_information', 'method', 'credit_card', 'expiry_date', 'remove_cc_info', 'shipping_information', 'none', 'method', 'new_shipment', 'new_shipment', 'shipments', 'tracking_number', 'carrier', 'shipments', 'new_shipment', 'new_shipment', 'shipments', 'filename', 'activation_mode', 'downloads_max_left', 'download_key_expiry', 'active', 'manually', 'immediately', 'after_full_payment', 'none', 'time_unlimited_download', 'download_key_expiry', 'prolongate_download_key', 'file_doesnt_have_key', 'active', 'not_active', 'order', 'total', 'invoice', 'credit_memo', 'print_credit_memo', 'print_pdf_credit_memo', 'print_order_details', 'print_pdf_order_details', 'print_invoice', 'print_pdf_invoice', 'print_packing_slip', 'print_pdf_packing_slip', 'edit_order', 'notify_customer', 'notify_orders_department', 'notify_vendor')); if ($_smarty_tpl->tpl_vars['order_info']->value['shipping']) { ?> <?php $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["shipping"]->_loop = false; $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) { $_smarty_tpl->tpl_vars["shipping"]->_loop = true; $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['use_shipments']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("add_new_picker", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/shipments/components/new_shipment.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('group_key' => $_smarty_tpl->tpl_vars['shipping']->value['group_key']), 0); ?> <?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 echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_" . (string) $_smarty_tpl->tpl_vars['shipping']->value['group_key'], 'content' => Smarty::$_smarty_vars['capture']['add_new_picker'], 'text' => __("new_shipment"), 'act' => "hidden"), 0); ?> <?php } ?> <?php } } else { ?> <?php $_smarty_tpl->tpl_vars["group"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["group"]->_loop = false; $_smarty_tpl->tpl_vars["group_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['product_groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["group"]->key => $_smarty_tpl->tpl_vars["group"]->value) { $_smarty_tpl->tpl_vars["group"]->_loop = true; $_smarty_tpl->tpl_vars["group_id"]->value = $_smarty_tpl->tpl_vars["group"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping']) { ?> <?php if ($_smarty_tpl->tpl_vars['use_shipments']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("add_new_picker", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/shipments/components/new_shipment.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('group_key' => 0), 0); ?> <?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 echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_0", 'content' => Smarty::$_smarty_vars['capture']['add_new_picker'], 'text' => __("new_shipment"), 'act' => "hidden"), 0); ?> <?php } ?> <?php } ?> <?php } } ?> <form action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" name="order_info_form" class="form-horizontal form-edit form-table"> <input type="hidden" name="order_id" value="<?php echo htmlspecialchars($_REQUEST['order_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="order_status" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['status'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="result_ids" value="content_general" /> <input type="hidden" name="selected_section" value="<?php echo htmlspecialchars($_REQUEST['selected_section'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null); ob_start(); $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null); ob_start(); ?> <div id="content_general"> <div class="row-fluid"> <div class="span8"> <table width="100%" class="table table-middle"> <thead> <tr> <th width="50%"><?php echo $_smarty_tpl->__("product"); ?> </th> <th width="10%"><?php echo $_smarty_tpl->__("price"); ?> </th> <th class="center" width="10%"><?php echo $_smarty_tpl->__("quantity"); ?> </th> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['use_discount']) { ?> <th width="5%"><?php echo $_smarty_tpl->__("discount"); ?> </th> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['taxes'] && $_smarty_tpl->tpl_vars['settings']->value['General']['tax_calculation'] != "subtotal") { ?> <th width="10%"> <?php echo $_smarty_tpl->__("tax"); ?> </th> <?php } ?> <th width="10%" class="right"> <?php echo $_smarty_tpl->__("subtotal"); ?> </th> </tr> </thead> <?php $_smarty_tpl->tpl_vars["oi"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["oi"]->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['products']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["oi"]->key => $_smarty_tpl->tpl_vars["oi"]->value) { $_smarty_tpl->tpl_vars["oi"]->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["oi"]->key; ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:items_list_row")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:items_list_row"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if (!$_smarty_tpl->tpl_vars['oi']->value['extra']['parent']) { ?> <span style="display:none"><?php echo htmlspecialchars(var_dump($_smarty_tpl->tpl_vars['order_info']->value['products']), ENT_QUOTES, 'UTF-8'); ?> </span> <tr> <td> <?php if (!$_smarty_tpl->tpl_vars['oi']->value['deleted_product']) { ?> <a href="<?php echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['oi']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php } echo $_smarty_tpl->tpl_vars['oi']->value['product']; if (!$_smarty_tpl->tpl_vars['oi']->value['deleted_product']) { ?> </a><?php } ?> <div class="products-hint"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:product_info")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:product_info"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['oi']->value['product_code']) { ?> <p><?php echo $_smarty_tpl->__("sku"); ?> :<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product_code'], ENT_QUOTES, 'UTF-8'); ?> </p><?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:product_info"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <?php if ($_smarty_tpl->tpl_vars['oi']->value['product_options']) { ?> <div class="options-info"><?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['oi']->value['product_options']), 0); ?> </div><?php } ?> <?php if ($_smarty_tpl->tpl_vars['oi']->value['ls_individual_estimation']) { ?> <div class="ls_individual_estimation"><b><?php echo $_smarty_tpl->__("ls_shipping_estimation"); ?> :</b><br> <?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['oi']->value['ls_individual_estimation'], "%e %B %Y"), ENT_QUOTES, 'UTF-8'); ?> </div> <?php } ?> </td> <td class="nowrap"> <?php if ($_smarty_tpl->tpl_vars['oi']->value['extra']['exclude_from_calculate']) { echo $_smarty_tpl->__("free"); } else { echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['original_price']), 0); } ?> </td> <td class="center"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> <br /> <?php if (!fn_allowed_for("ULTIMATE:FREE") && $_smarty_tpl->tpl_vars['use_shipments']->value && $_smarty_tpl->tpl_vars['oi']->value['shipped_amount'] > 0) { ?> <span class="muted"><small>(<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['shipped_amount'], ENT_QUOTES, 'UTF-8'); ?> <?php echo $_smarty_tpl->__("shipped"); ?> )</small></span> <?php } ?> </td> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['use_discount']) { ?> <td class="nowrap"> <?php if (floatval($_smarty_tpl->tpl_vars['oi']->value['extra']['discount'])) { echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['extra']['discount']), 0); } else { ?> -<?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['taxes'] && $_smarty_tpl->tpl_vars['settings']->value['General']['tax_calculation'] != "subtotal") { ?> <td class="nowrap"> <?php if (floatval($_smarty_tpl->tpl_vars['oi']->value['tax_value'])) { echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['tax_value']), 0); } else { ?> -<?php } ?> </td> <?php } ?> <td class="right"><span><?php if ($_smarty_tpl->tpl_vars['oi']->value['extra']['exclude_from_calculate']) { echo $_smarty_tpl->__("free"); } else { echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['display_subtotal']), 0); } ?> </span></td> </tr> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:items_list_row"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:extra_list")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:extra_list"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:extra_list"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </table> <!----> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:totals")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:totals"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="order-notes statistic"> <div class="clearfix"> <table class="pull-left"> <tr class="totals"> <td width="200px"><h4><?php echo $_smarty_tpl->__("ls_shipping_estimation"); ?> </h4></td> <td> </td> </tr> <tr> <td data-ct-totals="subtotal"> <?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['ls_shipping_estimation_value']->value, "%e %B %Y"), ENT_QUOTES, 'UTF-8'); ?> </td> <td> </td> </tr> </table> <table class="pull-right"> <tr class="totals"> <td> </td> <td width="100px"><h4><?php echo $_smarty_tpl->__("totals"); ?> </h4></td> </tr> <tr> <td><?php echo $_smarty_tpl->__("subtotal"); ?> :</td> <td data-ct-totals="subtotal"><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['display_subtotal']), 0); ?> </td> </tr> <?php if (floatval($_smarty_tpl->tpl_vars['order_info']->value['display_shipping_cost'])) { ?> <tr> <td><?php echo $_smarty_tpl->__("shipping_cost"); ?> :</td> <td data-ct-totals="shipping_cost"><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['display_shipping_cost']), 0); ?> </td> </tr> <?php } ?> <?php if (floatval($_smarty_tpl->tpl_vars['order_info']->value['discount'])) { ?> <tr> <td><?php echo $_smarty_tpl->__("including_discount"); ?> :</td> <td data-ct-totals="including_discount"><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['discount']), 0); ?> </td> </tr> <?php } ?> <?php if (floatval($_smarty_tpl->tpl_vars['order_info']->value['subtotal_discount'])) { ?> <tr> <td><?php echo $_smarty_tpl->__("order_discount"); ?> :</td> <td data-ct-totals="order_discount"><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['subtotal_discount']), 0); ?> </td> </tr> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['coupons']) { ?> <?php $_smarty_tpl->tpl_vars["_c"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["_c"]->_loop = false; $_smarty_tpl->tpl_vars["coupon"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['coupons']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["_c"]->key => $_smarty_tpl->tpl_vars["_c"]->value) { $_smarty_tpl->tpl_vars["_c"]->_loop = true; $_smarty_tpl->tpl_vars["coupon"]->value = $_smarty_tpl->tpl_vars["_c"]->key; ?> <tr> <td><?php echo $_smarty_tpl->__("discount_coupon"); ?> :</td> <td data-ct-totals="discount_coupon"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['coupon']->value, ENT_QUOTES, 'UTF-8'); ?> </td> </tr> <?php } ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['taxes']) { ?> <tr> <td><?php echo $_smarty_tpl->__("taxes"); ?> :</td> <td> </td> </tr> <?php $_smarty_tpl->tpl_vars["tax_data"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["tax_data"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['order_info']->value['taxes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["tax_data"]->key => $_smarty_tpl->tpl_vars["tax_data"]->value) { $_smarty_tpl->tpl_vars["tax_data"]->_loop = true; ?> <tr> <td><span>·</span> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tax_data']->value['description'], ENT_QUOTES, 'UTF-8'); ?> <?php echo $_smarty_tpl->getSubTemplate("common/modifier.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('mod_value' => $_smarty_tpl->tpl_vars['tax_data']->value['rate_value'], 'mod_type' => $_smarty_tpl->tpl_vars['tax_data']->value['rate_type']), 0); if ($_smarty_tpl->tpl_vars['tax_data']->value['price_includes_tax'] == "Y" && ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['cart_prices_w_taxes'] != "Y" || $_smarty_tpl->tpl_vars['settings']->value['General']['tax_calculation'] == "subtotal")) { ?> <?php echo $_smarty_tpl->__("included"); } if ($_smarty_tpl->tpl_vars['tax_data']->value['regnumber']) { ?> (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tax_data']->value['regnumber'], ENT_QUOTES, 'UTF-8'); ?> )<?php } ?> </td> <td data-ct-totals="taxes-<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tax_data']->value['description'], ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['tax_data']->value['tax_subtotal']), 0); ?> </td> </tr> <?php } ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['tax_exempt'] == "Y") { ?> <tr> <td><?php echo $_smarty_tpl->__("tax_exempt"); ?> </td> <td> </td> </tr> <?php } ?> <?php if (floatval($_smarty_tpl->tpl_vars['order_info']->value['payment_surcharge']) && !$_smarty_tpl->tpl_vars['take_surcharge_from_vendor']->value) { ?> <tr> <td><?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['order_info']->value['payment_method']['surcharge_title']) === null || $tmp === '' ? $_smarty_tpl->__("payment_surcharge") : $tmp, ENT_QUOTES, 'UTF-8'); ?> :</td> <td data-ct-totals="payment_surcharge"><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['payment_surcharge']), 0); ?> </td> </tr> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:totals_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:totals_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:totals_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <tr> <td><h4><?php echo $_smarty_tpl->__("total"); ?> :</h4></td> <td class="price" data-ct-totals="total"><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['total']), 0); ?> </td> </tr> </table> </div> <div class="note clearfix"> <div class="span6"> <label for="details"><?php echo $_smarty_tpl->__("customer_notes"); ?> </label> <textarea class="span12" name="update_order[notes]" id="notes" cols="40" rows="5"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['notes'], ENT_QUOTES, 'UTF-8'); ?> </textarea> </div> <div class="span6"> <label for="details"><?php echo $_smarty_tpl->__("staff_only_notes"); ?> </label> <textarea class="span12" name="update_order[details]" id="details" cols="40" rows="5"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['details'], ENT_QUOTES, 'UTF-8'); ?> </textarea> </div> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:totals"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <!----> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:staff_only_note")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:staff_only_note"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:staff_only_note"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <div class="span4"> <div class="well orders-right-pane form-horizontal"> <div class="control-group"> <div class="control-label"><h4 class="subheader"><?php echo $_smarty_tpl->__("status"); ?> </h4></div> <div class="controls"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:order_status")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:order_status"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['status'] == @constant('STATUS_INCOMPLETED_ORDER')) { ?> <?php $_smarty_tpl->tpl_vars["get_additional_statuses"] = new Smarty_variable(true, null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["get_additional_statuses"] = new Smarty_variable(false, null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["order_status_descr"] = new Smarty_variable(fn_get_simple_statuses(@constant('STATUSES_ORDER'), $_smarty_tpl->tpl_vars['get_additional_statuses']->value, true), null, 0); ?> <?php $_smarty_tpl->tpl_vars["extra_status"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php if (fn_allowed_for("MULTIVENDOR")) { ?> <?php $_smarty_tpl->tpl_vars["notify_vendor"] = new Smarty_variable(true, null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["notify_vendor"] = new Smarty_variable(false, null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars['statuses'] = new Smarty_variable(array(), null, 0); ?> <?php $_smarty_tpl->tpl_vars["order_statuses"] = new Smarty_variable(fn_get_statuses(@constant('STATUSES_ORDER'), $_smarty_tpl->tpl_vars['statuses']->value, $_smarty_tpl->tpl_vars['get_additional_statuses']->value, true), null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("common/select_popup.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('suffix' => "o", 'id' => $_smarty_tpl->tpl_vars['order_info']->value['order_id'], 'status' => $_smarty_tpl->tpl_vars['order_info']->value['status'], 'items_status' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'update_controller' => "orders", 'notify' => true, 'notify_department' => true, 'notify_vendor' => $_smarty_tpl->tpl_vars['notify_vendor']->value, 'status_target_id' => "content_downloads", 'extra' => "&return_url=" . (string) $_smarty_tpl->tpl_vars['extra_status']->value, 'statuses' => $_smarty_tpl->tpl_vars['order_statuses']->value, 'popup_additional_class' => "dropleft"), 0); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:order_status"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> </div> <div class="control-group shift-top"> <div class="control-label"> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("payment_information")), 0); ?> </div> </div> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:payment_info")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:payment_info"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['payment_id']) { ?> <div class="control-group"> <div class="control-label"><?php echo $_smarty_tpl->__("method"); ?> </div> <div id="tygh_payment_info" class="controls"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['payment_method']['payment'], ENT_QUOTES, 'UTF-8'); if ($_smarty_tpl->tpl_vars['order_info']->value['payment_method']['description']) { ?> (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['payment_method']['description'], ENT_QUOTES, 'UTF-8'); ?> )<?php } ?> </div> </div> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['payment_info']) { ?> <?php $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['item']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['payment_info']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) { $_smarty_tpl->tpl_vars['item']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key; ?> <div class="control-group"> <?php if ($_smarty_tpl->tpl_vars['item']->value && $_smarty_tpl->tpl_vars['key']->value != "expiry_year") { ?> <div class="control-label"> <?php if ($_smarty_tpl->tpl_vars['key']->value == "card_number") { $_smarty_tpl->tpl_vars["cc_exists"] = new Smarty_variable(true, null, 0); echo $_smarty_tpl->__("credit_card"); } elseif ($_smarty_tpl->tpl_vars['key']->value == "expiry_month") { echo $_smarty_tpl->__("expiry_date"); } else { echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['key']->value); } ?> </div> <div class="controls"> <?php if ($_smarty_tpl->tpl_vars['key']->value == "order_status") { ?> <?php echo $_smarty_tpl->getSubTemplate("common/status.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('status' => $_smarty_tpl->tpl_vars['item']->value, 'display' => "view", 'status_type' => ''), 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['key']->value == "reason_text") { ?> <?php echo htmlspecialchars(nl2br($_smarty_tpl->tpl_vars['item']->value), ENT_QUOTES, 'UTF-8'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['key']->value == "expiry_month") { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value, ENT_QUOTES, 'UTF-8'); ?> /<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['payment_info']['expiry_year'], ENT_QUOTES, 'UTF-8'); ?> <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value, ENT_QUOTES, 'UTF-8'); ?> <?php } ?> </div> <?php } ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['cc_exists']->value) { ?> <div class="control-group"> <div class="control-label"> <input type="hidden" name="order_ids[]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("remove_cc_info"), 'but_meta' => "cm-ajax cm-comet", 'but_name' => "dispatch[orders.remove_cc_info]"), 0); ?> </div> </div> <?php } ?> <?php } ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:payment_info"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['shipping']) { ?> <div class="control-group shift-top"> <div class="control-label"> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("shipping_information")), 0); ?> </div> </div> <?php $_smarty_tpl->tpl_vars["is_group_shippings"] = new Smarty_variable(count($_smarty_tpl->tpl_vars['order_info']->value['shipping']) > 1, null, 0); ?> <?php $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["shipping"]->_loop = false; $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) { $_smarty_tpl->tpl_vars["shipping"]->_loop = true; $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key; ?> <div class="control-group" > <span> <?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['shipping']->value['group_name']) === null || $tmp === '' ? $_smarty_tpl->__("none") : $tmp, ENT_QUOTES, 'UTF-8'); ?> </span> </div> <div class="control-group"> <div class="control-label"><?php echo $_smarty_tpl->__("method"); ?> </div> <div id="tygh_shipping_info" class="controls"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> </div> </div> <?php if ($_smarty_tpl->tpl_vars['use_shipments']->value) { ?> <div class="clearfix"> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['need_shipment']) { ?> <?php if (!fn_allowed_for("ULTIMATE:FREE")) { ?> <div class="pull-left"> <?php echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_" . (string) $_smarty_tpl->tpl_vars['shipping']->value['group_key'], 'content' => '', 'but_text' => __("new_shipment"), 'act' => "create", 'but_meta' => "btn"), 0); ?> </div> <?php } else { ?> <div class="pull-left"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "action", 'but_meta' => "cm-promo-popup", 'allow_href' => false, 'but_text' => __("new_shipment")), 0); ?> </div> <?php } ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['is_group_shippings']->value) { ?> <a class="pull-right" href="<?php echo htmlspecialchars(fn_url("shipments.manage?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("shipments"); ?> (<?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order_info']->value['shipment_ids']), ENT_QUOTES, 'UTF-8'); ?> )</a> <?php } ?> </div> <?php if ($_smarty_tpl->tpl_vars['is_group_shippings']->value) { ?> <hr><?php } ?> <?php } else { ?> <div class="control-group"> <label class="control-label" for="tracking_number"><?php echo $_smarty_tpl->__("tracking_number"); ?> </label> <div class="controls"> <input id="tracking_number" class="input-small" type="text" name="update_shipping[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['group_key'], ENT_QUOTES, 'UTF-8'); ?> ][shipment_data][tracking_number]" size="45" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipments']->value[$_smarty_tpl->tpl_vars['shipping']->value['group_key']]['tracking_number'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="update_shipping[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['group_key'], ENT_QUOTES, 'UTF-8'); ?> ][shipment_id]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipments']->value[$_smarty_tpl->tpl_vars['shipping']->value['group_key']]['shipment_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="update_shipping[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['group_key'], ENT_QUOTES, 'UTF-8'); ?> ][shipment_data][shipping_id]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " /> </div> </div> <div class="control-group"> <label class="control-label" for="carrier_key"><?php echo $_smarty_tpl->__("carrier"); ?> </label> <div class="controls"> <?php echo $_smarty_tpl->getSubTemplate("common/carriers.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "carrier_key", 'meta' => "input-small", 'name' => "update_shipping[" . (string) $_smarty_tpl->tpl_vars['shipping']->value['group_key'] . "][shipment_data][carrier]", 'carrier' => $_smarty_tpl->tpl_vars['shipments']->value[$_smarty_tpl->tpl_vars['shipping']->value['group_key']]['carrier']), 0); ?> </div> </div> <?php } ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['is_group_shippings']->value) { ?> <div class="clearfix"> <a class="pull-right" href="<?php echo htmlspecialchars(fn_url("shipments.manage?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("shipments"); ?> (<?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order_info']->value['shipment_ids']), ENT_QUOTES, 'UTF-8'); ?> )</a> </div> <?php } ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["group"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["group"]->_loop = false; $_smarty_tpl->tpl_vars["group_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['order_info']->value['product_groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["group"]->key => $_smarty_tpl->tpl_vars["group"]->value) { $_smarty_tpl->tpl_vars["group"]->_loop = true; $_smarty_tpl->tpl_vars["group_id"]->value = $_smarty_tpl->tpl_vars["group"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping']) { ?> <?php if ($_smarty_tpl->tpl_vars['use_shipments']->value) { ?> <div class="clearfix"> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['need_shipment']) { ?> <?php if (!fn_allowed_for("ULTIMATE:FREE")) { ?> <div class="pull-left"> <?php echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_0", 'content' => '', 'but_text' => __("new_shipment"), 'act' => "create", 'but_meta' => "btn"), 0); ?> </div> <?php } else { ?> <div class="pull-left"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "action", 'but_meta' => "cm-promo-popup", 'allow_href' => false, 'but_text' => __("new_shipment")), 0); ?> </div> <?php } ?> <?php } ?> <a class="pull-right" href="<?php echo htmlspecialchars(fn_url("shipments.manage?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("shipments"); ?> (<?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order_info']->value['shipment_ids']), ENT_QUOTES, 'UTF-8'); ?> )</a> </div> <?php } ?> <?php } ?> <?php } ?> <?php } ?> </div> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:customer_shot_info")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:customer_shot_info"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:customer_shot_info"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> </div> <!--content_general--></div> <div id="content_addons"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:customer_info")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:customer_info"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:customer_info"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <!--content_addons--></div> <?php if ($_smarty_tpl->tpl_vars['downloads_exist']->value) { ?> <div id="content_downloads"> <input type="hidden" name="order_id" value="<?php echo htmlspecialchars($_REQUEST['order_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="order_status" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['status'], ENT_QUOTES, 'UTF-8'); ?> " /> <?php $_smarty_tpl->tpl_vars["oi"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["oi"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['order_info']->value['products']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["oi"]->key => $_smarty_tpl->tpl_vars["oi"]->value) { $_smarty_tpl->tpl_vars["oi"]->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['oi']->value['extra']['is_edp'] == "Y") { ?> <p><a href="<?php echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['oi']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product'], ENT_QUOTES, 'UTF-8'); ?> </a></p> <?php if ($_smarty_tpl->tpl_vars['oi']->value['files']) { ?> <input type="hidden" name="files_exists[]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <table cellpadding="5" cellspacing="0" border="0" class="table"> <tr> <th><?php echo $_smarty_tpl->__("filename"); ?> </th> <th><?php echo $_smarty_tpl->__("activation_mode"); ?> </th> <th><?php echo $_smarty_tpl->__("downloads_max_left"); ?> </th> <th><?php echo $_smarty_tpl->__("download_key_expiry"); ?> </th> <th><?php echo $_smarty_tpl->__("active"); ?> </th> </tr> <?php $_smarty_tpl->tpl_vars["file"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["file"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['oi']->value['files']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["file"]->key => $_smarty_tpl->tpl_vars["file"]->value) { $_smarty_tpl->tpl_vars["file"]->_loop = true; ?> <tr> <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['file_name'], ENT_QUOTES, 'UTF-8'); ?> </td> <td> <?php if ($_smarty_tpl->tpl_vars['file']->value['activation_type'] == "M") { echo $_smarty_tpl->__("manually"); ?> </label><?php } elseif ($_smarty_tpl->tpl_vars['file']->value['activation_type'] == "I") { echo $_smarty_tpl->__("immediately"); } else { echo $_smarty_tpl->__("after_full_payment"); } ?> </td> <td><?php if ($_smarty_tpl->tpl_vars['file']->value['max_downloads']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['max_downloads'], ENT_QUOTES, 'UTF-8'); ?> / <input type="text" name="edp_downloads[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['ekey'], ENT_QUOTES, 'UTF-8'); ?> ][<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['file_id'], ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo smarty_function_math(array('equation' => "a-b", 'a' => $_smarty_tpl->tpl_vars['file']->value['max_downloads'], 'b' => ($tmp = @$_smarty_tpl->tpl_vars['file']->value['downloads']) === null || $tmp === '' ? 0 : $tmp), $_smarty_tpl); ?> " size="3" /><?php } else { echo $_smarty_tpl->__("none"); } ?> </td> <td> <?php if ($_smarty_tpl->tpl_vars['oi']->value['extra']['unlimited_download'] == 'Y') { ?> <?php echo $_smarty_tpl->__("time_unlimited_download"); ?> <?php } elseif ($_smarty_tpl->tpl_vars['file']->value['ekey']) { ?> <p><label><?php echo $_smarty_tpl->__("download_key_expiry"); ?> : </label><span><?php echo htmlspecialchars(($tmp = @smarty_modifier_date_format($_smarty_tpl->tpl_vars['file']->value['ttl'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format'])) === null || $tmp === '' ? "n/a" : $tmp, ENT_QUOTES, 'UTF-8'); ?> </span></p> <p><label><?php echo $_smarty_tpl->__("prolongate_download_key"); ?> : </label><?php echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_id' => "prolongate_date_" . (string) $_smarty_tpl->tpl_vars['file']->value['file_id'], 'date_name' => "prolongate_data[" . (string) $_smarty_tpl->tpl_vars['file']->value['ekey'] . "]", 'date_val' => ($tmp = @$_smarty_tpl->tpl_vars['file']->value['ttl']) === null || $tmp === '' ? @constant('TIME') : $tmp, 'start_year' => $_smarty_tpl->tpl_vars['settings']->value['Company']['company_start_year']), 0); ?> </p> <?php } else { echo $_smarty_tpl->__("file_doesnt_have_key"); } ?> </td> <td> <select name="activate_files[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> ][<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['file_id'], ENT_QUOTES, 'UTF-8'); ?> ]"> <option value="Y" <?php if ($_smarty_tpl->tpl_vars['file']->value['active'] == "Y") { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__("active"); ?> </option> <option value="N" <?php if ($_smarty_tpl->tpl_vars['file']->value['active'] != "Y") { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__("not_active"); ?> </option> </select> </td> </tr> <?php } ?> </table> <?php } ?> <?php } ?> <?php } ?> <!--content_downloads--></div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order_info']->value['promotions']) { ?> <div id="content_promotions"> <?php echo $_smarty_tpl->getSubTemplate("views/orders/components/promotions.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('promotions' => $_smarty_tpl->tpl_vars['order_info']->value['promotions']), 0); ?> <!--content_promotions--></div> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:tabs_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:tabs_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:tabs_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:tabs_extra")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:tabs_extra"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:tabs_extra"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?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(); } echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'active_tab' => $_REQUEST['selected_section'], 'track' => true), 0); ?> <?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(); } $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); ?> <?php echo $_smarty_tpl->__("order"); ?> #<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8'); ?> <span class="f-middle"><?php echo $_smarty_tpl->__("total"); ?> : <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['order_info']->value['total']), 0); ?> </span><?php if ($_smarty_tpl->tpl_vars['order_info']->value['company_id']) { ?> / <?php echo htmlspecialchars(fn_get_company_name($_smarty_tpl->tpl_vars['order_info']->value['company_id']), ENT_QUOTES, 'UTF-8'); } ?> </span> <span class="f-small"> <?php if ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "I" && $_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']]) { ?> (<?php echo $_smarty_tpl->__("invoice"); ?> #<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']], ENT_QUOTES, 'UTF-8'); ?> ) <?php } elseif ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "C" && $_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']]) { ?> (<?php echo $_smarty_tpl->__("credit_memo"); ?> #<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']], ENT_QUOTES, 'UTF-8'); ?> ) <?php } ?> <?php $_smarty_tpl->tpl_vars["timestamp"] = new Smarty_variable(rawurlencode(smarty_modifier_date_format($_smarty_tpl->tpl_vars['order_info']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'])), null, 0); ?> / <?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['order_info']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format']), ENT_QUOTES, 'UTF-8'); ?> ,<?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['order_info']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8'); ?> </span> <?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 $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("views/order_management/components/issuer_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('user_data' => $_smarty_tpl->tpl_vars['order_info']->value['issuer_data']), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("views/order_management/components/profiles_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('user_data' => $_smarty_tpl->tpl_vars['order_info']->value, 'location' => "I"), 0); ?> <?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 $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("common/view_tools.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('url' => "orders.details?order_id="), 0); ?> <?php if ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "C" && $_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']]) { ?> <?php $_smarty_tpl->tpl_vars["print_order"] = new Smarty_variable($_smarty_tpl->__("print_credit_memo"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["print_pdf_order"] = new Smarty_variable($_smarty_tpl->__("print_pdf_credit_memo"), null, 0); ?> <?php } elseif ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "O") { ?> <?php $_smarty_tpl->tpl_vars["print_order"] = new Smarty_variable($_smarty_tpl->__("print_order_details"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["print_pdf_order"] = new Smarty_variable($_smarty_tpl->__("print_pdf_order_details"), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["print_order"] = new Smarty_variable($_smarty_tpl->__("print_invoice"), null, 0); ?> <?php $_smarty_tpl->tpl_vars["print_pdf_order"] = new Smarty_variable($_smarty_tpl->__("print_pdf_invoice"), null, 0); ?> <?php } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null); ob_start(); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:details_tools")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:details_tools"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_smarty_tpl->tpl_vars['print_order']->value, 'href' => "orders.print_invoice?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'], 'class' => "cm-new-window")); ?> </li> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_smarty_tpl->tpl_vars['print_pdf_order']->value, 'href' => "orders.print_invoice?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'] . "&format=pdf")); ?> </li> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("print_packing_slip"), 'href' => "orders.print_packing_slip?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'], 'class' => "cm-new-window")); ?> </li> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("print_pdf_packing_slip"), 'href' => "orders.print_packing_slip?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'] . "&format=pdf", 'class' => "cm-new-window")); ?> </li> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("edit_order"), 'href' => "order_management.edit?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'])); ?> </li> <?php echo Smarty::$_smarty_vars['capture']['adv_tools']; ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:details_tools"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?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 smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list'])); ?> <div class="btn-group btn-hover dropleft"> <?php echo $_smarty_tpl->getSubTemplate("buttons/save_changes.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_meta' => "cm-no-ajax dropdown-toggle", 'but_role' => "submit-link", 'but_target_form' => "order_info_form", 'but_name' => "dispatch[orders.update_details]", 'save' => true), 0); ?> <ul class="dropdown-menu"> <li><a><input type="checkbox" name="notify_user" id="notify_user" value="Y" /> <?php echo $_smarty_tpl->__("notify_customer"); ?> </a></li> <li><a><input type="checkbox" name="notify_department" id="notify_department" value="Y" /> <?php echo $_smarty_tpl->__("notify_orders_department"); ?> </a></li> <?php if (fn_allowed_for("MULTIVENDOR")) { ?> <li> <a><input type="checkbox" name="notify_vendor" id="notify_vendor" value="Y" /> <?php echo $_smarty_tpl->__("notify_vendor"); ?> </a> </li> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:notify_checkboxes")); $_block_repeat = true; echo smarty_block_hook(array('name' => "orders:notify_checkboxes"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "orders:notify_checkboxes"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </ul> </div> <?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 echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => Smarty::$_smarty_vars['capture']['mainbox_title'], 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons'], 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'sidebar_position' => "left"), 0); ?> </form> <?php }
protected function getShopName() { $shop_name = $this->options['shop_name']; if (empty($shop_name)) { if (fn_allowed_for('ULTIMATE')) { $shop_name = fn_get_company_name($this->company_id); } else { $shop_name = Registry::get('settings.Company.company_name'); } } return strip_tags($shop_name); }
* * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'complete') { $orders_info = array(); $order_info = Registry::get('view')->getTemplateVars('order_info'); if (!fn_allowed_for('MULTIVENDOR') || fn_allowed_for('MULTIVENDOR') && $order_info['is_parent_order'] == 'N') { $orders_info[0] = $order_info; $orders_info[0]['ga_company_name'] = fn_get_company_name($order_info['company_id']); } else { $order_ids = explode(',', $order_info['child_ids']); foreach ($order_ids as $k => $order_id) { $_order_info = fn_get_order_info($order_id); $orders_info[$k] = $_order_info; $orders_info[$k]['ga_company_name'] = fn_get_company_name($_order_info['company_id']); } } Registry::get('view')->assign('orders_info', $orders_info); }
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; }
function fn_get_sb_providers_meta_data($params) { $addon_settings = Settings::instance()->getValues('social_buttons', 'ADDON'); $providers_meta_data = array(); if (fn_allowed_for('ULTIMATE')) { $company_id = Registry::ifGet('runtime.company_id', fn_get_default_company_id()); $site_name = fn_get_company_name($company_id); } if ($params['object'] == 'products') { $product = Tygh::$app['view']->getTemplateVars('product'); $providers_meta_data['all'] = array('title' => fn_sb_format_page_title(), 'url' => fn_url('products.view?product_id=' . $params['object_id']), 'image' => !empty($product['main_pair']['detailed']['http_image_path']) ? $product['main_pair']['detailed']['http_image_path'] : '', 'image:width' => !empty($product['main_pair']['detailed']['image_x']) ? $product['main_pair']['detailed']['image_x'] : '', 'image:height' => !empty($product['main_pair']['detailed']['image_y']) ? $product['main_pair']['detailed']['image_y'] : '', 'site_name' => !empty($site_name) ? $site_name : Registry::get('settings.Company.company_name')); } elseif ($params['object'] == 'pages') { $page = Tygh::$app['view']->getTemplateVars('page'); $logos = fn_get_logos(); if (fn_allowed_for('ULTIMATE')) { $logos = fn_get_logos($company_id); } $providers_meta_data['all'] = array('title' => $page['page'], 'url' => !empty($page['link']) ? $page['link'] : fn_url('pages.view?product_id=' . $params['object_id']), 'image' => !empty($logos['theme']['image']['http_image_path']) ? $logos['theme']['image']['http_image_path'] : '', 'image:width' => !empty($logos['theme']['image']['image_x']) ? $logos['theme']['image']['image_x'] : '', 'image:height' => !empty($logos['theme']['image']['image_y']) ? $logos['theme']['image']['image_y'] : '', 'site_name' => !empty($site_name) ? $site_name : Registry::get('settings.Company.company_name')); } if (!empty($addon_settings)) { foreach ($addon_settings as $provider_name => $provider_data) { $func_name = 'fn_' . $provider_name . '_prepare_meta_data'; if (is_callable($func_name)) { $providers_meta_data[$provider_name] = call_user_func($func_name, $provider_data, $params); } } } return $providers_meta_data; }
function content_55d2ed05346cd0_99774659($_smarty_tpl) { if (!is_callable('smarty_function_math')) { include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.math.php'; } fn_preload_lang_vars(array('remove', 'edit')); if (intval($_smarty_tpl->tpl_vars['company_id']->value)) { ?> <?php $_smarty_tpl->tpl_vars['company'] = new Smarty_variable(fn_get_company_name($_smarty_tpl->tpl_vars['company_id']->value), null, 0); } else { ?> <?php $_smarty_tpl->tpl_vars['company'] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['ldelim']->value . "company" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, null, 0); } if ($_smarty_tpl->tpl_vars['multiple']->value) { ?> <tr <?php if (!$_smarty_tpl->tpl_vars['clone']->value) { ?> id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['holder']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php } ?> class="cm-js-item <?php if ($_smarty_tpl->tpl_vars['clone']->value) { ?> cm-clone hidden<?php } ?> "> <?php if ($_smarty_tpl->tpl_vars['position_field']->value) { ?> <td><input type="text" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['input_name']->value, ENT_QUOTES, 'UTF-8'); ?> [<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo smarty_function_math(array('equation' => "a*b", 'a' => $_smarty_tpl->tpl_vars['position']->value, 'b' => 10), $_smarty_tpl); ?> " size="3" class="input-text-short"<?php if ($_smarty_tpl->tpl_vars['clone']->value) { ?> disabled="disabled"<?php } ?> /></td><?php } ?> <td><?php if ($_smarty_tpl->tpl_vars['hidden_field']->value) { ?> <input type="hidden" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['input_name']->value, ENT_QUOTES, 'UTF-8'); ?> []" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> " size="3" class="input-text-short"<?php if ($_smarty_tpl->tpl_vars['clone']->value) { ?> disabled="disabled"<?php } ?> /><?php } if (!$_smarty_tpl->tpl_vars['view_only']->value) { ?> <a href="<?php echo htmlspecialchars(fn_url("companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['company_id']->value), ENT_QUOTES, 'UTF-8'); ?> "><?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value, ENT_QUOTES, 'UTF-8'); if (!$_smarty_tpl->tpl_vars['view_only']->value) { ?> </a><?php } ?> </td> <td class="nowrap"> <?php if (!$_smarty_tpl->tpl_vars['hide_delete_button']->value && !$_smarty_tpl->tpl_vars['view_only']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null); ob_start(); ?> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("remove"), 'onclick' => "Tygh." . "\$" . ".cePicker('delete_js_item', '" . (string) $_smarty_tpl->tpl_vars['holder']->value . "', '" . (string) $_smarty_tpl->tpl_vars['company_id']->value . "', 'm'); return false;")); ?> </li> <?php if (!$_smarty_tpl->tpl_vars['hide_edit_button']->value != "view") { ?> <li><?php smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("edit"), 'href' => "companies.update?company_id=" . (string) $_smarty_tpl->tpl_vars['company_id']->value)); ?> </li> <?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(); } ?> <div class="hidden-tools"> <?php smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list'])); ?> </div> <?php } ?> </td> </tr> <?php } else { ?> <<?php if ($_smarty_tpl->tpl_vars['single_line']->value) { ?> span<?php } else { ?> p<?php } ?> <?php if (!$_smarty_tpl->tpl_vars['clone']->value) { ?> id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['holder']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php } ?> class="cm-js-item no-margin<?php if ($_smarty_tpl->tpl_vars['clone']->value) { ?> cm-clone hidden<?php } ?> "> <?php if (!$_smarty_tpl->tpl_vars['first_item']->value && $_smarty_tpl->tpl_vars['single_line']->value) { ?> <span class="cm-comma<?php if ($_smarty_tpl->tpl_vars['clone']->value) { ?> hidden<?php } ?> ">, </span><?php } ?> <input class="input-text-medium cm-picker-value-description<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['extra_class']->value, ENT_QUOTES, 'UTF-8'); ?> " type="text" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['display_input_id']->value) { ?> id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['display_input_id']->value, ENT_QUOTES, 'UTF-8'); ?> "<?php } ?> size="10" name="company_name" readonly="readonly" <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['extra']->value, ENT_QUOTES, 'UTF-8'); ?> /> </<?php if ($_smarty_tpl->tpl_vars['single_line']->value) { ?> span<?php } else { ?> p<?php } ?> > <?php } }
function fn_exim_get_product_options($product_id, $lang_code = '', $features_delimiter = '///') { $pair_delimiter = ':'; $set_delimiter = '; '; $vars_delimiter = ','; $export_fields = fn_exim_get_option_attrs(); $result = array(); $options = fn_get_product_options($product_id, $lang_code); if (!empty($options)) { foreach ($options as $o) { $glob_opt = db_get_field("SELECT option_id FROM ?:product_global_option_links WHERE option_id = ?i AND product_id = ?i", $o['option_id'], $product_id); $prefix = ''; if (!empty($o['company_id'])) { $company_name = fn_get_company_name($o['company_id']); $prefix = '(' . $company_name . ') '; } $str = $prefix . "{$o['option_name']}{$pair_delimiter} {$o['option_type']}" . (empty($glob_opt) ? '' : 'G'); $variants = array(); if (!empty($o['variants'])) { foreach ($o['variants'] as $v) { $variant = $v['variant_name']; if (floatval($v['modifier']) != 0) { $variant .= $features_delimiter . 'modifier=' . $v['modifier']; $variant .= $features_delimiter . 'modifier_type=' . $v['modifier_type']; } if (floatval($v['weight_modifier']) != 0) { $variant .= $features_delimiter . 'weight_modifier=' . $v['weight_modifier']; $variant .= $features_delimiter . 'weight_modifier_type=' . $v['weight_modifier_type']; } if (!empty($v['image_pair']['image_id'])) { $variant .= $features_delimiter . 'image=' . fn_export_image($v['image_pair']['image_id'], 'variant_image', '', false); } fn_set_hook('exim_product_variant', $v, $variant); $variants[] = $variant; } $str .= '[' . implode($vars_delimiter, str_replace($vars_delimiter, '\\\\' . $vars_delimiter, $variants)) . ']'; fn_set_hook('exim_product_option', $o, $str); } foreach ($export_fields as $field) { if (!empty($o[$field])) { $str .= $features_delimiter . $field . '=' . str_replace(array('[', ']'), array('', ''), $o[$field]); } } $result[] = $str; } } return !empty($result) ? implode($set_delimiter, $result) : ''; }
function fn_rus_unisender_place_order($order_id, $action, $order_status, $cart, $auth) { if (Registry::get('addons.rus_unisender.send_sms_admin') == 'Y') { $admin_phone = Registry::get('addons.rus_unisender.admin_phone'); if (!empty($admin_phone)) { $storefront = fn_get_company_name(fn_get_company_id('orders', 'order_id', $order_id)); $text = Registry::get('addons.rus_unisender.send_sms_admin_text'); $text = str_replace('[order_id]', $order_id, $text); $text = str_replace('[storefront]', $storefront, $text); $post = array('api_key' => Registry::get('addons.rus_unisender.api_key'), 'phone' => $admin_phone, 'sender' => fn_substr(Registry::get('addons.rus_unisender.admin_sender'), 0, 11), 'text' => $text); if (!fn_unisender_api('sendSms', $post, $response)) { $email = Registry::get('settings.Company.company_site_administrator'); Mailer::sendMail(array('to' => $email, 'from' => 'company_site_administrator', 'data' => array('phone' => $admin_phone, 'error' => $response), 'tpl' => 'addons/rus_unisender/unisender.tpl', 'company_id' => fn_get_company_id('orders', 'order_id', $order_id)), 'C', CART_LANGUAGE); } } } }
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; case 'companies': if (!empty($params['company_id'])) { $key = 'company_id'; $key_id = $params[$key]; $table = 'companies'; $object_name = fn_get_company_name($key_id); $object_type = __('company'); } break; } fn_set_hook('ult_check_store_permission', $params, $object_type, $object_name, $table, $key, $key_id); if (!empty($object_name)) { if (!empty($check_store_permission)) { $args = array(); foreach ($check_store_permission['args'] as $arg) { if ($arg[0] == '$') { $arg = ltrim($arg, "\$"); $args[] = ${$arg}; } } $result = call_user_func_array($check_store_permission['func'], $args); } else { $result = fn_check_company_id($table, $key, $key_id) || fn_check_shared_company_id($table, $key_id); } } fn_set_hook('ult_check_store_permission_post', $params, $object_type, $object_name, $result); if ($result == false) { fn_set_notification('W', __('warning'), __('store_object_denied', array('[object_type]' => $object_type, '[object_name]' => fn_truncate_chars($object_name, 20))), '', 'store_object_denied'); } return $result; }
/** * @param array $product_ids */ protected static function exportProducts(array $product_ids) { static::$count_success = 0; static::$count_fail = 0; static::$count_skip = 0; static::$errors = array(); static::$error_counter = array(); $product_ids = array_filter($product_ids); $templates = $groups = array(); fn_set_progress('parts', count($product_ids) * 2); foreach ($product_ids as $product_id) { $product = new Product($product_id); if (empty($product->id)) { fn_set_progress('echo', '.'); static::$count_skip++; continue; } if (empty($product->template_id)) { $template = Template::getDefaultByCompanyId($product->company_id); if ($template) { $product->setTemplateId($template->id); $product->saveTemplateId(); } else { $company_name = fn_get_company_name($product->company_id); fn_set_notification('E', __('error'), __('ebay_default_template_not_found', array('[company_name]' => $company_name))); } } if (!empty($product->external_id)) { $api = Client::instance($product->getTemplate()); static::uploadProductImages($product); fn_set_progress('echo', __('ebay_export_product', array('[product]' => htmlspecialchars($product->original_title))), false); $combinations = $product->getCombinations(); $external_combinations = $product->getExternalCombinations(); if (!empty($combinations) && empty($external_combinations)) { $result = $api->getItem($product); if ($result && $result->isSuccess()) { $product->setExternalCombinations($result->getProductVariations()); } } $result = $api->reviseItem($product); if ($result) { if ($result->isSuccess()) { $product->setStatusActive(); $product->saveExternalData(); } elseif ($result->issetErrorAuctionEnded()) { $result = $api->relistItem($product); if ($result && $result->isSuccess()) { Product::deleteExternalData($product->external_id); $product->external_id = $result->getExternalId(); $product->saveExternalData(); $product->setStatusActive(); } } } if ($result) { if ($result->isSuccess()) { static::$count_success++; ProductLogger::info(ProductLogger::ACTION_UPDATE_PRODUCT, $product, __('ebay_success_exported_product_notice')); } else { static::$count_fail++; } static::checkResponse($product, $result, ProductLogger::ACTION_UPDATE_PRODUCT); } else { static::checkInternalErrors($product, $api, ProductLogger::ACTION_UPDATE_PRODUCT); } fn_set_progress('echo', '.'); } else { $groups[$product->template_id][] = $product; $templates[$product->template_id] = $product->getTemplate(); if (count($groups[$product->template_id]) >= static::MAX_COUNT_EXPORT_NEW_PRODUCTS) { static::exportGroupProducts($product->getTemplate(), $groups[$product->template_id]); unset($groups[$product->template_id]); } } } if (!empty($groups)) { foreach ($groups as $template_id => $products) { static::exportGroupProducts($templates[$template_id], $products); } } /** @var \Smarty $smarty */ $smarty = Tygh::$app['view']; $smarty->assign('export_result', array('count_success' => static::$count_success, 'count_fail' => static::$count_fail, 'count_skip' => static::$count_skip, 'errors' => static::$errors, 'error_counter' => static::$error_counter, 'count_external_error' => static::$count_external_error)); fn_set_notification('I', static::$count_fail == 0 ? __('ebay_export_success') : __('ebay_export_failed'), $smarty->fetch('addons/ebay/views/ebay/components/export_summary.tpl')); }
function content_55ccec9f0b62b2_41072375($_smarty_tpl) { if (!is_callable('smarty_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('vendor', 'vendor')); if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") { $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null); ob_start(); if (fn_allowed_for("MULTIVENDOR") && ($_smarty_tpl->tpl_vars['company_name']->value || $_smarty_tpl->tpl_vars['company_id']->value) && $_smarty_tpl->tpl_vars['settings']->value['Vendors']['display_vendor'] == "Y") { ?> <div class="ty-control-group<?php if (!$_smarty_tpl->tpl_vars['capture_options_vs_qty']->value) { ?> product-list-field<?php } ?> "> <label class="ty-control-group__label"><?php echo $_smarty_tpl->__("vendor"); ?> :</label> <span class="ty-control-group__item"><a href="<?php echo htmlspecialchars(fn_url("companies.view?company_id=" . (string) $_smarty_tpl->tpl_vars['company_id']->value), ENT_QUOTES, 'UTF-8'); ?> "><?php if ($_smarty_tpl->tpl_vars['company_name']->value) { echo htmlspecialchars($_smarty_tpl->tpl_vars['company_name']->value, ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars(fn_get_company_name($_smarty_tpl->tpl_vars['company_id']->value), ENT_QUOTES, 'UTF-8'); } ?> </a></span> </div> <?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(); } if (trim(Smarty::$_smarty_vars['capture']['template_content'])) { if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") { ?> <span class="cm-template-box template-box" data-ca-te-template="views/companies/components/product_company_data.tpl" id="<?php echo smarty_function_set_id(array('name' => "views/companies/components/product_company_data.tpl"), $_smarty_tpl); ?> "><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php echo Smarty::$_smarty_vars['capture']['template_content']; ?> <!--[/tpl_id]--></span><?php } else { echo Smarty::$_smarty_vars['capture']['template_content']; } } } else { if (fn_allowed_for("MULTIVENDOR") && ($_smarty_tpl->tpl_vars['company_name']->value || $_smarty_tpl->tpl_vars['company_id']->value) && $_smarty_tpl->tpl_vars['settings']->value['Vendors']['display_vendor'] == "Y") { ?> <div class="ty-control-group<?php if (!$_smarty_tpl->tpl_vars['capture_options_vs_qty']->value) { ?> product-list-field<?php } ?> "> <label class="ty-control-group__label"><?php echo $_smarty_tpl->__("vendor"); ?> :</label> <span class="ty-control-group__item"><a href="<?php echo htmlspecialchars(fn_url("companies.view?company_id=" . (string) $_smarty_tpl->tpl_vars['company_id']->value), ENT_QUOTES, 'UTF-8'); ?> "><?php if ($_smarty_tpl->tpl_vars['company_name']->value) { echo htmlspecialchars($_smarty_tpl->tpl_vars['company_name']->value, ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars(fn_get_company_name($_smarty_tpl->tpl_vars['company_id']->value), ENT_QUOTES, 'UTF-8'); } ?> </a></span> </div> <?php } } }
} } if ($mode == 'export') { $products_data = db_get_hash_multi_array("SELECT product_id,company_id,ebay_template_id FROM ?:products WHERE product_id IN (?n)", array('company_id', 'product_id'), $_REQUEST['product_ids']); $template_ids = array(); if (!empty($products_data)) { foreach ($products_data as $company_id => $products) { foreach ($products as $product_id => $product) { if (!empty($product['ebay_template_id'])) { $template_ids[$product['ebay_template_id']][] = $product_id; } else { $default_template_id = db_get_field("SELECT template_id FROM ?:ebay_templates WHERE use_as_default = 'Y' AND company_id = ?i", $company_id); if (!empty($default_template_id)) { $template_ids[$default_template_id][] = $product_id; } else { $company_name = fn_get_company_name($company_id); fn_set_notification('E', __('error'), __('ebay_default_template_not_found', array('[company_name]' => $company_name))); } } } } } $result = true; foreach ($template_ids as $template_id => $product_ids) { //We can switch sharing of because we select necessary templates before. Registry::set('runtime.skip_sharing_selection', true); $template_data = fn_get_ebay_template($template_id); Registry::set('runtime.skip_sharing_selection', false); $result = fn_export_ebay_products($template_data, $product_ids, $auth); } if (!$result) {
function content_55d3121dab33e1_00340469($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php'; } if (!is_callable('smarty_modifier_truncate')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.truncate.php'; } if (!is_callable('smarty_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('find_results_with', 'any_words', 'all_words', 'exact_phrase', 'search_in', 'product_name', 'short_description', 'full_description', 'keywords', 'search_in_category', 'all_categories', 'all_categories', 'search_in_subcategories', 'advanced_search_options', 'search_by_vendor', 'all_vendors', 'search_by_sku', 'search_by_price', 'search_by_weight', 'or', 'reset', 'search_options', 'find_results_with', 'any_words', 'all_words', 'exact_phrase', 'search_in', 'product_name', 'short_description', 'full_description', 'keywords', 'search_in_category', 'all_categories', 'all_categories', 'search_in_subcategories', 'advanced_search_options', 'search_by_vendor', 'all_vendors', 'search_by_sku', 'search_by_price', 'search_by_weight', 'or', 'reset', 'search_options')); if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") { $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null); ob_start(); $_smarty_tpl->_capture_stack[0][] = array("section", null, null); ob_start(); ?> <div class="ls_advanced_search_form_container"> <form action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " name="advanced_search_form" method="get" class="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['form_meta']->value, ENT_QUOTES, 'UTF-8'); ?> "> <input type="hidden" name="search_performed" value="Y" /> <?php if ($_smarty_tpl->tpl_vars['put_request_vars']->value) { ?> <?php $_smarty_tpl->tpl_vars["v"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["v"]->_loop = false; $_smarty_tpl->tpl_vars["k"] = new Smarty_Variable(); $_from = $_REQUEST; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["v"]->key => $_smarty_tpl->tpl_vars["v"]->value) { $_smarty_tpl->tpl_vars["v"]->_loop = true; $_smarty_tpl->tpl_vars["k"]->value = $_smarty_tpl->tpl_vars["v"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['v']->value && $_smarty_tpl->tpl_vars['k']->value != "callback") { ?> <input type="hidden" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8'); ?> " value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <?php } ?> <?php } ?> <?php } ?> <?php echo $_smarty_tpl->tpl_vars['search_extra']->value; ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_query_input")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:search_query_input"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ls_simple_search_options span6"> <div class="ty-control-group"> <label for="match" class="ty-control-group__title"><?php echo $_smarty_tpl->__("find_results_with"); ?> </label> <select name="match" id="match"> <option <?php if ($_smarty_tpl->tpl_vars['search']->value['match'] == "any") { ?> selected="selected"<?php } ?> value="any"><?php echo $_smarty_tpl->__("any_words"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['search']->value['match'] == "all") { ?> selected="selected"<?php } ?> value="all"><?php echo $_smarty_tpl->__("all_words"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['search']->value['match'] == "exact") { ?> selected="selected"<?php } ?> value="exact"><?php echo $_smarty_tpl->__("exact_phrase"); ?> </option> </select> <input type="text" name="q" size="38" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['q'], ENT_QUOTES, 'UTF-8'); ?> " class="ty-search-form__input ty-search-form__input-large" /> </div> <div class="ty-control-group"> <label class="ty-control-group__title"><?php echo $_smarty_tpl->__("search_in"); ?> </label> <div class="ty-select-field"> <input type="hidden" name="pname" value="N" /> <input type="hidden" name="ls_cname" value="N" /> <label for="pname" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pname'] == "Y" || !$_smarty_tpl->tpl_vars['search']->value['pname']) { ?> checked="checked"<?php } ?> name="pname" id="pname" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("product_name"); ?> </label> <label for="pshort" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pshort'] == "Y") { ?> checked="checked"<?php } ?> name="pshort" id="pshort" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("short_description"); ?> </label> <label for="pfull" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pfull'] == "Y") { ?> checked="checked"<?php } ?> name="pfull" id="pfull" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("full_description"); ?> </label> <label for="pkeywords" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pkeywords'] == "Y") { ?> checked="checked"<?php } ?> name="pkeywords" id="pkeywords" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("keywords"); ?> </label> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_in")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:search_in"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:search_in"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:search_query_input"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <div class="ty-control-group"> <label class="ty-control-group__title"><?php echo $_smarty_tpl->__("search_in_category"); ?> </label> <?php if (fn_show_picker("categories", @constant('CATEGORY_THRESHOLD'))) { ?> <?php if ($_smarty_tpl->tpl_vars['search']->value['cid']) { ?> <?php $_smarty_tpl->tpl_vars["s_cid"] = new Smarty_variable($_smarty_tpl->tpl_vars['search']->value['cid'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["s_cid"] = new Smarty_variable("0", null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/categories/picker.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_id' => "location_category", 'input_name' => "cid", 'item_ids' => $_smarty_tpl->tpl_vars['s_cid']->value, 'hide_link' => true, 'hide_delete_button' => true, 'default_name' => __("all_categories"), 'extra' => ''), 0); ?> <?php } else { ?> <div class="ty-float-left"> <?php $_smarty_tpl->tpl_vars["all_categories"] = new Smarty_variable(fn_get_plain_categories_tree(0, false), null, 0); ?> <select name="cid"> <option value="0" <?php if ($_smarty_tpl->tpl_vars['category_data']->value['parent_id'] == "0") { ?> selected<?php } ?> >- <?php echo $_smarty_tpl->__("all_categories"); ?> -</option> <?php $_smarty_tpl->tpl_vars["cat"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["cat"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['all_categories']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["cat"]->key => $_smarty_tpl->tpl_vars["cat"]->value) { $_smarty_tpl->tpl_vars["cat"]->_loop = true; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category_id'], ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['cat']->value['disabled']) { ?> disabled="disabled"<?php } if ($_smarty_tpl->tpl_vars['search']->value['cid'] == $_smarty_tpl->tpl_vars['cat']->value['category_id']) { ?> selected="selected"<?php } ?> title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8'); ?> "><?php echo preg_replace('!^!m', str_repeat("¦ ", $_smarty_tpl->tpl_vars['cat']->value['level']), smarty_modifier_truncate(htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8', true), 50, "...", true)); ?> </option> <?php } ?> </select> </div> <?php } ?> <div class="ty-select-field ty-subcategories-field clearfix"> <input type="hidden" name="subcats" value="N" /> <label for="subcats" class="ty-select-field__label"> <input type="checkbox" value="Y"<?php if ($_smarty_tpl->tpl_vars['search']->value['subcats'] == "Y" || !$_smarty_tpl->tpl_vars['search']->value['subcats']) { ?> checked="checked"<?php } ?> name="subcats" id="subcats" class="checkbox ty-select-field__checkbox" /> <?php echo $_smarty_tpl->__("search_in_subcategories"); ?> </label> </div> </div> </div> <?php if (!$_smarty_tpl->tpl_vars['simple_search_form']->value) { ?> <div class="ls_advanced_search_options span5"> <div class="ty-control-group__title"><?php echo $_smarty_tpl->__("advanced_search_options"); ?> </div> <div class="ty-control-group"> <input type="hidden" name="company_id" id="company_id" value="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['search']->value['company_id']) === null || $tmp === '' ? '' : $tmp, ENT_QUOTES, 'UTF-8'); ?> " /> <?php if (fn_allowed_for("MULTIVENDOR")) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/ajax_select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('label' => __("search_by_vendor"), 'data_url' => "companies.get_companies_list?show_all=Y&search=Y", 'text' => ($tmp = @fn_get_company_name($_smarty_tpl->tpl_vars['search']->value['company_id'])) === null || $tmp === '' ? $_smarty_tpl->__("all_vendors") : $tmp, 'result_elm' => "company_id", 'id' => "company_id_selector"), 0); ?> <?php } ?> </div> <div class="ty-control-group"> <label for="pcode" class="ty-select-field__label"><?php echo $_smarty_tpl->__("search_by_sku"); ?> </label> <input type="text" name="pcode" id="pcode" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['pcode'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> </div> <?php $_smarty_tpl->tpl_vars["have_price_filter"] = new Smarty_variable(0, null, 0); ?> <?php $_smarty_tpl->tpl_vars["ff"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["ff"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['filter_features']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["ff"]->key => $_smarty_tpl->tpl_vars["ff"]->value) { $_smarty_tpl->tpl_vars["ff"]->_loop = true; if ($_smarty_tpl->tpl_vars['ff']->value['field_type'] == "P") { $_smarty_tpl->tpl_vars["have_price_filter"] = new Smarty_variable(1, null, 0); } } ?> <?php if (!$_smarty_tpl->tpl_vars['have_price_filter']->value) { ?> <div class="ty-control-group"> <label for="price_from" class="ty-select-field__label"><?php echo $_smarty_tpl->__("search_by_price"); ?> (<?php echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['primary_currency']->value]['symbol']; ?> )</label> <input type="text" name="price_from" id="price_from" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['price_from'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> - <input type="text" name="price_to" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['price_to'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> </div> <?php } ?> <div class="ty-control-group"> <label for="weight_from" class="ty-select-field__label"><?php echo $_smarty_tpl->__("search_by_weight"); ?> (<?php if ($_smarty_tpl->tpl_vars['config']->value['localization']['weight_symbol']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['config']->value['localization']['weight_symbol'], ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars($_smarty_tpl->tpl_vars['settings']->value['General']['weight_symbol'], ENT_QUOTES, 'UTF-8'); } ?> )</label> <input type="text" name="weight_from" id="weight_from" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['weight_from'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> - <input type="text" name="weight_to" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['weight_to'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> </div> <?php echo $_smarty_tpl->getSubTemplate("views/products/components/product_filters_advanced_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php } ?> </div> <div class="ty-search-form__buttons-container buttons-container ls_search_page_buttons span12"> <?php echo $_smarty_tpl->getSubTemplate("buttons/search.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[" . (string) $_smarty_tpl->tpl_vars['dispatch']->value . "]"), 0); ?> <?php echo $_smarty_tpl->__("or"); ?> <a class="ty-btn ty-btn__tertiary cm-reset-link"><?php echo $_smarty_tpl->__("reset"); ?> </a> </div> </form> </div> <?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 echo $_smarty_tpl->getSubTemplate("common/section.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section_title' => __("search_options"), 'section_content' => Smarty::$_smarty_vars['capture']['section'], 'class' => "ty-search-form"), 0); ?> <?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(); } if (trim(Smarty::$_smarty_vars['capture']['template_content'])) { if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") { ?> <span class="cm-template-box template-box" data-ca-te-template="views/products/components/products_search_form.tpl" id="<?php echo smarty_function_set_id(array('name' => "views/products/components/products_search_form.tpl"), $_smarty_tpl); ?> "><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php echo Smarty::$_smarty_vars['capture']['template_content']; ?> <!--[/tpl_id]--></span><?php } else { echo Smarty::$_smarty_vars['capture']['template_content']; } } } else { $_smarty_tpl->_capture_stack[0][] = array("section", null, null); ob_start(); ?> <div class="ls_advanced_search_form_container"> <form action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " name="advanced_search_form" method="get" class="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['form_meta']->value, ENT_QUOTES, 'UTF-8'); ?> "> <input type="hidden" name="search_performed" value="Y" /> <?php if ($_smarty_tpl->tpl_vars['put_request_vars']->value) { ?> <?php $_smarty_tpl->tpl_vars["v"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["v"]->_loop = false; $_smarty_tpl->tpl_vars["k"] = new Smarty_Variable(); $_from = $_REQUEST; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["v"]->key => $_smarty_tpl->tpl_vars["v"]->value) { $_smarty_tpl->tpl_vars["v"]->_loop = true; $_smarty_tpl->tpl_vars["k"]->value = $_smarty_tpl->tpl_vars["v"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['v']->value && $_smarty_tpl->tpl_vars['k']->value != "callback") { ?> <input type="hidden" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['k']->value, ENT_QUOTES, 'UTF-8'); ?> " value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['v']->value, ENT_QUOTES, 'UTF-8'); ?> " /> <?php } ?> <?php } ?> <?php } ?> <?php echo $_smarty_tpl->tpl_vars['search_extra']->value; ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_query_input")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:search_query_input"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ls_simple_search_options span6"> <div class="ty-control-group"> <label for="match" class="ty-control-group__title"><?php echo $_smarty_tpl->__("find_results_with"); ?> </label> <select name="match" id="match"> <option <?php if ($_smarty_tpl->tpl_vars['search']->value['match'] == "any") { ?> selected="selected"<?php } ?> value="any"><?php echo $_smarty_tpl->__("any_words"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['search']->value['match'] == "all") { ?> selected="selected"<?php } ?> value="all"><?php echo $_smarty_tpl->__("all_words"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['search']->value['match'] == "exact") { ?> selected="selected"<?php } ?> value="exact"><?php echo $_smarty_tpl->__("exact_phrase"); ?> </option> </select> <input type="text" name="q" size="38" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['q'], ENT_QUOTES, 'UTF-8'); ?> " class="ty-search-form__input ty-search-form__input-large" /> </div> <div class="ty-control-group"> <label class="ty-control-group__title"><?php echo $_smarty_tpl->__("search_in"); ?> </label> <div class="ty-select-field"> <input type="hidden" name="pname" value="N" /> <input type="hidden" name="ls_cname" value="N" /> <label for="pname" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pname'] == "Y" || !$_smarty_tpl->tpl_vars['search']->value['pname']) { ?> checked="checked"<?php } ?> name="pname" id="pname" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("product_name"); ?> </label> <label for="pshort" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pshort'] == "Y") { ?> checked="checked"<?php } ?> name="pshort" id="pshort" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("short_description"); ?> </label> <label for="pfull" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pfull'] == "Y") { ?> checked="checked"<?php } ?> name="pfull" id="pfull" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("full_description"); ?> </label> <label for="pkeywords" class="ty-select-field__label"> <input type="checkbox" value="Y" <?php if ($_smarty_tpl->tpl_vars['search']->value['pkeywords'] == "Y") { ?> checked="checked"<?php } ?> name="pkeywords" id="pkeywords" class="checkbox ty-select-field__checkbox" /><?php echo $_smarty_tpl->__("keywords"); ?> </label> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:search_in")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:search_in"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:search_in"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:search_query_input"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <div class="ty-control-group"> <label class="ty-control-group__title"><?php echo $_smarty_tpl->__("search_in_category"); ?> </label> <?php if (fn_show_picker("categories", @constant('CATEGORY_THRESHOLD'))) { ?> <?php if ($_smarty_tpl->tpl_vars['search']->value['cid']) { ?> <?php $_smarty_tpl->tpl_vars["s_cid"] = new Smarty_variable($_smarty_tpl->tpl_vars['search']->value['cid'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["s_cid"] = new Smarty_variable("0", null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/categories/picker.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_id' => "location_category", 'input_name' => "cid", 'item_ids' => $_smarty_tpl->tpl_vars['s_cid']->value, 'hide_link' => true, 'hide_delete_button' => true, 'default_name' => __("all_categories"), 'extra' => ''), 0); ?> <?php } else { ?> <div class="ty-float-left"> <?php $_smarty_tpl->tpl_vars["all_categories"] = new Smarty_variable(fn_get_plain_categories_tree(0, false), null, 0); ?> <select name="cid"> <option value="0" <?php if ($_smarty_tpl->tpl_vars['category_data']->value['parent_id'] == "0") { ?> selected<?php } ?> >- <?php echo $_smarty_tpl->__("all_categories"); ?> -</option> <?php $_smarty_tpl->tpl_vars["cat"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["cat"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['all_categories']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["cat"]->key => $_smarty_tpl->tpl_vars["cat"]->value) { $_smarty_tpl->tpl_vars["cat"]->_loop = true; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category_id'], ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['cat']->value['disabled']) { ?> disabled="disabled"<?php } if ($_smarty_tpl->tpl_vars['search']->value['cid'] == $_smarty_tpl->tpl_vars['cat']->value['category_id']) { ?> selected="selected"<?php } ?> title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8'); ?> "><?php echo preg_replace('!^!m', str_repeat("¦ ", $_smarty_tpl->tpl_vars['cat']->value['level']), smarty_modifier_truncate(htmlspecialchars($_smarty_tpl->tpl_vars['cat']->value['category'], ENT_QUOTES, 'UTF-8', true), 50, "...", true)); ?> </option> <?php } ?> </select> </div> <?php } ?> <div class="ty-select-field ty-subcategories-field clearfix"> <input type="hidden" name="subcats" value="N" /> <label for="subcats" class="ty-select-field__label"> <input type="checkbox" value="Y"<?php if ($_smarty_tpl->tpl_vars['search']->value['subcats'] == "Y" || !$_smarty_tpl->tpl_vars['search']->value['subcats']) { ?> checked="checked"<?php } ?> name="subcats" id="subcats" class="checkbox ty-select-field__checkbox" /> <?php echo $_smarty_tpl->__("search_in_subcategories"); ?> </label> </div> </div> </div> <?php if (!$_smarty_tpl->tpl_vars['simple_search_form']->value) { ?> <div class="ls_advanced_search_options span5"> <div class="ty-control-group__title"><?php echo $_smarty_tpl->__("advanced_search_options"); ?> </div> <div class="ty-control-group"> <input type="hidden" name="company_id" id="company_id" value="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['search']->value['company_id']) === null || $tmp === '' ? '' : $tmp, ENT_QUOTES, 'UTF-8'); ?> " /> <?php if (fn_allowed_for("MULTIVENDOR")) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/ajax_select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('label' => __("search_by_vendor"), 'data_url' => "companies.get_companies_list?show_all=Y&search=Y", 'text' => ($tmp = @fn_get_company_name($_smarty_tpl->tpl_vars['search']->value['company_id'])) === null || $tmp === '' ? $_smarty_tpl->__("all_vendors") : $tmp, 'result_elm' => "company_id", 'id' => "company_id_selector"), 0); ?> <?php } ?> </div> <div class="ty-control-group"> <label for="pcode" class="ty-select-field__label"><?php echo $_smarty_tpl->__("search_by_sku"); ?> </label> <input type="text" name="pcode" id="pcode" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['pcode'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> </div> <?php $_smarty_tpl->tpl_vars["have_price_filter"] = new Smarty_variable(0, null, 0); ?> <?php $_smarty_tpl->tpl_vars["ff"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["ff"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['filter_features']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["ff"]->key => $_smarty_tpl->tpl_vars["ff"]->value) { $_smarty_tpl->tpl_vars["ff"]->_loop = true; if ($_smarty_tpl->tpl_vars['ff']->value['field_type'] == "P") { $_smarty_tpl->tpl_vars["have_price_filter"] = new Smarty_variable(1, null, 0); } } ?> <?php if (!$_smarty_tpl->tpl_vars['have_price_filter']->value) { ?> <div class="ty-control-group"> <label for="price_from" class="ty-select-field__label"><?php echo $_smarty_tpl->__("search_by_price"); ?> (<?php echo $_smarty_tpl->tpl_vars['currencies']->value[$_smarty_tpl->tpl_vars['primary_currency']->value]['symbol']; ?> )</label> <input type="text" name="price_from" id="price_from" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['price_from'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> - <input type="text" name="price_to" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['price_to'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> </div> <?php } ?> <div class="ty-control-group"> <label for="weight_from" class="ty-select-field__label"><?php echo $_smarty_tpl->__("search_by_weight"); ?> (<?php if ($_smarty_tpl->tpl_vars['config']->value['localization']['weight_symbol']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['config']->value['localization']['weight_symbol'], ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars($_smarty_tpl->tpl_vars['settings']->value['General']['weight_symbol'], ENT_QUOTES, 'UTF-8'); } ?> )</label> <input type="text" name="weight_from" id="weight_from" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['weight_from'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> - <input type="text" name="weight_to" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['weight_to'], ENT_QUOTES, 'UTF-8'); ?> " onfocus="this.select();" class="ty-search-form__input" size="30" /> </div> <?php echo $_smarty_tpl->getSubTemplate("views/products/components/product_filters_advanced_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <?php } ?> </div> <div class="ty-search-form__buttons-container buttons-container ls_search_page_buttons span12"> <?php echo $_smarty_tpl->getSubTemplate("buttons/search.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[" . (string) $_smarty_tpl->tpl_vars['dispatch']->value . "]"), 0); ?> <?php echo $_smarty_tpl->__("or"); ?> <a class="ty-btn ty-btn__tertiary cm-reset-link"><?php echo $_smarty_tpl->__("reset"); ?> </a> </div> </form> </div> <?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 echo $_smarty_tpl->getSubTemplate("common/section.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('section_title' => __("search_options"), 'section_content' => Smarty::$_smarty_vars['capture']['section'], 'class' => "ty-search-form"), 0); ?> <?php } }
function content_55ccecdbacf151_52396674($_smarty_tpl) { fn_preload_lang_vars(array('vendor')); if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] && (!$_smarty_tpl->tpl_vars['selected']->value || fn_allowed_for("MULTIVENDOR")) && !$_smarty_tpl->tpl_vars['disable_company_picker']->value) { ?> <?php $_smarty_tpl->tpl_vars['selected'] = new Smarty_variable($_smarty_tpl->tpl_vars['runtime']->value['company_id'], null, 0); } ?> <?php if (!$_smarty_tpl->tpl_vars['selected']->value) { ?> <?php if ($_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value) { ?> <?php $_smarty_tpl->tpl_vars['selected'] = new Smarty_variable("0", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['selected'] = new Smarty_variable(fn_get_default_company_id(), null, 0); ?> <?php } } ?> <?php if ($_smarty_tpl->tpl_vars['reload_form']->value) { ?> <?php $_smarty_tpl->tpl_vars['js_action'] = new Smarty_variable("fn_reload_form(elm);", null, 0); } ?> <?php $_smarty_tpl->_capture_stack[0][] = array("c_body", null, null); ob_start(); ?> <input type="hidden" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['name']->value, ENT_QUOTES, 'UTF-8'); ?> " id="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['id']->value) === null || $tmp === '' ? "company_id" : $tmp, ENT_QUOTES, 'UTF-8'); ?> " value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['selected']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php if (!$_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate']) { ?> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] || $_smarty_tpl->tpl_vars['disable_company_picker']->value) { ?> <div class="text-type-value"><?php echo htmlspecialchars(fn_get_company_name($_smarty_tpl->tpl_vars['selected']->value, $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value), ENT_QUOTES, 'UTF-8'); ?> </div> <?php } else { ?> <div class="text-type-value ajax-select-wrap <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php if ($_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value) { ?> <?php $_smarty_tpl->tpl_vars['url_extra'] = new Smarty_variable("&show_all=Y&default_label=" . (string) $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value, null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("common/ajax_select_object.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('data_url' => "companies.get_companies_list?onclick=" . (string) $_smarty_tpl->tpl_vars['onclick']->value . (string) $_smarty_tpl->tpl_vars['url_extra']->value, 'text' => fn_get_company_name($_smarty_tpl->tpl_vars['selected']->value, $_smarty_tpl->tpl_vars['zero_company_id_name_lang_var']->value), 'result_elm' => ($tmp = @$_smarty_tpl->tpl_vars['id']->value) === null || $tmp === '' ? "company_id" : $tmp, 'id' => (string) $_smarty_tpl->tpl_vars['id']->value . "_selector", 'js_action' => $_smarty_tpl->tpl_vars['js_action']->value), 0); ?> </div> <?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['runtime']->value['simple_ultimate']) { ?> <?php if (!$_smarty_tpl->tpl_vars['no_wrap']->value) { ?> <div class="control-group"> <label class="control-label" for="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['id']->value) === null || $tmp === '' ? "company_id" : $tmp, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("vendor"); if ($_smarty_tpl->tpl_vars['tooltip']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("tooltip", null, null); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['tooltip']->value, ENT_QUOTES, 'UTF-8'); 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(); } echo $_smarty_tpl->getSubTemplate("common/tooltip.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tooltip' => Smarty::$_smarty_vars['capture']['tooltip']), 0); } ?> </label> <div class="controls"> <?php echo Smarty::$_smarty_vars['capture']['c_body']; ?> </div> </div> <?php } else { ?> <?php echo Smarty::$_smarty_vars['capture']['c_body']; ?> <?php } } else { ?> <?php echo Smarty::$_smarty_vars['capture']['c_body']; ?> <?php } }
/** * Hook for modify shippings groups * * @param array $cart Cart array * @param array $allow * @param array $product_groups Products groups from cart */ function fn_suppliers_pre_place_order(&$cart, &$allow, &$product_groups) { if (Registry::get('addons.suppliers.display_shipping_methods_separately') == 'N') { return; } $new_product_groups = array(); foreach ($product_groups as $key_group => $group) { if (empty($new_product_groups[$group['company_id']])) { $new_product_groups[$group['company_id']] = $group; $new_product_groups[$group['company_id']]['name'] = fn_get_company_name($group['company_id']); $new_product_groups[$group['company_id']]['products'] = array(); $new_product_groups[$group['company_id']]['chosen_shippings'] = array(); if (!empty($group['supplier_id'])) { unset($new_product_groups[$group['company_id']]['supplier_id']); } } foreach ($group['products'] as $cart_id => $product) { $group['products'][$cart_id]['extra']['group_key'] = $key_group; $cart['products'][$cart_id]['extra']['group_key'] = $key_group; } if (!empty($group['supplier_id'])) { foreach ($group['products'] as $cart_id => $product) { $group['products'][$cart_id]['extra']['supplier_id'] = $group['supplier_id']; $cart['products'][$cart_id]['extra']['supplier_id'] = $group['supplier_id']; } } if (!empty($group['chosen_shippings'])) { $group['chosen_shippings'][0]['group_name'] = $group['name']; $new_product_groups[$group['company_id']]['chosen_shippings'] = array_merge($new_product_groups[$group['company_id']]['chosen_shippings'], $group['chosen_shippings']); } $new_product_groups[$group['company_id']]['products'] = $new_product_groups[$group['company_id']]['products'] + $group['products']; } $product_groups = array_values($new_product_groups); }
function fn_facebook_prepare_meta_data($provider_data, $params) { $addon_settings = Settings::instance()->getValues('social_buttons', 'ADDON'); if (fn_allowed_for('ULTIMATE')) { $company_id = Registry::ifGet('runtime.company_id', fn_get_default_company_id()); $site_name = fn_get_company_name($company_id); } if ($params['object'] == 'products') { $product = Registry::get('view')->getTemplateVars('product'); $return = array('type' => !empty($product['facebook_product_type']) ? $product['facebook_product_type'] : '', 'title' => fn_sb_format_page_title(), 'url' => fn_url('products.view?product_id=' . $params['object_id']), 'image' => !empty($product['main_pair']['detailed']['http_image_path']) ? $product['main_pair']['detailed']['http_image_path'] : '', 'site_name' => !empty($site_name) ? $site_name : Registry::get('settings.Company.company_name'), 'app_id' => !empty($addon_settings['facebook']['facebook_app_id']) ? $addon_settings['facebook']['facebook_app_id'] : ''); } elseif ($params['object'] == 'pages') { $page = Registry::get('view')->getTemplateVars('page'); $logos = fn_get_logos(); if (fn_allowed_for('ULTIMATE')) { $logos = fn_get_logos($company_id); } $return = array('type' => !empty($page['facebook_obj_type']) ? $page['facebook_obj_type'] : '', 'title' => $page['page'], 'url' => !empty($page['link']) ? $page['link'] : fn_url('pages.view?product_id=' . $params['object_id']), 'image' => $logos['theme']['image']['http_image_path'], 'site_name' => !empty($site_name) ? $site_name : Registry::get('settings.Company.company_name'), 'app_id' => !empty($addon_settings['facebook']['facebook_app_id']) ? $addon_settings['facebook']['facebook_app_id'] : ''); } return $return; }
function content_55ccecdc6167f9_40532293($_smarty_tpl) { fn_preload_lang_vars(array('global_options', 'vendor', 'apply_as_link', 'apply', 'add_global_option', 'add_global_option', 'forbidden_combinations', 'allowed_combinations', 'forbidden_combinations', 'allowed_combinations', 'option_combinations', 'text_options_no_inventory', 'note', 'option_combinations')); $_smarty_tpl->_capture_stack[0][] = array("extra", null, null); ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['global_options']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("add_global_option", null, null); ob_start(); ?> <form action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" name="apply_global_option" class="form-horizontal form-edit"> <input type="hidden" name="product_id" value="<?php echo htmlspecialchars($_REQUEST['product_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="selected_section" value="options" /> <div class="control-group"> <label class="control-label" for="global_option_id"><?php echo $_smarty_tpl->__("global_options"); ?> </label> <div class="controls"> <select name="global_option[id]" id="global_option_id"> <?php $_smarty_tpl->tpl_vars["option_"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["option_"]->_loop = false; $_smarty_tpl->tpl_vars["id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['global_options']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["option_"]->key => $_smarty_tpl->tpl_vars["option_"]->value) { $_smarty_tpl->tpl_vars["option_"]->_loop = true; $_smarty_tpl->tpl_vars["id"]->value = $_smarty_tpl->tpl_vars["option_"]->key; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['option_']->value['option_id'], ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['option_']->value['option_name'], ENT_QUOTES, 'UTF-8'); if ($_smarty_tpl->tpl_vars['option_']->value['company_id']) { ?> (<?php echo $_smarty_tpl->__("vendor"); ?> : <?php echo htmlspecialchars(fn_get_company_name($_smarty_tpl->tpl_vars['option_']->value['company_id']), ENT_QUOTES, 'UTF-8'); ?> )<?php } ?> </option> <?php } ?> </select> </div> </div> <div class="control-group"> <label class="control-label" for="global_option_link"><?php echo $_smarty_tpl->__("apply_as_link"); ?> </label> <div class="controls"> <input type="hidden" name="global_option[link]" value="N" /> <input type="checkbox" name="global_option[link]" id="global_option_link" value="Y"/> </div> </div> <div class="buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("apply"), 'but_name' => "dispatch[products.apply_global_option]", 'cancel_action' => "close"), 0); ?> </div> </form> <?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(); } ?> <div class="pull-right shift-left"> <?php echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_global_option", 'text' => __("add_global_option"), 'content' => Smarty::$_smarty_vars['capture']['add_global_option'], 'link_text' => __("add_global_option"), 'act' => "general", 'icon' => "icon-plus"), 0); ?> </div> <?php } ?> <div class="pull-left"> <?php if ($_smarty_tpl->tpl_vars['product_options']->value) { ?> <?php if (!fn_allowed_for("ULTIMATE:FREE")) { ?> <?php if ($_smarty_tpl->tpl_vars['product_data']->value['exceptions_type'] == "F") { ?> <?php $_smarty_tpl->tpl_vars["except_title"] = new Smarty_variable($_smarty_tpl->__("forbidden_combinations"), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["except_title"] = new Smarty_variable($_smarty_tpl->__("allowed_combinations"), null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => $_smarty_tpl->tpl_vars['except_title']->value, 'but_href' => "product_options.exceptions?product_id=" . (string) $_smarty_tpl->tpl_vars['product_data']->value['product_id'], 'but_meta' => "btn", 'but_role' => "text"), 0); ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['product_data']->value['exceptions_type'] == "F") { ?> <?php $_smarty_tpl->tpl_vars["except_title"] = new Smarty_variable($_smarty_tpl->__("forbidden_combinations"), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["except_title"] = new Smarty_variable($_smarty_tpl->__("allowed_combinations"), null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => $_smarty_tpl->tpl_vars['except_title']->value, 'but_meta' => "btn cm-promo-popup", 'but_role' => "text"), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['has_inventory']->value) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("option_combinations"), 'but_href' => "product_options.inventory?product_id=" . (string) $_smarty_tpl->tpl_vars['product_data']->value['product_id'], 'but_meta' => "btn", 'but_role' => "text"), 0); ?> <?php } else { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("notes_picker", null, null); ob_start(); ?> <?php echo $_smarty_tpl->__("text_options_no_inventory"); ?> <?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 echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('act' => "button", 'id' => "content_option_combinations", 'text' => __("note"), 'content' => Smarty::$_smarty_vars['capture']['notes_picker'], 'link_text' => __("option_combinations"), 'but_href' => "product_options.inventory?product_id=" . (string) $_smarty_tpl->tpl_vars['product_data']->value['product_id'], 'but_role' => "text", 'extra_act' => "notes"), 0); ?> <?php } ?> <?php } ?> </div> <?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 echo $_smarty_tpl->getSubTemplate("views/product_options/manage.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('object' => "product", 'extra' => Smarty::$_smarty_vars['capture']['extra'], 'product_id' => $_REQUEST['product_id'], 'view_mode' => "embed"), 0); }
function fn_mailru_put_header($filename) { $_SESSION['mailru_export_count'] = 0; $shop_name = Registry::get('addons.rus_tovary_mailru.shop_name'); if (empty($shop_name)) { if (fn_allowed_for('ULTIMATE')) { $company_id = Registry::ifGet('runtime.company_id', fn_get_default_company_id()); $shop_name = fn_get_company_name($company_id); } else { $shop_name = Registry::get('settings.Company.company_name'); } } $shop_name = strip_tags($shop_name); $yml_header = array('<?xml version="1.0" encoding="' . Registry::get('addons.rus_tovary_mailru.export_encoding') . '"?>', '<torg_price date="' . date('Y-m-d G:i') . '">', '<shop>'); $yml = array('shopname' => $shop_name, 'company' => Registry::get('settings.Company.company_name'), 'url' => Registry::get('config.http_location')); $currencies = Registry::get('currencies'); if (CART_PRIMARY_CURRENCY != "RUB") { $rub_coefficient = !empty($currencies['RUB']) ? $currencies['RUB']['coefficient'] : 1; $primary_coefficient = $currencies[CART_PRIMARY_CURRENCY]['coefficient']; foreach ($currencies as $cur) { if (fn_mailru_check_currencies($cur['currency_code']) && $cur['status'] == 'A') { if ($cur['currency_code'] == "RUB") { $coefficient = '1.0000'; $yml['currencies']['currency@id=' . $cur['currency_code'] . '@rate=' . $coefficient] = ''; } else { $coefficient = $cur['coefficient'] * $primary_coefficient / $rub_coefficient; $yml['currencies']['currency@id=' . $cur['currency_code'] . '@rate=' . $coefficient] = ''; } } } } else { foreach ($currencies as $cur) { if (fn_mailru_check_currencies($cur['currency_code']) && $cur['status'] == 'A') { $yml['currencies']['currency@id=' . $cur['currency_code'] . '@rate=' . $cur['coefficient']] = ''; } } } $params = array('simple' => false, 'plain' => true); if (fn_allowed_for('ULTIMATE') && is_numeric($shop_name)) { $params['company_ids'] = $shop_name; } list($categories_tree, ) = fn_get_categories($params); foreach ($categories_tree as $cat) { if (isset($cat['category_id'])) { $yml['categories']['category@id=' . $cat['category_id'] . '@parentId=' . $cat['parent_id']] = htmlspecialchars($cat['category']); } } $yml_data = implode("\n", $yml_header) . "\n" . fn_mailru_array_to_yml($yml) . "<offers>\n"; fn_mailru_write_yml($filename, 'w+', $yml_data); }
function fn_exim_get_product_options($product_id, $lang_code = '') { $pair_delimiter = ':'; $set_delimiter = '; '; $vars_delimiter = ','; $result = array(); $options = fn_get_product_options($product_id, $lang_code); if (!empty($options)) { foreach ($options as $o) { $glob_opt = db_get_field("SELECT option_id FROM ?:product_global_option_links WHERE option_id = ?i AND product_id = ?i", $o['option_id'], $product_id); $prefix = ''; if (!empty($o['company_id'])) { $company_name = fn_get_company_name($o['company_id']); $prefix = '(' . $company_name . ') '; } $str = $prefix . "{$o['option_name']}{$pair_delimiter} {$o['option_type']}" . (empty($glob_opt) ? '' : 'G'); $variants = array(); if (!empty($o['variants'])) { foreach ($o['variants'] as $v) { $variants[] = $v['variant_name']; } $str .= '[' . implode($vars_delimiter, $variants) . ']'; } $result[] = $str; } } return !empty($result) ? implode($set_delimiter, $result) : ''; }
function fn_get_discussion_object_data($object_id, $object_type, $lang_code = CART_LANGUAGE) { $data = array(); // product if ($object_type == 'P') { $data['description'] = db_get_field("SELECT product FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $object_id, $lang_code); if (AREA == 'A') { $data['url'] = "products.update?product_id={$object_id}&selected_section=discussion"; } else { $data['url'] = "products.view?product_id={$object_id}"; } } elseif ($object_type == 'C') { // category $data['description'] = db_get_field("SELECT category FROM ?:category_descriptions WHERE category_id = ?i AND lang_code = ?s", $object_id, $lang_code); if (AREA == 'A') { $data['url'] = "categories.update?category_id={$object_id}&selected_section=discussion"; } else { $data['url'] = "categories.view?category_id={$object_id}"; } } elseif ($object_type == 'M') { // company $data['description'] = fn_get_company_name($object_id); if (AREA == 'A') { $data['url'] = "companies.update?company_id={$object_id}&selected_section=discussion"; } else { $data['url'] = "companies.view?company_id={$object_id}"; } // order } elseif ($object_type == 'O') { $data['description'] = '#' . $object_id; if (AREA == 'A') { $data['url'] = "orders.details?order_id={$object_id}&selected_section=discussion"; } else { $data['url'] = "orders.details?order_id={$object_id}"; } // page } elseif ($object_type == 'A') { $data['description'] = db_get_field("SELECT page FROM ?:page_descriptions WHERE page_id = ?i AND lang_code = ?s", $object_id, $lang_code); if (AREA == 'A') { $data['url'] = "pages.update?page_id={$object_id}&selected_section=discussion"; } else { $data['url'] = "pages.view?page_id={$object_id}"; } // Site layout/testimonials } elseif ($object_type == 'E') { $data['description'] = __('discussion_title_home_page'); if (AREA == 'A') { $data['url'] = "discussion.update?discussion_type=E"; } else { $data['url'] = ''; } } fn_set_hook('get_discussion_object_data', $data, $object_id, $object_type); return $data; }
/** * Hook for modify shippings groups * * @param array $cart Cart array * @param array $allow * @param array $product_groups Products groups from cart */ function fn_suppliers_pre_place_order(&$cart, &$allow, &$product_groups) { if (Registry::get('addons.suppliers.display_shipping_methods_separately') == 'N') { return; } $new_product_groups = array(); foreach ($product_groups as $key_group => $group) { if (empty($new_product_groups[$group['company_id']])) { $new_product_groups[$group['company_id']] = $group; if (isset($group['supplier_id'])) { $new_product_groups[$group['company_id']]['name'] = fn_get_supplier_name($group['supplier_id']); } else { $new_product_groups[$group['company_id']]['name'] = fn_get_company_name($group['company_id']); } $new_product_groups[$group['company_id']]['products'] = array(); $new_product_groups[$group['company_id']]['chosen_shippings'] = array(); if (!empty($group['supplier_id'])) { unset($new_product_groups[$group['company_id']]['supplier_id']); } } if (!empty($group['supplier_id'])) { foreach ($group['products'] as $cart_id => $product) { $group['products'][$cart_id]['extra']['supplier_id'] = $group['supplier_id']; $cart['products'][$cart_id]['extra']['supplier_id'] = $group['supplier_id']; } } $supplier_groups = array(); foreach ($group['products'] as $cart_id => $product) { // products from different suppliers must have different group keys when placing suborders if (!empty($cart['parent_order_id']) && isset($product['extra']['supplier_id'])) { $supplier_id = $product['extra']['supplier_id']; if (!isset($supplier_groups[$supplier_id])) { $supplier_groups[$supplier_id] = count($supplier_groups); } $group['products'][$cart_id]['extra']['group_key'] = $supplier_groups[$supplier_id]; $cart['products'][$cart_id]['extra']['group_key'] = $supplier_groups[$supplier_id]; } else { $group['products'][$cart_id]['extra']['group_key'] = $key_group; $cart['products'][$cart_id]['extra']['group_key'] = $key_group; } } if (!empty($group['chosen_shippings'])) { if (!empty($cart['parent_order_id'])) { $group['chosen_shippings'][0]['group_key'] = $key_group; } if (empty($group['chosen_shippings'][0]['group_name'])) { $group['chosen_shippings'][0]['group_name'] = $group['name']; } $new_product_groups[$group['company_id']]['shippings'][$group['chosen_shippings'][0]['shipping_id']] = $group['chosen_shippings'][0]; $new_product_groups[$group['company_id']]['chosen_shippings'] = array_merge($new_product_groups[$group['company_id']]['chosen_shippings'], $group['chosen_shippings']); } $new_product_groups[$group['company_id']]['products'] = $new_product_groups[$group['company_id']]['products'] + $group['products']; } $product_groups = array_values($new_product_groups); }