function fn_get_single_map_data($order_info, $auth = null) { $data = array(); $data["order_date"] = date('d-m-Y', $order_info['timestamp']); $data["email"] = $order_info['email']; $data["customer_name"] = $order_info['firstname'] . ' ' . $order_info['lastname']; $data["order_id"] = $order_info['order_id']; $products = $order_info['products']; $products_arr = array(); $currencies = Registry::get('currencies'); $currency = isset($order_info['secondary_currency']) ? $currencies[$order_info['secondary_currency']] : $currencies[CART_SECONDARY_CURRENCY]; #modified by Hungryweb 12.10.2015 //$data["currency_iso"] = $currency['currency_code']; $data["currency_iso"] = 'USD'; foreach ($products as $product) { $product_id = is_array($product) ? $product['product_id'] : intval($product); $product_data = array(); $product_data['url'] = fn_get_product_url($product_id); #modified by Hungryweb 12.10.2015 //$product_data['name'] = fn_get_product_name($product_id,CART_LANGUAGE,false); $product_data['name'] = fn_specific_development_get_category($product['product_id']) . ' ' . fn_get_product_name($product_id, CART_LANGUAGE, false); $product_data['description'] = db_get_field("SELECT full_description FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $product_id, CART_LANGUAGE); if (isset($product_data['description'])) { $product_data['description'] = strip_tags(html_entity_decode($product_data['description'], ENT_NOQUOTES, 'UTF-8')); } $product_data['image'] = fn_get_product_image_url($product_id); $price = is_array($product) ? $product['base_price'] : fn_get_product_price($product_id, 1, $auth); $product_data['price'] = fn_format_rate_value($price, 'F', '2', '.', ',', $currency['coefficient']); $products_arr[$product_id] = $product_data; } $data['products'] = $products_arr; return $data; }
function fn_qwintry_create_shipment($order_info, $qwintry_data = array()) { $shipping = fn_qwintry_find_qwintry_shipping($order_info); if (empty($shipping)) { return false; } $shipping_settings = fn_get_shipping_params($shipping['shipping_id']); $package_info = fn_qwintry_get_package_from_order_info($order_info); $dimensions = fn_qwintry_get_biggest_package($package_info); $invoice = fn_qwintry_save_order_invoice($order_info['order_id']); if (!$dimensions) { $dimensions = $shipping_settings['dimensions']; } $weight_data = fn_expand_weight($package_info['W']); $pounds = $weight_data['pounds']; if (!empty($qwintry_data['box_length']) && !empty($qwintry_data['box_width']) && !empty($qwintry_data['box_height'])) { $dimensions = $qwintry_data; } if (!empty($qwintry_data['box_weight'])) { $pounds = $qwintry_data['box_weight']; } $data = array('Shipment' => array('first_name' => $order_info['s_firstname'], 'last_name' => $order_info['s_lastname'], 'phone' => empty($order_info['s_phone']) ? $order_info['phone'] : $order_info['s_phone'], 'email' => $order_info['email'], 'customer_notes' => $order_info['notes'], 'weight' => $pounds > 0.1 ? $pounds : (empty($shipping_settings['default_weight']) ? 4 : $shipping_settings['default_weight']), 'dimensions' => $dimensions['box_length'] . 'x' . $dimensions['box_width'] . 'x' . $dimensions['box_height'], 'insurance' => false, 'external_id' => $order_info['order_id'], 'hub_code' => empty($shipping_settings['hub']) ? 'DE1' : $shipping_settings['hub']), 'invoices' => array(0 => array('base64_data' => base64_encode(file_get_contents($invoice)), 'base64_extension' => 'pdf'))); $data['Shipment']['addr_line1'] = $order_info['s_address']; $data['Shipment']['addr_line2'] = $order_info['s_address_2']; $data['Shipment']['addr_zip'] = $order_info['s_zipcode']; $data['Shipment']['addr_state'] = fn_get_state_name($order_info['s_state'], $order_info['s_country']); $data['Shipment']['addr_city'] = $order_info['s_city']; $data['Shipment']['addr_country'] = $order_info['s_country']; if (empty($shipping['extra']['type']) || $shipping['extra']['type'] == 'courier') { $data['Shipment']['delivery_type'] = 'courier'; } elseif ($shipping['extra']['type'] == 'pickup' && !empty($shipping['extra']['point'])) { $data['Shipment']['delivery_type'] = 'pickup'; $data['Shipment']['delivery_pickup'] = $shipping['extra']['point']; } if ($shipping_settings['mode'] == 'test') { $data['Shipment']['test'] = true; } $cart = fn_qwintry_fn_form_cart($order_info); foreach ($cart['products'] as $product) { $rus_name = fn_get_product_name($product['product_id'], 'RU'); $data['items'][] = array('descr' => $product['product'], 'descr_ru' => empty($rus_name) ? $product['product'] : $rus_name, 'count' => $product['amount'], 'line_value' => fn_qwintry_get_price($product['price']), 'line_weight' => empty($product['weight']) ? 0.1 : $product['weight'], 'link' => fn_url('products.view&product_id=' . $product['product_id'], 'C')); } $result = fn_qwintry_send_api_request('package-create', $data, $shipping_settings); if (!$result || empty($result->success) || !$result->success || empty($result->result->tracking)) { if (empty($result->errorMessage)) { return false; } return array('[error]' => (string) $result->errorMessage); } $shipment_data = array('order_id' => $order_info['order_id'], 'shipping_id' => $shipping['shipping_id'], 'tracking_number' => $result->result->tracking); fn_qwintry_update_shipment($shipment_data, 0, 0, true); if (fn_qwintry_save_label($order_info['order_id'] . '.pdf', $result->result->tracking, $shipping_settings) !== false) { return true; } return false; }
function fn_required_products_pre_add_to_cart(&$product_data, &$cart, $auth, $update) { foreach ($product_data as $key => $entry) { if (!empty($entry['amount']) && !empty($entry['product_id'])) { $ids = db_get_fields('SELECT req_prod.required_id FROM ?:product_required_products as req_prod LEFT JOIN ?:products ON req_prod.required_id = ?:products.product_id WHERE req_prod.product_id = ?i AND ?:products.status != ?s', $entry['product_id'], 'D'); if (!empty($ids)) { $have = fn_required_products_get_existent($auth, $ids); if (empty($have) || count($have) != count($ids)) { $products_to_cart = array_diff($ids, $have); $out_of_stock = array(); $amounts = array(); foreach ($products_to_cart as $id) { $amounts[$id] = fn_check_amount_in_stock($id, 1, fn_get_default_product_options($id), 0, 'N', 0, $cart); if (!$amounts[$id]) { $out_of_stock[] = $id; } } if (empty($out_of_stock)) { $msg = fn_get_lang_var('required_products_added'); foreach ($amounts as $id => $v) { $product_data[$id] = array('product_id' => $id, 'amount' => $v); $msg .= "<br />" . fn_get_product_name($id); } } else { unset($product_data[$key]); $msg = fn_get_lang_var('required_products_out_of_stock'); foreach ($out_of_stock as $id) { $msg .= "<br />" . fn_get_product_name($id); } } fn_set_notification('N', fn_get_lang_var('notice'), $msg); } } } } return true; }
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; }
function content_55d42e47dff943_86175395($_smarty_tpl) { if (!is_callable('smarty_function_script')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.script.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('no_items', 'name', 'quantity', 'options', 'any_option_combinations', 'deleted_product', 'add_products', 'add_products', 'no_items', 'name', 'quantity', 'options', 'any_option_combinations', 'deleted_product', 'add_products', 'add_products')); 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->tpl_vars["view_mode"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['view_mode']->value) === null || $tmp === '' ? "mixed" : $tmp, null, 0); if (!$_smarty_tpl->tpl_vars['display']->value) { ?> <?php $_smarty_tpl->tpl_vars["display"] = new Smarty_variable("options", null, 0); } ?> <?php echo smarty_function_script(array('src' => "js/tygh/picker.js"), $_smarty_tpl); ?> <?php if ($_smarty_tpl->tpl_vars['view_mode']->value != "button") { if ($_smarty_tpl->tpl_vars['type']->value == "table") { ?> <p id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> _no_item" class="ty-no-items<?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> hidden<?php } ?> "><?php echo ($tmp = @$_smarty_tpl->tpl_vars['no_item_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("no_items") : $tmp; ?> </p> <table id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="ty-table<?php if (!$_smarty_tpl->tpl_vars['item_ids']->value) { ?> hidden<?php } ?> cm-picker-options"> <thead> <tr> <th><?php echo $_smarty_tpl->__("name"); ?> </th> <th><?php echo $_smarty_tpl->__("quantity"); ?> </th> </tr> </thead> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('clone' => true, 'options' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "options" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'product' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'delete_id' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "delete_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'amount' => 1, 'amount_input' => "text", 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value . "]"), 0); ?> <?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_smarty_tpl->tpl_vars["product_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['item_ids']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; $_smarty_tpl->tpl_vars["product_id"]->value = $_smarty_tpl->tpl_vars["product"]->key; ?> <?php $_smarty_tpl->_capture_stack[0][] = array("product_options", null, null); ob_start(); ?> <?php $_smarty_tpl->tpl_vars["prod_opts"] = new Smarty_variable(fn_get_product_options($_smarty_tpl->tpl_vars['product']->value['product_id']), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['prod_opts']->value && !$_smarty_tpl->tpl_vars['product']->value['product_options']) { ?> <strong><?php echo $_smarty_tpl->__("options"); ?> : </strong> <?php echo $_smarty_tpl->__("any_option_combinations"); ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_options_value']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options_value']), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => fn_get_selected_product_options_info($_smarty_tpl->tpl_vars['product']->value['product_options'])), 0); ?> <?php } ?> <?php } ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php $_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable(($tmp = @htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8', true)) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp, null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('options' => Smarty::$_smarty_vars['capture']['product_options'], 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'product' => $_smarty_tpl->tpl_vars['product_name']->value, 'delete_id' => $_smarty_tpl->tpl_vars['product_id']->value, 'product_id' => $_smarty_tpl->tpl_vars['product']->value['product_id'], 'amount' => $_smarty_tpl->tpl_vars['product']->value['amount'], 'amount_input' => "text", 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'] . "]", 'options_array' => $_smarty_tpl->tpl_vars['product']->value['product_options']), 0); ?> <?php } ?> <?php } ?> </table> <?php } } ?> <?php if ($_smarty_tpl->tpl_vars['view_mode']->value != "list") { ?> <?php if ($_smarty_tpl->tpl_vars['extra_var']->value) { ?> <?php $_smarty_tpl->tpl_vars["extra_var"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['extra_var']->value), null, 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['no_container']->value) { ?> <div class="buttons-container picker"><?php } if ($_smarty_tpl->tpl_vars['picker_view']->value) { ?> [<?php } ?> <div class="ty-mt-m"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_picker_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_href' => "products.picker?display=" . (string) $_smarty_tpl->tpl_vars['display']->value . "&picker_for=" . (string) $_smarty_tpl->tpl_vars['picker_for']->value . "&extra=" . (string) $_smarty_tpl->tpl_vars['extra_var']->value . "&checkbox_name=" . (string) $_smarty_tpl->tpl_vars['checkbox_name']->value . "&aoc=" . (string) $_smarty_tpl->tpl_vars['aoc']->value . "&data_id=" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_text' => ($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add_products") : $tmp, 'but_role' => ($tmp = @$_smarty_tpl->tpl_vars['but_role']->value) === null || $tmp === '' ? "add" : $tmp, 'but_target_id' => "content_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_meta' => "ty-btn__secondary cm-dialog-opener", 'but_rel' => "nofollow", 'but_icon' => "product-picker-icon ty-icon-plus"), 0); ?> <?php if ($_smarty_tpl->tpl_vars['picker_view']->value) { ?> ]<?php } if (!$_smarty_tpl->tpl_vars['no_container']->value) { ?> </div><?php } ?> </div> <div class="hidden" id="content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " title="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add_products") : $tmp, ENT_QUOTES, 'UTF-8'); ?> "> </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="pickers/products/picker.tpl" id="<?php echo smarty_function_set_id(array('name' => "pickers/products/picker.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->tpl_vars["view_mode"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['view_mode']->value) === null || $tmp === '' ? "mixed" : $tmp, null, 0); if (!$_smarty_tpl->tpl_vars['display']->value) { ?> <?php $_smarty_tpl->tpl_vars["display"] = new Smarty_variable("options", null, 0); } ?> <?php echo smarty_function_script(array('src' => "js/tygh/picker.js"), $_smarty_tpl); ?> <?php if ($_smarty_tpl->tpl_vars['view_mode']->value != "button") { if ($_smarty_tpl->tpl_vars['type']->value == "table") { ?> <p id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> _no_item" class="ty-no-items<?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> hidden<?php } ?> "><?php echo ($tmp = @$_smarty_tpl->tpl_vars['no_item_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("no_items") : $tmp; ?> </p> <table id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="ty-table<?php if (!$_smarty_tpl->tpl_vars['item_ids']->value) { ?> hidden<?php } ?> cm-picker-options"> <thead> <tr> <th><?php echo $_smarty_tpl->__("name"); ?> </th> <th><?php echo $_smarty_tpl->__("quantity"); ?> </th> </tr> </thead> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('clone' => true, 'options' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "options" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'product' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'delete_id' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "delete_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'amount' => 1, 'amount_input' => "text", 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value . "]"), 0); ?> <?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_smarty_tpl->tpl_vars["product_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['item_ids']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; $_smarty_tpl->tpl_vars["product_id"]->value = $_smarty_tpl->tpl_vars["product"]->key; ?> <?php $_smarty_tpl->_capture_stack[0][] = array("product_options", null, null); ob_start(); ?> <?php $_smarty_tpl->tpl_vars["prod_opts"] = new Smarty_variable(fn_get_product_options($_smarty_tpl->tpl_vars['product']->value['product_id']), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['prod_opts']->value && !$_smarty_tpl->tpl_vars['product']->value['product_options']) { ?> <strong><?php echo $_smarty_tpl->__("options"); ?> : </strong> <?php echo $_smarty_tpl->__("any_option_combinations"); ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_options_value']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options_value']), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => fn_get_selected_product_options_info($_smarty_tpl->tpl_vars['product']->value['product_options'])), 0); ?> <?php } ?> <?php } ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php $_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable(($tmp = @htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8', true)) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp, null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('options' => Smarty::$_smarty_vars['capture']['product_options'], 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'product' => $_smarty_tpl->tpl_vars['product_name']->value, 'delete_id' => $_smarty_tpl->tpl_vars['product_id']->value, 'product_id' => $_smarty_tpl->tpl_vars['product']->value['product_id'], 'amount' => $_smarty_tpl->tpl_vars['product']->value['amount'], 'amount_input' => "text", 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'] . "]", 'options_array' => $_smarty_tpl->tpl_vars['product']->value['product_options']), 0); ?> <?php } ?> <?php } ?> </table> <?php } } ?> <?php if ($_smarty_tpl->tpl_vars['view_mode']->value != "list") { ?> <?php if ($_smarty_tpl->tpl_vars['extra_var']->value) { ?> <?php $_smarty_tpl->tpl_vars["extra_var"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['extra_var']->value), null, 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['no_container']->value) { ?> <div class="buttons-container picker"><?php } if ($_smarty_tpl->tpl_vars['picker_view']->value) { ?> [<?php } ?> <div class="ty-mt-m"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_picker_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_href' => "products.picker?display=" . (string) $_smarty_tpl->tpl_vars['display']->value . "&picker_for=" . (string) $_smarty_tpl->tpl_vars['picker_for']->value . "&extra=" . (string) $_smarty_tpl->tpl_vars['extra_var']->value . "&checkbox_name=" . (string) $_smarty_tpl->tpl_vars['checkbox_name']->value . "&aoc=" . (string) $_smarty_tpl->tpl_vars['aoc']->value . "&data_id=" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_text' => ($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add_products") : $tmp, 'but_role' => ($tmp = @$_smarty_tpl->tpl_vars['but_role']->value) === null || $tmp === '' ? "add" : $tmp, 'but_target_id' => "content_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_meta' => "ty-btn__secondary cm-dialog-opener", 'but_rel' => "nofollow", 'but_icon' => "product-picker-icon ty-icon-plus"), 0); ?> <?php if ($_smarty_tpl->tpl_vars['picker_view']->value) { ?> ]<?php } if (!$_smarty_tpl->tpl_vars['no_container']->value) { ?> </div><?php } ?> </div> <div class="hidden" id="content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " title="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add_products") : $tmp, ENT_QUOTES, 'UTF-8'); ?> "> </div> <?php } } }
$inv_count = db_get_field("SELECT COUNT(*) FROM ?:product_options_inventory WHERE product_id = ?i", $_REQUEST['product_id']); $limit = fn_paginate(empty($_REQUEST['page']) ? 1 : $_REQUEST['page'], $inv_count, Registry::get('settings.Appearance.admin_elements_per_page')); $inventory = db_get_array("SELECT * FROM ?:product_options_inventory WHERE product_id = ?i ORDER BY position {$limit}", $_REQUEST['product_id']); foreach ($inventory as $k => $v) { $inventory[$k]['combination'] = fn_get_product_options_by_combination($v['combination']); $inventory[$k]['image_pairs'] = fn_get_image_pairs($v['combination_hash'], 'product_option', 'M', true, true, DESCR_SL); } $product_options = fn_get_product_options($_REQUEST['product_id'], DESCR_SL, true, true); $view->assign('product_inventory', db_get_field("SELECT tracking FROM ?:products WHERE product_id = ?i", $_REQUEST['product_id'])); $view->assign('product_options', $product_options); $view->assign('inventory', $inventory); // // Product options exceptions // } elseif ($mode == 'exceptions') { fn_add_breadcrumb(fn_get_product_name($_REQUEST['product_id']), "products.update?product_id={$_REQUEST['product_id']}&selected_section=options"); // I think this should be removed, not good, must be done on xml menu level Registry::set('navigation.selected_tab', 'catalog'); Registry::set('navigation.subsection', 'products'); $exceptions = fn_get_product_exceptions($_REQUEST['product_id']); $product_options = fn_get_product_options($_REQUEST['product_id'], DESCR_SL, true); $product_data = fn_get_product_data($_REQUEST['product_id'], $auth, DESCR_SL, '', true, true, true, true); $view->assign('product_options', $product_options); $view->assign('exceptions', $exceptions); $view->assign('product_data', $product_data); // // Options list // } elseif ($mode == 'manage') { $params = $_REQUEST; list($product_options, $search, $product_options_count) = fn_get_product_global_options($params, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
function content_55dc759df31203_27161610($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php'; } if (!is_callable('smarty_function_set_id')) { include '/var/www/html/market/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('items', 'for', 'cart_is_empty', 'cart_is_empty', 'view_cart', 'checkout', 'items', 'for', 'cart_is_empty', 'cart_is_empty', 'view_cart', 'checkout')); 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->tpl_vars["dropdown_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['block']->value['snapping_id'], null, 0); $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:cart_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:cart_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ty-dropdown-box" id="cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div id="sw_dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="ty-dropdown-box__title cm-combination"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:dropdown_title")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_SESSION['cart']['amount']) { ?> <i class="ty-minicart__icon ty-icon-basket filled"></i> <span class="ty-minicart-title ty-hand"><?php echo htmlspecialchars($_SESSION['cart']['amount'], ENT_QUOTES, 'UTF-8'); ?> <?php echo $_smarty_tpl->__("items"); ?> <?php echo $_smarty_tpl->__("for"); ?> <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_SESSION['cart']['display_subtotal']), 0); ?> </span> <i class="ty-icon-down-micro"></i> <?php } else { ?> <i class="ty-minicart__icon ty-icon-basket empty"></i> <span class="ty-minicart-title empty-cart ty-hand"><?php echo $_smarty_tpl->__("cart_is_empty"); ?> </span> <i class="ty-icon-down-micro"></i> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </a> </div> <div id="dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-popup-box ty-dropdown-box__content hidden"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="cm-cart-content <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> cm-cart-content-thumb<?php } ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> cm-cart-content-delete<?php } ?> "> <div class="ty-cart-items"> <?php if ($_SESSION['cart']['amount']) { ?> <ul class="ty-cart-items__list"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:cart_status")); $_block_repeat = true; echo smarty_block_hook(array('name' => "index:cart_status"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_smarty_tpl->tpl_vars["_cart_products"] = new Smarty_variable(array_reverse($_SESSION['cart']['products'], true), null, 0); ?> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['_cart_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["product"]->key; ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart_product")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart_product"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if (!$_smarty_tpl->tpl_vars['product']->value['extra']['parent']) { ?> <li class="ty-cart-items__list-item"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart_product_info")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart_product_info"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> <div class="ty-cart-items__list-item-image"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "40", 'image_height' => "40", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true), 0); ?> </div> <?php } ?> <div class="ty-cart-items__list-item-desc"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']); ?> </a> <p> <span><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> </span><span> x </span><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value . "_" . (string) $_smarty_tpl->tpl_vars['dropdown_id']->value, 'class' => "none"), 0); ?> </p> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> <div class="ty-cart-items__list-item-tools cm-cart-item-delete"> <?php if ((!$_smarty_tpl->tpl_vars['runtime']->value['checkout'] || $_smarty_tpl->tpl_vars['force_items_deletion']->value) && !$_smarty_tpl->tpl_vars['product']->value['extra']['exclude_from_calculate']) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete.from_status?cart_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value, 'but_meta' => "cm-ajax cm-ajax-full-render", 'but_target_id' => "cart_status*", 'but_role' => "delete", 'but_name' => "delete_cart_item"), 0); ?> <?php } ?> </div> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart_product_info"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </li> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart_product"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "index:cart_status"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </ul> <?php } else { ?> <div class="ty-cart-items__empty ty-center"><?php echo $_smarty_tpl->__("cart_is_empty"); ?> </div> <?php } ?> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_bottom_buttons'] == "Y") { ?> <div class="cm-cart-buttons ty-cart-content__buttons buttons-container<?php if ($_SESSION['cart']['amount']) { ?> full-cart<?php } else { ?> hidden<?php } ?> "> <div class="ty-float-left"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("view_cart"); ?> </a> </div> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['checkout_redirect'] != "Y") { ?> <div class="ty-float-right"> <a href="<?php echo htmlspecialchars(fn_url("checkout.checkout"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__primary"><?php echo $_smarty_tpl->__("checkout"); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <!--cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:cart_content"), $_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(); } 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="blocks/cart_content.tpl" id="<?php echo smarty_function_set_id(array('name' => "blocks/cart_content.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->tpl_vars["dropdown_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['block']->value['snapping_id'], null, 0); $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:cart_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:cart_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ty-dropdown-box" id="cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div id="sw_dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="ty-dropdown-box__title cm-combination"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:dropdown_title")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_SESSION['cart']['amount']) { ?> <i class="ty-minicart__icon ty-icon-basket filled"></i> <span class="ty-minicart-title ty-hand"><?php echo htmlspecialchars($_SESSION['cart']['amount'], ENT_QUOTES, 'UTF-8'); ?> <?php echo $_smarty_tpl->__("items"); ?> <?php echo $_smarty_tpl->__("for"); ?> <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_SESSION['cart']['display_subtotal']), 0); ?> </span> <i class="ty-icon-down-micro"></i> <?php } else { ?> <i class="ty-minicart__icon ty-icon-basket empty"></i> <span class="ty-minicart-title empty-cart ty-hand"><?php echo $_smarty_tpl->__("cart_is_empty"); ?> </span> <i class="ty-icon-down-micro"></i> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </a> </div> <div id="dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-popup-box ty-dropdown-box__content hidden"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="cm-cart-content <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> cm-cart-content-thumb<?php } ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> cm-cart-content-delete<?php } ?> "> <div class="ty-cart-items"> <?php if ($_SESSION['cart']['amount']) { ?> <ul class="ty-cart-items__list"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:cart_status")); $_block_repeat = true; echo smarty_block_hook(array('name' => "index:cart_status"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_smarty_tpl->tpl_vars["_cart_products"] = new Smarty_variable(array_reverse($_SESSION['cart']['products'], true), null, 0); ?> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['_cart_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["product"]->key; ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart_product")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart_product"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if (!$_smarty_tpl->tpl_vars['product']->value['extra']['parent']) { ?> <li class="ty-cart-items__list-item"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart_product_info")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart_product_info"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> <div class="ty-cart-items__list-item-image"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "40", 'image_height' => "40", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true), 0); ?> </div> <?php } ?> <div class="ty-cart-items__list-item-desc"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']); ?> </a> <p> <span><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> </span><span> x </span><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value . "_" . (string) $_smarty_tpl->tpl_vars['dropdown_id']->value, 'class' => "none"), 0); ?> </p> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> <div class="ty-cart-items__list-item-tools cm-cart-item-delete"> <?php if ((!$_smarty_tpl->tpl_vars['runtime']->value['checkout'] || $_smarty_tpl->tpl_vars['force_items_deletion']->value) && !$_smarty_tpl->tpl_vars['product']->value['extra']['exclude_from_calculate']) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete.from_status?cart_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value, 'but_meta' => "cm-ajax cm-ajax-full-render", 'but_target_id' => "cart_status*", 'but_role' => "delete", 'but_name' => "delete_cart_item"), 0); ?> <?php } ?> </div> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart_product_info"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </li> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart_product"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "index:cart_status"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </ul> <?php } else { ?> <div class="ty-cart-items__empty ty-center"><?php echo $_smarty_tpl->__("cart_is_empty"); ?> </div> <?php } ?> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_bottom_buttons'] == "Y") { ?> <div class="cm-cart-buttons ty-cart-content__buttons buttons-container<?php if ($_SESSION['cart']['amount']) { ?> full-cart<?php } else { ?> hidden<?php } ?> "> <div class="ty-float-left"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("view_cart"); ?> </a> </div> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['checkout_redirect'] != "Y") { ?> <div class="ty-float-right"> <a href="<?php echo htmlspecialchars(fn_url("checkout.checkout"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__primary"><?php echo $_smarty_tpl->__("checkout"); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <!--cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:cart_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } }
function fn_fill_certificate_products(&$certificate_products, $stored_products = array(), $lang_code = CART_LANGUAGE) { if (!empty($certificate_products)) { foreach ($certificate_products as $cp_id => $cp) { if (!empty($stored_products)) { $ok = false; foreach ($stored_products as $sp_id => $sp) { if ($cp['product_id'] == $sp['product_id']) { if (!empty($cp['product_options']) && !empty($sp['extra']['product_options']) && array_diff($cp['product_options'], $sp['extra']['product_options']) == array() || empty($cp['product_options']) && empty($sp['extra']['product_options'])) { if (!empty($sp['extra']['product_options_value'])) { $certificate_products[$cp_id]['product_options_value'] = $sp['extra']['product_options_value']; } if (!empty($sp['extra']['product'])) { $certificate_products[$cp_id]['product'] = $sp['extra']['product']; } break; } } } } if (empty($certificate_products[$cp_id]['product_options_value']) && !empty($cp['product_options'])) { $certificate_products[$cp_id]['product_options_value'] = fn_get_selected_product_options_info($cp['product_options']); } if (empty($certificate_products[$cp_id]['product'])) { $certificate_products[$cp_id]['product'] = fn_get_product_name($cp['product_id'], $lang_code); } } } }
function fn_global_update($update_data) { $table = $field = $value = $type = array(); $msg = ''; $currencies = Registry::get('currencies'); if (!empty($update_data['product_ids'])) { $update_data['product_ids'] = explode(',', $update_data['product_ids']); } // Update prices if (!empty($update_data['price'])) { $table[] = '?:product_prices'; $field[] = 'price'; $value[] = $update_data['price']; $type[] = $update_data['price_type']; $msg .= ($update_data['price'] > 0 ? fn_get_lang_var('price_increased') : fn_get_lang_var('price_decreased')) . ' ' . abs($update_data['price']) . ($update_data['price_type'] == 'A' ? $currencies[CART_PRIMARY_CURRENCY]['symbol'] : '%') . '.<br />'; } // Update list prices if (!empty($update_data['list_price'])) { $table[] = '?:products'; $field[] = 'list_price'; $value[] = $update_data['list_price']; $type[] = $update_data['list_price_type']; $msg .= ($update_data['list_price'] > 0 ? fn_get_lang_var('list_price_increased') : fn_get_lang_var('list_price_decreased')) . ' ' . abs($update_data['list_price']) . ($update_data['list_price_type'] == 'A' ? $currencies[CART_PRIMARY_CURRENCY]['symbol'] : '%') . '.<br />'; } // Update amount if (!empty($update_data['amount'])) { $table[] = '?:products'; $field[] = 'amount'; $value[] = $update_data['amount']; $type[] = 'A'; $table[] = '?:product_options_inventory'; $field[] = 'amount'; $value[] = $update_data['amount']; $type[] = 'A'; $msg .= ($update_data['amount'] > 0 ? fn_get_lang_var('amount_increased') : fn_get_lang_var('amount_decreased')) . ' ' . abs($update_data['amount']) . '.<br />'; } fn_set_hook('global_update', $table, $field, $value, $type, $msg, $update_data); $where = !empty($update_data['product_ids']) ? db_quote(" WHERE product_id IN (?n)", $update_data['product_ids']) : ''; foreach ($table as $k => $v) { $_value = db_quote("?d", $value[$k]); $sql_expression = $type[$k] == 'A' ? $field[$k] . ' + ' . $_value : $field[$k] . ' * (1 + ' . $_value . '/ 100)'; db_query("UPDATE {$v} SET " . $field[$k] . " = IF({$sql_expression} < 0, 0, {$sql_expression}) {$where}"); } if (empty($update_data['product_ids'])) { fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('all_products_have_been_updated') . '<br />' . $msg); } else { $products = fn_get_product_name($update_data['product_ids']); $msg = fn_get_lang_var('text_products_updated') . '<br />' . implode('<br />', $products) . '<br /><br />' . $msg; fn_set_notification('N', fn_get_lang_var('notice'), $msg); } return true; }
/** * Checks product list and adds required products * * @param array $product_data Products data * @param mixed $auth Array with authorization data * @param array $cart * @param array $added_products Products that are checked for further products that need to be added * @return bool False if some products were removed, otherwise - true */ function fn_check_added_required_products(&$product_data, $auth, &$cart, $added_products = array()) { $result = true; foreach ($product_data as $key => $entry) { if (!empty($entry['amount']) && !empty($key)) { $product_id = !empty($entry['product_id']) ? $entry['product_id'] : $key; $added_products[$product_id] = $entry; $ids = fn_get_required_products_ids($product_id); if (!empty($ids)) { $have = fn_required_products_get_existent($auth, $ids, $cart); if (empty($have) || count($have) != count($ids)) { $products_to_cart = array_diff($ids, $have); $out_of_stock = array(); $check_products = array(); foreach ($products_to_cart as $id) { if (!empty($added_products[$id])) { continue; } $amount = fn_check_amount_in_stock($id, 1, fn_get_default_product_options($id), 0, 'N', 0, $cart); if (!$amount) { $out_of_stock[] = $id; } else { $check_products[$id] = array('product_id' => $id, 'amount' => $amount); } } if (empty($out_of_stock) && fn_check_added_required_products($check_products, $auth, $cart, $added_products)) { $cart['change_cart_products'] = true; $msg = __('required_products_added'); foreach ($check_products as $id => $v) { if (empty($added_products[$id])) { $added_products[$id] = $v; $product_data[$id] = $v; $msg .= "<br />" . fn_get_product_name($id); $cart['amount'] = !isset($cart['amount']) ? $v['amount'] : $cart['amount'] + $v['amount']; } } } else { unset($product_data[$key]); unset($added_products[$product_id]); $result = false; $msg = __('required_products_out_of_stock'); foreach ($out_of_stock as $id) { $msg .= "<br />" . fn_get_product_name($id); } } fn_set_notification('N', __('notice'), $msg); } } } } return $result; }
} Registry::get('view')->assign('page_title', $title); fn_add_breadcrumb($title); if (!empty($products) || !empty($pages)) { Registry::get('view')->assign('tag_objects_exist', true); } // summary mode: tag - product list, tag - product list } elseif ($mode == 'summary') { fn_add_breadcrumb(__('tags')); if (!empty($auth['user_id'])) { list($user_tags) = fn_get_tags(array('user_id' => $auth['user_id'])); foreach ($user_tags as &$tag) { $tag['total'] = 0; if (Registry::get('addons.tags.tags_for_products') == 'Y') { $product_ids = db_get_fields("SELECT object_id FROM ?:tag_links WHERE object_type = ?s AND user_id = ?i AND tag_id = ?i", 'P', $auth['user_id'], $tag['tag_id']); $tag['products'] = fn_get_product_name($product_ids); $tag['total'] += count($product_ids); } if (Registry::get('addons.tags.tags_for_products') == 'Y') { $page_ids = db_get_fields("SELECT object_id FROM ?:tag_links WHERE object_type = ?s AND user_id = ?i AND tag_id = ?i", 'A', $auth['user_id'], $tag['tag_id']); $tag['pages'] = fn_get_page_name($page_ids); $tag['total'] += count($page_ids); } } Registry::get('view')->assign('tags_summary', $user_tags); } // ajax autocomplete mode } elseif ($mode == 'list') { if (defined('AJAX_REQUEST')) { $tags = fn_get_tag_names(array('tag' => $_REQUEST['q'])); Registry::get('ajax')->assign('autocomplete', $tags);
$all_groups_list = fn_get_groups_list(); $view->assign('all_groups_list', $all_groups_list); $banners['groups'] = fn_get_aff_banners($_REQUEST['banner_type'], 'G', true); if (!empty($banners['groups'])) { foreach ($banners['groups'] as $k => $banner) { if (empty($banner['group_name'])) { unset($banners['groups'][$k]); continue; } $banners['groups'][$k]['groups'] = fn_get_group_data($banner['group_id']); if ($banners['groups'][$k]['groups']['status'] == 'D') { unset($banners['groups'][$k]); continue; } if (!empty($banners['groups'][$k]['groups']['product_ids'])) { $banners['groups'][$k]['groups']['products'] = fn_get_product_name($banners['groups'][$k]['groups']['product_ids']); } } } // [/Groups banners] } if ($selected_section == 'categories') { // [Categoties banners] $all_categories_list = fn_get_plain_categories_tree(0, false); $view->assign('all_categories_list', $all_categories_list); $banners['categories'] = fn_get_aff_banners($_REQUEST['banner_type'], 'C', true); // [/Categoties banners] } if ($selected_section == 'products') { // [Products banners] $banners['products'] = fn_get_aff_banners($_REQUEST['banner_type'], 'P', true);
function content_55d2f42f109d54_48353855($_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_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('select_shipping_method', 'free_shipping', 'total', 'free_shipping', 'no_shipping_required', 'text_no_shipping_methods', 'text_no_shipping_methods', 'no_shipping_required', 'free_shipping', 'select', 'select_shipping_method', 'free_shipping', 'total', 'free_shipping', 'no_shipping_required', 'text_no_shipping_methods', 'text_no_shipping_methods', 'no_shipping_required', 'free_shipping', 'select')); 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(); ?> <script type="text/javascript"> function fn_calculate_total_shipping_cost() { params = []; parents = Tygh.$('#shipping_rates_list'); radio = Tygh.$('input[type=radio]:checked', parents); Tygh.$.each(radio, function(id, elm) { params.push({name: elm.name, value: elm.value}); }); url = fn_url('checkout.checkout'); for (i in params) { url += '&' + params[i]['name'] + '=' + escape(params[i]['value']); } Tygh.$.ceAjax('request', url, { result_ids: 'shipping_rates_list,checkout_info_summary_*,checkout_info_order_info_*', method: 'get', full_render: true }); } </script> <?php if ($_smarty_tpl->tpl_vars['show_header']->value == true) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("select_shipping_method")), 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['no_form']->value) { ?> <form <?php if ($_smarty_tpl->tpl_vars['use_ajax']->value) { ?> class="cm-ajax"<?php } ?> action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" name="shippings_form"> <input type="hidden" name="redirect_mode" value="checkout" /> <?php if ($_smarty_tpl->tpl_vars['use_ajax']->value) { ?> <input type="hidden" name="result_ids" value="checkout_totals,checkout_steps" /> <?php } } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_rates")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_rates"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> <div class="step-complete-wrapper"> <?php } ?> <div id="shipping_rates_list"> <?php $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group']->_loop = false; $_smarty_tpl->tpl_vars["group_key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['product_groups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['group']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['group']->iteration = 0; 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_key"]->value = $_smarty_tpl->tpl_vars['group']->key; $_smarty_tpl->tpl_vars['group']->iteration++; $_smarty_tpl->tpl_vars['group']->last = $_smarty_tpl->tpl_vars['group']->iteration === $_smarty_tpl->tpl_vars['group']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["spg"]['last'] = $_smarty_tpl->tpl_vars['group']->last; ?> <?php if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) { ?> <span class="ty-shipping-options__vendor-name"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </span> <?php } ?> <?php if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) { ?> <ul class="ty-shipping-options__products"> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['products']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; ?> <?php if (!($_smarty_tpl->tpl_vars['product']->value['is_edp'] == 'Y' && $_smarty_tpl->tpl_vars['product']->value['edp_shipping'] != 'Y' || $_smarty_tpl->tpl_vars['product']->value['free_shipping'] == 'Y')) { ?> <li class="ty-shipping-options__products-item"> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php echo $_smarty_tpl->tpl_vars['product']->value['product']; ?> <?php } else { ?> <?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> <?php } ?> </li> <?php } ?> <?php } ?> </ul> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "select") { ?> <p> <select id="ssr_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> " name="shipping_ids[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> ]" <?php if ($_smarty_tpl->tpl_vars['onchange']->value) { ?> onchange="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['onchange']->value, ENT_QUOTES, 'UTF-8'); ?> "<?php } ?> > <?php } ?> <?php $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["shipping"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['shippings']; 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; ?> <?php if ($_smarty_tpl->tpl_vars['cart']->value['chosen_shipping'][$_smarty_tpl->tpl_vars['group_key']->value] == $_smarty_tpl->tpl_vars['shipping']->value['shipping_id']) { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable("checked=\"checked\"", null, 0); ?> <?php $_smarty_tpl->tpl_vars["selected"] = new Smarty_variable("selected=\"selected\"", null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_begin"] = new Smarty_variable("<strong>", null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_end"] = new Smarty_variable("</strong>", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars["selected"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_begin"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_end"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['delivery_time']) { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable("(" . (string) $_smarty_tpl->tpl_vars['shipping']->value['delivery_time'] . ")", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "rate", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['rate']), 0); 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['shipping']->value['inc_tax']) { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (", null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] && $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] != $_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "tax", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'], 'class' => "ty-nowrap"), 0); 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->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (" . (string) $_smarty_tpl->tpl_vars['tax']->value . " ", null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["inc_tax_lang"] = new Smarty_variable($_smarty_tpl->__('inc_tax'), null, 0); ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . (string) $_smarty_tpl->tpl_vars['inc_tax_lang']->value . ")", null, 0); ?> <?php } ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable($_smarty_tpl->__("free_shipping"), null, 0); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_method")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_method"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "radio") { ?> <p class="ty-shipping-options__method"> <input type="radio" class="ty-valign" id="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " name="shipping_ids[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " onclick="fn_calculate_total_shipping_cost();" <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['checked']->value, ENT_QUOTES, 'UTF-8'); ?> /> <label for="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="ty-valign"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; ?> </label> </p> <?php } elseif ($_smarty_tpl->tpl_vars['display']->value == "select") { ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['selected']->value, ENT_QUOTES, 'UTF-8'); ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; ?> </option> <?php } elseif ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> <p> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['strong_begin']->value, ENT_QUOTES, 'UTF-8'); echo htmlspecialchars($_smarty_tpl->tpl_vars['rate']->value['name'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; echo htmlspecialchars($_smarty_tpl->tpl_vars['strong_begin']->value, ENT_QUOTES, 'UTF-8'); ?> </p> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_method"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "select") { ?> </select> <p> <?php } ?> <?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['spg']['last'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !($_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['free_shipping'])) { ?> <p class="ty-shipping-options__total"><?php echo $_smarty_tpl->__("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['cart']->value['display_shipping_cost'], 'class' => "ty-price"), 0); ?> </p> <?php } ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping']) { ?> <p><?php echo $_smarty_tpl->__("free_shipping"); ?> </p> <?php } elseif ($_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <p><?php echo $_smarty_tpl->__("no_shipping_required"); ?> </p> <?php } else { ?> <p class="ty-error-text"> <?php if ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> <strong><?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> </strong> <?php } else { ?> <?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> <?php } ?> </p> <?php } ?> <?php } ?> <?php } if (!$_smarty_tpl->tpl_vars['group']->_loop) { ?> <p> <?php if (!$_smarty_tpl->tpl_vars['cart']->value['shipping_required']) { ?> <?php echo $_smarty_tpl->__("no_shipping_required"); ?> <?php } elseif ($_smarty_tpl->tpl_vars['cart']->value['free_shipping']) { ?> <?php echo $_smarty_tpl->__("free_shipping"); ?> <?php } ?> </p> <?php } ?> <!--shipping_rates_list--></div> <?php if ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> </div> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_rates"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php if (!$_smarty_tpl->tpl_vars['no_form']->value) { ?> <div class="cm-noscript buttons-container ty-center"><?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[checkout.update_shipping]", 'but_text' => __("select")), 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(); } 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/checkout/components/shipping_rates.tpl" id="<?php echo smarty_function_set_id(array('name' => "views/checkout/components/shipping_rates.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 { ?> <script type="text/javascript"> function fn_calculate_total_shipping_cost() { params = []; parents = Tygh.$('#shipping_rates_list'); radio = Tygh.$('input[type=radio]:checked', parents); Tygh.$.each(radio, function(id, elm) { params.push({name: elm.name, value: elm.value}); }); url = fn_url('checkout.checkout'); for (i in params) { url += '&' + params[i]['name'] + '=' + escape(params[i]['value']); } Tygh.$.ceAjax('request', url, { result_ids: 'shipping_rates_list,checkout_info_summary_*,checkout_info_order_info_*', method: 'get', full_render: true }); } </script> <?php if ($_smarty_tpl->tpl_vars['show_header']->value == true) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("select_shipping_method")), 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['no_form']->value) { ?> <form <?php if ($_smarty_tpl->tpl_vars['use_ajax']->value) { ?> class="cm-ajax"<?php } ?> action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post" name="shippings_form"> <input type="hidden" name="redirect_mode" value="checkout" /> <?php if ($_smarty_tpl->tpl_vars['use_ajax']->value) { ?> <input type="hidden" name="result_ids" value="checkout_totals,checkout_steps" /> <?php } } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_rates")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_rates"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> <div class="step-complete-wrapper"> <?php } ?> <div id="shipping_rates_list"> <?php $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group']->_loop = false; $_smarty_tpl->tpl_vars["group_key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['product_groups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['group']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['group']->iteration = 0; 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_key"]->value = $_smarty_tpl->tpl_vars['group']->key; $_smarty_tpl->tpl_vars['group']->iteration++; $_smarty_tpl->tpl_vars['group']->last = $_smarty_tpl->tpl_vars['group']->iteration === $_smarty_tpl->tpl_vars['group']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["spg"]['last'] = $_smarty_tpl->tpl_vars['group']->last; ?> <?php if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) { ?> <span class="ty-shipping-options__vendor-name"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </span> <?php } ?> <?php if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) { ?> <ul class="ty-shipping-options__products"> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['products']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; ?> <?php if (!($_smarty_tpl->tpl_vars['product']->value['is_edp'] == 'Y' && $_smarty_tpl->tpl_vars['product']->value['edp_shipping'] != 'Y' || $_smarty_tpl->tpl_vars['product']->value['free_shipping'] == 'Y')) { ?> <li class="ty-shipping-options__products-item"> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php echo $_smarty_tpl->tpl_vars['product']->value['product']; ?> <?php } else { ?> <?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> <?php } ?> </li> <?php } ?> <?php } ?> </ul> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "select") { ?> <p> <select id="ssr_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> " name="shipping_ids[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['company_id']->value, ENT_QUOTES, 'UTF-8'); ?> ]" <?php if ($_smarty_tpl->tpl_vars['onchange']->value) { ?> onchange="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['onchange']->value, ENT_QUOTES, 'UTF-8'); ?> "<?php } ?> > <?php } ?> <?php $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["shipping"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['shippings']; 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; ?> <?php if ($_smarty_tpl->tpl_vars['cart']->value['chosen_shipping'][$_smarty_tpl->tpl_vars['group_key']->value] == $_smarty_tpl->tpl_vars['shipping']->value['shipping_id']) { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable("checked=\"checked\"", null, 0); ?> <?php $_smarty_tpl->tpl_vars["selected"] = new Smarty_variable("selected=\"selected\"", null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_begin"] = new Smarty_variable("<strong>", null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_end"] = new Smarty_variable("</strong>", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars["selected"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_begin"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars["strong_end"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['delivery_time']) { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable("(" . (string) $_smarty_tpl->tpl_vars['shipping']->value['delivery_time'] . ")", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "rate", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['rate']), 0); 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['shipping']->value['inc_tax']) { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (", null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] && $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] != $_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "tax", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'], 'class' => "ty-nowrap"), 0); 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->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (" . (string) $_smarty_tpl->tpl_vars['tax']->value . " ", null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["inc_tax_lang"] = new Smarty_variable($_smarty_tpl->__('inc_tax'), null, 0); ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . (string) $_smarty_tpl->tpl_vars['inc_tax_lang']->value . ")", null, 0); ?> <?php } ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable($_smarty_tpl->__("free_shipping"), null, 0); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_method")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_method"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "radio") { ?> <p class="ty-shipping-options__method"> <input type="radio" class="ty-valign" id="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " name="shipping_ids[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " onclick="fn_calculate_total_shipping_cost();" <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['checked']->value, ENT_QUOTES, 'UTF-8'); ?> /> <label for="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="ty-valign"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; ?> </label> </p> <?php } elseif ($_smarty_tpl->tpl_vars['display']->value == "select") { ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['selected']->value, ENT_QUOTES, 'UTF-8'); ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; ?> </option> <?php } elseif ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> <p> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['strong_begin']->value, ENT_QUOTES, 'UTF-8'); echo htmlspecialchars($_smarty_tpl->tpl_vars['rate']->value['name'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; echo htmlspecialchars($_smarty_tpl->tpl_vars['strong_begin']->value, ENT_QUOTES, 'UTF-8'); ?> </p> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_method"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['display']->value == "select") { ?> </select> <p> <?php } ?> <?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['spg']['last'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !($_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['free_shipping'])) { ?> <p class="ty-shipping-options__total"><?php echo $_smarty_tpl->__("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['cart']->value['display_shipping_cost'], 'class' => "ty-price"), 0); ?> </p> <?php } ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping']) { ?> <p><?php echo $_smarty_tpl->__("free_shipping"); ?> </p> <?php } elseif ($_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <p><?php echo $_smarty_tpl->__("no_shipping_required"); ?> </p> <?php } else { ?> <p class="ty-error-text"> <?php if ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> <strong><?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> </strong> <?php } else { ?> <?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> <?php } ?> </p> <?php } ?> <?php } ?> <?php } if (!$_smarty_tpl->tpl_vars['group']->_loop) { ?> <p> <?php if (!$_smarty_tpl->tpl_vars['cart']->value['shipping_required']) { ?> <?php echo $_smarty_tpl->__("no_shipping_required"); ?> <?php } elseif ($_smarty_tpl->tpl_vars['cart']->value['free_shipping']) { ?> <?php echo $_smarty_tpl->__("free_shipping"); ?> <?php } ?> </p> <?php } ?> <!--shipping_rates_list--></div> <?php if ($_smarty_tpl->tpl_vars['display']->value == "show") { ?> </div> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_rates"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php if (!$_smarty_tpl->tpl_vars['no_form']->value) { ?> <div class="cm-noscript buttons-container ty-center"><?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[checkout.update_shipping]", 'but_text' => __("select")), 0); ?> </div> </form> <?php } } }
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if (!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } $view->display('/views/products/autocomplete.tpl'); } elseif ($mode == 'ajax_search') { //ini_set('display_errors', 2); //var_dump($_GET['q']); $key = mysql_real_escape_string($_GET['q']); $result = array(); $product_id_row = db_get_fields("SELECT product_id, MATCH(product) AGAINST ('{$key}' IN BOOLEAN MODE) AS relevance FROM `cscart_product_descriptions` WHERE MATCH(product) AGAINST ('{$key}' IN BOOLEAN MODE) AND `lang_code` = 'RU' ORDER BY relevance DESC LIMIT 8"); foreach ($product_id_row as $product) { $product_name = fn_get_product_name($product); $product_amount = db_get_fields("SELECT amount, list_price FROM cscart_products WHERE `product_id` = {$product}"); if ($product_amount[0] > 0) { $am = 'availability_ok'; } else { $am = 'availability_no'; } $product_price = db_get_fields("SELECT price FROM cscart_product_prices WHERE `product_id` = {$product}"); $product_img = fn_get_image_pairs($product, 'product', 'M', true, true, CART_LANGUAGE); $result[] = $product_name . '@' . $am . '@' . $product_price[0] . '@' . $product_img['icon']['image_path'] . '@' . $product; } foreach ($result as $a) { echo $a . "\n"; } die; } elseif ($mode == 'parseup') {
function content_55dc81a5ed2a88_04135619($_smarty_tpl) { if (!is_callable('smarty_function_math')) { include '/var/www/html/market/app/lib/vendor/smarty/smarty/libs/plugins/function.math.php'; } if (!is_callable('smarty_function_script')) { include '/var/www/html/market/app/functions/smarty_plugins/function.script.php'; } if (!is_callable('smarty_block_hook')) { include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php'; } fn_preload_lang_vars(array('add_product', 'position_short', 'name', 'deleted_product', 'no_items', 'editing_defined_products', 'defined_items', 'name', 'quantity', 'options', 'any_option_combinations', 'deleted_product', 'no_items', 'add_products', 'add_products')); echo smarty_function_math(array('equation' => "rand()", 'assign' => "rnd"), $_smarty_tpl); ?> <?php $_smarty_tpl->tpl_vars["data_id"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['data_id']->value . "_" . (string) $_smarty_tpl->tpl_vars['rnd']->value, null, 0); $_smarty_tpl->tpl_vars["view_mode"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['view_mode']->value) === null || $tmp === '' ? "mixed" : $tmp, null, 0); $_smarty_tpl->tpl_vars["start_pos"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['start_pos']->value) === null || $tmp === '' ? 0 : $tmp, null, 0); echo smarty_function_script(array('src' => "js/tygh/picker.js"), $_smarty_tpl); ?> <?php if ($_smarty_tpl->tpl_vars['item_ids']->value && !is_array($_smarty_tpl->tpl_vars['item_ids']->value) && $_smarty_tpl->tpl_vars['type']->value != "table") { ?> <?php $_smarty_tpl->tpl_vars["item_ids"] = new Smarty_variable(explode(",", $_smarty_tpl->tpl_vars['item_ids']->value), null, 0); } ?> <?php if ($_smarty_tpl->tpl_vars['view_mode']->value != "list") { ?> <?php if ($_smarty_tpl->tpl_vars['placement']->value == 'right') { ?> <div class="clearfix"> <div class="pull-right"> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['type']->value != "single") { ?> <a data-ca-external-click-id="opener_picker_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-external-click btn <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['meta']->value, ENT_QUOTES, 'UTF-8'); ?> "><i class="icon-plus"></i> <?php echo $_smarty_tpl->__("add_product"); ?> </a> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['placement']->value == 'right') { ?> </div> </div> <?php } } ?> <?php if ($_smarty_tpl->tpl_vars['view_mode']->value != "button") { if ($_smarty_tpl->tpl_vars['type']->value == "links") { ?> <input type="hidden" id="p<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> _ids" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['input_name']->value, ENT_QUOTES, 'UTF-8'); ?> " value="<?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { echo htmlspecialchars(implode(",", $_smarty_tpl->tpl_vars['item_ids']->value), ENT_QUOTES, 'UTF-8'); } ?> " /> <?php $_smarty_tpl->_capture_stack[0][] = array("products_list", null, null); ob_start(); ?> <table class="table table-middle"> <thead> <tr> <?php if ($_smarty_tpl->tpl_vars['positions']->value) { ?> <th><?php echo $_smarty_tpl->__("position_short"); ?> </th><?php } ?> <th width="100%"><?php echo $_smarty_tpl->__("name"); ?> </th> <th> </th> <th> </th> </tr> </thead> <tbody id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="<?php if (!$_smarty_tpl->tpl_vars['item_ids']->value) { ?> hidden<?php } ?> cm-picker-product"> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('clone' => true, 'product' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'delete_id' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "delete_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'type' => "product", 'position_field' => $_smarty_tpl->tpl_vars['positions']->value, 'position' => "0"), 0); ?> <?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['item_ids']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars["product"]->index = -1; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["items"]['iteration'] = 0; foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; $_smarty_tpl->tpl_vars["product"]->index++; $_smarty_tpl->tpl_vars["product"]->first = $_smarty_tpl->tpl_vars["product"]->index === 0; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["items"]['first'] = $_smarty_tpl->tpl_vars["product"]->first; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["items"]['iteration']++; ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_id' => $_smarty_tpl->tpl_vars['product']->value, 'product' => ($tmp = @fn_get_product_name($_smarty_tpl->tpl_vars['product']->value)) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'delete_id' => $_smarty_tpl->tpl_vars['product']->value, 'type' => "product", 'first_item' => $_smarty_tpl->getVariable('smarty')->value['foreach']['items']['first'], 'position_field' => $_smarty_tpl->tpl_vars['positions']->value, 'position' => $_smarty_tpl->getVariable('smarty')->value['foreach']['items']['iteration'] + $_smarty_tpl->tpl_vars['start_pos']->value), 0); ?> <?php } ?> <?php } ?> </tbody> <tbody id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> _no_item"<?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> class="hidden"<?php } ?> > <tr class="no-items"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['positions']->value) { ?> 4<?php } else { ?> 3<?php } ?> "><p><?php echo ($tmp = @$_smarty_tpl->tpl_vars['no_item_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("no_items") : $tmp; ?> </p></td> </tr> </tbody> </table> <?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['picker_view']->value) { ?> <div class="shift-button"> <?php echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "inner_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'link_text' => count($_smarty_tpl->tpl_vars['item_ids']->value), 'act' => "link", 'content' => Smarty::$_smarty_vars['capture']['products_list'], 'text' => __("editing_defined_products"), 'picker_meta' => "cm-bg-close", 'method' => "GET", 'no_icon_link' => true), 0); echo $_smarty_tpl->__("defined_items"); ?> </div> <?php } else { ?> <?php echo Smarty::$_smarty_vars['capture']['products_list']; ?> <?php } } elseif ($_smarty_tpl->tpl_vars['type']->value == "table") { ?> <?php if (!isset($_smarty_tpl->tpl_vars['display']->value)) { ?> <?php $_smarty_tpl->tpl_vars["display"] = new Smarty_variable("options", null, 0); ?> <?php } ?> <table class="table table-middle"> <thead> <tr> <th width="80%"><?php echo $_smarty_tpl->__("name"); ?> </th> <th class="center"><?php echo $_smarty_tpl->__("quantity"); ?> </th> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "product_picker:table_header")); $_block_repeat = true; echo smarty_block_hook(array('name' => "product_picker:table_header"), 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' => "product_picker:table_header"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <th> </th> </tr> </thead> <tbody id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="<?php if (!$_smarty_tpl->tpl_vars['item_ids']->value) { ?> hidden <?php } ?> cm-picker<?php if ($_smarty_tpl->tpl_vars['display']->value) { ?> -options<?php } ?> "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "product_picker:table_rows")); $_block_repeat = true; echo smarty_block_hook(array('name' => "product_picker:table_rows"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_smarty_tpl->tpl_vars["product_id"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['item_ids']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; $_smarty_tpl->tpl_vars["product_id"]->value = $_smarty_tpl->tpl_vars["product"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['display']->value) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("product_options", null, null); ob_start(); ?> <?php $_smarty_tpl->tpl_vars["prod_opts"] = new Smarty_variable(fn_get_product_options($_smarty_tpl->tpl_vars['product']->value['product_id']), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['prod_opts']->value && !$_smarty_tpl->tpl_vars['product']->value['product_options']) { ?> <span><?php echo $_smarty_tpl->__("options"); ?> : </span> <?php echo $_smarty_tpl->__("any_option_combinations"); ?> <?php } elseif ($_smarty_tpl->tpl_vars['product']->value['product_options']) { ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_options_value']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options_value']), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => fn_get_selected_product_options_info($_smarty_tpl->tpl_vars['product']->value['product_options'])), 0); ?> <?php } ?> <?php } ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php $_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["product_name"] = new Smarty_variable(($tmp = @fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id'])) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp, null, 0); ?> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product' => $_smarty_tpl->tpl_vars['product_name']->value, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'delete_id' => $_smarty_tpl->tpl_vars['product_id']->value, 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['product_id']->value . "]", 'amount' => $_smarty_tpl->tpl_vars['product']->value['amount'], 'amount_input' => "text", 'type' => "options", 'options' => Smarty::$_smarty_vars['capture']['product_options'], 'options_array' => $_smarty_tpl->tpl_vars['product']->value['product_options'], 'product_id' => $_smarty_tpl->tpl_vars['product']->value['product_id'], 'product_info' => $_smarty_tpl->tpl_vars['product']->value), 0); ?> <?php } ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "product_picker:table_rows"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('clone' => true, 'product' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'root_id' => $_smarty_tpl->tpl_vars['data_id']->value, 'delete_id' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "delete_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'input_name' => (string) $_smarty_tpl->tpl_vars['input_name']->value . "[" . (string) $_smarty_tpl->tpl_vars['ldelim']->value . "product_id" . (string) $_smarty_tpl->tpl_vars['rdelim']->value . "]", 'amount' => "1", 'amount_input' => "text", 'type' => "options", 'options' => (string) $_smarty_tpl->tpl_vars['ldelim']->value . "options" . (string) $_smarty_tpl->tpl_vars['rdelim']->value, 'product_id' => ''), 0); ?> </tbody> <tbody id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> _no_item"<?php if ($_smarty_tpl->tpl_vars['item_ids']->value) { ?> class="hidden"<?php } ?> > <tr class="no-items"> <td colspan="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['colspan']->value) === null || $tmp === '' ? "3" : $tmp, ENT_QUOTES, 'UTF-8'); ?> "><p><?php echo ($tmp = @$_smarty_tpl->tpl_vars['no_item_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("no_items") : $tmp; ?> </p></td> </tr> </tbody> </table> <?php } elseif ($_smarty_tpl->tpl_vars['type']->value == "single") { ?> <div class="cm-display-radio" id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> "> <input id="<?php if ($_smarty_tpl->tpl_vars['input_id']->value) { echo htmlspecialchars($_smarty_tpl->tpl_vars['input_id']->value, ENT_QUOTES, 'UTF-8'); } else { ?> c<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> _ids<?php } ?> " type="hidden" class="cm-picker-value" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['input_name']->value, ENT_QUOTES, 'UTF-8'); ?> " value="<?php if (is_array($_smarty_tpl->tpl_vars['item_ids']->value)) { echo htmlspecialchars(implode(",", $_smarty_tpl->tpl_vars['item_ids']->value), ENT_QUOTES, 'UTF-8'); } ?> " /> <div class="input-append choose-input"> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/js.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_id' => '', 'holder' => $_smarty_tpl->tpl_vars['data_id']->value, 'hide_input' => $_smarty_tpl->tpl_vars['hide_input']->value, 'input_name' => $_smarty_tpl->tpl_vars['input_name']->value, 'hide_link' => $_smarty_tpl->tpl_vars['hide_link']->value, 'hide_delete_button' => $_smarty_tpl->tpl_vars['hide_delete_button']->value, 'type' => "single"), 0); ?> <?php echo Smarty::$_smarty_vars['capture']['add_buttons']; ?> </div> </div> <?php } } if ($_smarty_tpl->tpl_vars['view_mode']->value != "list") { ?> <div class="hidden"> <?php if ($_smarty_tpl->tpl_vars['extra_var']->value) { ?> <?php $_smarty_tpl->tpl_vars["extra_var"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['extra_var']->value), null, 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['no_container']->value) { ?> <div class="buttons-container"><?php } if ($_smarty_tpl->tpl_vars['picker_view']->value) { ?> [<?php } ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_picker_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_href' => fn_url("products.picker?display=" . (string) $_smarty_tpl->tpl_vars['display']->value . "&company_id=" . (string) $_smarty_tpl->tpl_vars['company_id']->value . "&company_ids=" . (string) $_smarty_tpl->tpl_vars['company_ids']->value . "&picker_for=" . (string) $_smarty_tpl->tpl_vars['picker_for']->value . "&extra=" . (string) $_smarty_tpl->tpl_vars['extra_var']->value . "&checkbox_name=" . (string) $_smarty_tpl->tpl_vars['checkbox_name']->value . "&aoc=" . (string) $_smarty_tpl->tpl_vars['aoc']->value . "&data_id=" . (string) $_smarty_tpl->tpl_vars['data_id']->value), 'but_text' => ($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add_products") : $tmp, 'but_role' => "add", 'but_target_id' => "content_" . (string) $_smarty_tpl->tpl_vars['data_id']->value, 'but_meta' => "cm-dialog-opener"), 0); ?> <?php if ($_smarty_tpl->tpl_vars['picker_view']->value) { ?> ]<?php } if (!$_smarty_tpl->tpl_vars['no_container']->value) { ?> </div><?php } ?> <div class="hidden" id="content_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> " title="<?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['but_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("add_products") : $tmp, ENT_QUOTES, 'UTF-8'); ?> "> </div> </div> <?php } }
function content_55d2f3548a6c92_12959746($_smarty_tpl) { if (!is_callable('smarty_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } 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 ($_smarty_tpl->tpl_vars['product']->value['extra']['buy_together']) { ?> <div class="ty-buy-together-notification ty-product-notification__item clearfix"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "50", 'image_height' => "50", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true, 'class' => "ty-product-notification__image"), 0); ?> <div class="clearfix"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> </a> <div class="ty-product-notification__price"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> x <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value, 'class' => "none"), 0); ?> </div> <ul class="ty-buy-together-notification__items"> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_option_data']) { ?> <li class="ty-buy-together-notification__item"><?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_option_data']), 0); ?> </li> <?php } ?> <li class="ty-buy-together-notification__item"><ul class="ty-buy-together-notification__items"> <?php $_smarty_tpl->tpl_vars["_product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["_product"]->_loop = false; $_smarty_tpl->tpl_vars["_key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['added_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["_product"]->key => $_smarty_tpl->tpl_vars["_product"]->value) { $_smarty_tpl->tpl_vars["_product"]->_loop = true; $_smarty_tpl->tpl_vars["_key"]->value = $_smarty_tpl->tpl_vars["_product"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['_product']->value['extra']['parent']['buy_together'] == $_smarty_tpl->tpl_vars['key']->value) { ?> <li class="ty-buy-together-notification__item"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['_product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> " class="ty-buy-together-notification__item-link"><?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['_product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> </a> <div class="ty-product-notification__price"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> x <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['_product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['_key']->value, 'class' => "none"), 0); ?> </div> </li> <?php if ($_smarty_tpl->tpl_vars['_product']->value['product_option_data']) { ?> <li class="ty-buy-together-notification__item"><?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['_product']->value['product_option_data']), 0); ?> </li> <?php } ?> <?php } ?> <?php } ?> </ul></li> </ul> </div> </div> <?php } elseif ($_smarty_tpl->tpl_vars['product']->value['extra']['parent']['buy_together']) { ?> <?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="addons/buy_together/hooks/products/notification_product.override.tpl" id="<?php echo smarty_function_set_id(array('name' => "addons/buy_together/hooks/products/notification_product.override.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 ($_smarty_tpl->tpl_vars['product']->value['extra']['buy_together']) { ?> <div class="ty-buy-together-notification ty-product-notification__item clearfix"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "50", 'image_height' => "50", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true, 'class' => "ty-product-notification__image"), 0); ?> <div class="clearfix"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> "><?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> </a> <div class="ty-product-notification__price"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> x <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value, 'class' => "none"), 0); ?> </div> <ul class="ty-buy-together-notification__items"> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_option_data']) { ?> <li class="ty-buy-together-notification__item"><?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_option_data']), 0); ?> </li> <?php } ?> <li class="ty-buy-together-notification__item"><ul class="ty-buy-together-notification__items"> <?php $_smarty_tpl->tpl_vars["_product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["_product"]->_loop = false; $_smarty_tpl->tpl_vars["_key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['added_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["_product"]->key => $_smarty_tpl->tpl_vars["_product"]->value) { $_smarty_tpl->tpl_vars["_product"]->_loop = true; $_smarty_tpl->tpl_vars["_key"]->value = $_smarty_tpl->tpl_vars["_product"]->key; ?> <?php if ($_smarty_tpl->tpl_vars['_product']->value['extra']['parent']['buy_together'] == $_smarty_tpl->tpl_vars['key']->value) { ?> <li class="ty-buy-together-notification__item"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['_product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> " class="ty-buy-together-notification__item-link"><?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['_product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> </a> <div class="ty-product-notification__price"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> x <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['_product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['_key']->value, 'class' => "none"), 0); ?> </div> </li> <?php if ($_smarty_tpl->tpl_vars['_product']->value['product_option_data']) { ?> <li class="ty-buy-together-notification__item"><?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['_product']->value['product_option_data']), 0); ?> </li> <?php } ?> <?php } ?> <?php } ?> </ul></li> </ul> </div> </div> <?php } elseif ($_smarty_tpl->tpl_vars['product']->value['extra']['parent']['buy_together']) { ?> <?php } } }
function content_55d2f354796fb8_13608182($_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_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } 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->smarty->_tag_stack[] = array('hook', array('name' => "products:notification_items")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:notification_items"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['added_products']->value) { ?> <?php $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['product']->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['added_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value) { $_smarty_tpl->tpl_vars['product']->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars['product']->key; ?> <?php if (!$_smarty_tpl->tpl_vars['product']->value['extra']['exclude_from_calculate']) { ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:notification_product")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:notification_product"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ty-product-notification__item clearfix"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_height' => "125", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true, 'class' => "ty-product-notification__image"), 0); ?> <div class="ty-product-notification__content clearfix"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> " class="ty-product-notification__product-name"><?php echo fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']); ?> </a> <?php if (!($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "hide_price_and_add_to_cart" && !$_smarty_tpl->tpl_vars['auth']->value['user_id'])) { ?> <div class="ty-product-notification__price"> <?php if (!$_smarty_tpl->tpl_vars['hide_amount']->value) { ?> <span class="none"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> </span> x <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value, 'class' => "none"), 0); ?> <?php } ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_option_data']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_option_data']), 0); ?> <?php } ?> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:notification_product"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php } ?> <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['empty_text']->value, ENT_QUOTES, 'UTF-8'); ?> <?php } $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:notification_items"), $_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(); } 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/product_notification_items.tpl" id="<?php echo smarty_function_set_id(array('name' => "views/products/components/product_notification_items.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->smarty->_tag_stack[] = array('hook', array('name' => "products:notification_items")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:notification_items"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['added_products']->value) { ?> <?php $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['product']->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['added_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value) { $_smarty_tpl->tpl_vars['product']->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars['product']->key; ?> <?php if (!$_smarty_tpl->tpl_vars['product']->value['extra']['exclude_from_calculate']) { ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:notification_product")); $_block_repeat = true; echo smarty_block_hook(array('name' => "products:notification_product"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ty-product-notification__item clearfix"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_height' => "125", 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair'], 'no_ids' => true, 'class' => "ty-product-notification__image"), 0); ?> <div class="ty-product-notification__content clearfix"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> " class="ty-product-notification__product-name"><?php echo fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']); ?> </a> <?php if (!($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "hide_price_and_add_to_cart" && !$_smarty_tpl->tpl_vars['auth']->value['user_id'])) { ?> <div class="ty-product-notification__price"> <?php if (!$_smarty_tpl->tpl_vars['hide_amount']->value) { ?> <span class="none"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> </span> x <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value, 'class' => "none"), 0); ?> <?php } ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_option_data']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_option_data']), 0); ?> <?php } ?> </div> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:notification_product"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php } ?> <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['empty_text']->value, ENT_QUOTES, 'UTF-8'); ?> <?php } $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "products:notification_items"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } }
function fn_add_product_to_cart($product_data, &$cart, &$auth, $update = false) { $ids = array(); if (!empty($product_data) && is_array($product_data)) { if (!defined('GET_OPTIONS')) { list($product_data, $cart) = fn_add_product_options_files($product_data, $cart, $auth, $update); } fn_set_hook('pre_add_to_cart', $product_data, $cart, $auth, $update); foreach ($product_data as $key => $data) { if (empty($key)) { continue; } if (empty($data['amount'])) { continue; } $data['stored_price'] = !empty($data['stored_price']) && defined('ORDER_MANAGEMENT') ? $data['stored_price'] : 'N'; if (empty($data['extra'])) { $data['extra'] = array(); } $product_id = !empty($data['product_id']) ? intval($data['product_id']) : intval($key); if (!fn_check_add_product_to_cart($cart, $data, $product_id)) { continue; } // Check if product options exist if (!isset($data['product_options'])) { $data['product_options'] = fn_get_default_product_options($product_id); } // Generate cart id $data['extra']['product_options'] = $data['product_options']; $_id = fn_generate_cart_id($product_id, $data['extra'], false); if (isset($ids[$_id]) && $key == $_id) { continue; } if (isset($data['extra']['exclude_from_calculate'])) { if (!empty($cart['products'][$key]) && !empty($cart['products'][$key]['extra']['aoc'])) { $cart['saved_product_options'][$cart['products'][$key]['extra']['saved_options_key']] = $data['product_options']; } if (isset($cart['deleted_exclude_products'][$data['extra']['exclude_from_calculate']][$_id])) { continue; } } $amount = fn_normalize_amount(@$data['amount']); if (!isset($data['extra']['exclude_from_calculate'])) { if ($data['stored_price'] != 'Y') { $allow_add = true; // Check if the product price with options modifiers equals to zero $price = fn_get_product_price($product_id, $amount, $auth); $zero_price_action = db_get_field("SELECT zero_price_action FROM ?:products WHERE product_id = ?i", $product_id); if (!floatval($price) && $zero_price_action == 'A') { if (isset($cart['products'][$key]['custom_user_price'])) { $price = $cart['products'][$key]['custom_user_price']; } else { $custom_user_price = empty($data['price']) ? 0 : $data['price']; } } $price = fn_apply_options_modifiers($data['product_options'], $price, 'P', array(), array('product_data' => $data)); if (!floatval($price)) { $data['price'] = isset($data['price']) ? fn_parse_price($data['price']) : 0; if (($zero_price_action == 'R' || $zero_price_action == 'A' && floatval($data['price']) < 0) && AREA == 'C') { if ($zero_price_action == 'A') { fn_set_notification('E', __('error'), __('incorrect_price_warning')); } $allow_add = false; } $price = empty($data['price']) ? 0 : $data['price']; } /** * Recalculates price and checks if product can be added with the current price * * @param array $data Adding product data * @param float $price Calculated product price * @param boolean $allow_add Flag that determines if product can be added to cart */ fn_set_hook('add_product_to_cart_check_price', $data, $price, $allow_add); if (!$allow_add) { continue; } } else { $price = empty($data['price']) ? 0 : $data['price']; } } else { $price = 0; } $_data = db_get_row('SELECT is_edp, options_type, tracking, unlimited_download FROM ?:products WHERE product_id = ?i', $product_id); if (isset($_data['is_edp'])) { $data['is_edp'] = $_data['is_edp']; } elseif (!isset($data['is_edp'])) { $data['is_edp'] = 0; } if (isset($_data['options_type'])) { $data['options_type'] = $_data['options_type']; } if (isset($_data['tracking'])) { $data['tracking'] = $_data['tracking']; } if (isset($_data['unlimited_download'])) { $data['extra']['unlimited_download'] = $_data['unlimited_download']; } // Check the sequential options if (!empty($data['tracking']) && $data['tracking'] == ProductTracking::TRACK_WITH_OPTIONS && $data['options_type'] == 'S') { $inventory_options = db_get_fields("SELECT a.option_id FROM ?:product_options as a LEFT JOIN ?:product_global_option_links as c ON c.option_id = a.option_id WHERE (a.product_id = ?i OR c.product_id = ?i) AND a.status = 'A' AND a.inventory = 'Y'", $product_id, $product_id); $sequential_completed = true; if (!empty($inventory_options)) { foreach ($inventory_options as $option_id) { if (!isset($data['product_options'][$option_id]) || empty($data['product_options'][$option_id])) { $sequential_completed = false; break; } } } if (!$sequential_completed) { fn_set_notification('E', __('error'), __('select_all_product_options')); // Even if customer tried to add the product from the catalog page, we will redirect he/she to the detailed product page to give an ability to complete a purchase $redirect_url = fn_url('products.view?product_id=' . $product_id . '&combination=' . fn_get_options_combination($data['product_options'])); $_REQUEST['redirect_url'] = $redirect_url; //FIXME: Very very very BAD style to use the global variables in the functions!!! return false; } } if (!isset($cart['products'][$_id])) { // If product doesn't exists in the cart $amount = empty($data['original_amount']) ? fn_check_amount_in_stock($product_id, $amount, $data['product_options'], $_id, $data['is_edp'], 0, $cart, $update == true ? $key : 0) : $data['original_amount']; if ($amount === false) { continue; } $cart['products'][$_id]['product_id'] = $product_id; $cart['products'][$_id]['product_code'] = fn_get_product_code($product_id, $data['product_options']); $cart['products'][$_id]['product'] = fn_get_product_name($product_id); $cart['products'][$_id]['amount'] = $amount; $cart['products'][$_id]['product_options'] = $data['product_options']; $cart['products'][$_id]['price'] = $price; if (!empty($zero_price_action) && $zero_price_action == 'A') { if (isset($custom_user_price)) { $cart['products'][$_id]['custom_user_price'] = $custom_user_price; } elseif (isset($cart['products'][$key]['custom_user_price'])) { $cart['products'][$_id]['custom_user_price'] = $cart['products'][$key]['custom_user_price']; } } $cart['products'][$_id]['stored_price'] = $data['stored_price']; // add image for minicart $cart['products'][$_id]['main_pair'] = fn_get_cart_product_icon($product_id, $data); fn_define_original_amount($product_id, $_id, $cart['products'][$_id], $data); if ($update == true && $key != $_id) { fn_delete_cart_product($cart, $key, false); } } else { // If product is already exist in the cart $_initial_amount = empty($cart['products'][$_id]['original_amount']) ? $cart['products'][$_id]['amount'] : $cart['products'][$_id]['original_amount']; // If ID changed (options were changed), summ the total amount of old and new products if ($update == true && $key != $_id) { $amount += $_initial_amount; fn_delete_cart_product($cart, $key, false); } $cart['products'][$_id]['amount'] = fn_check_amount_in_stock($product_id, ($update == true ? 0 : $_initial_amount) + $amount, $data['product_options'], $_id, !empty($data['is_edp']) && $data['is_edp'] == 'Y' ? 'Y' : 'N', 0, $cart, $update == true ? $key : 0); } $cart['products'][$_id]['extra'] = empty($data['extra']) ? array() : $data['extra']; $cart['products'][$_id]['stored_discount'] = @$data['stored_discount']; if (defined('ORDER_MANAGEMENT')) { $cart['products'][$_id]['discount'] = @$data['discount']; } // Increase product popularity if (empty($_SESSION['products_popularity']['added'][$product_id])) { $_data = array('product_id' => $product_id, 'added' => 1, 'total' => POPULARITY_ADD_TO_CART); db_query("INSERT INTO ?:product_popularity ?e ON DUPLICATE KEY UPDATE added = added + 1, total = total + ?i", $_data, POPULARITY_ADD_TO_CART); $_SESSION['products_popularity']['added'][$product_id] = true; } $company_id = db_get_field("SELECT company_id FROM ?:products WHERE product_id = ?i", $product_id); $cart['products'][$_id]['company_id'] = $company_id; if (!empty($data['saved_object_id'])) { $cart['products'][$_id]['object_id'] = $data['saved_object_id']; } fn_set_hook('add_to_cart', $cart, $product_id, $_id); $ids[$_id] = $product_id; } /** * Change product data after adding product to cart * * @param array $product_data Product data * @param array $cart Cart data * @param array $auth Auth data * @param bool $update Flag the determains if cart data are updated */ fn_set_hook('post_add_to_cart', $product_data, $cart, $auth, $update, $ids); $cart['recalculate'] = true; if (!empty($cart['chosen_shipping'])) { $cart['calculate_shipping'] = true; unset($cart['product_groups']); } return $ids; } else { return false; } }
function fn_change_order_status($order_id, $status_to, $status_from = '', $force_notification = array(), $place_order = false) { $order_info = fn_get_order_info($order_id, true); $order_statuses = fn_get_statuses(STATUSES_ORDER, false, true); if (empty($status_from)) { $status_from = $order_info['status']; } if (empty($order_info) || empty($status_to) || $status_from == $status_to) { return false; } $_updated_ids = array(); $_error = false; foreach ($order_info['items'] as $k => $v) { // Generate ekey if EDP is ordered if (!empty($v['extra']['is_edp']) && $v['extra']['is_edp'] == 'Y') { continue; // don't track inventory } // Update product amount if inventory tracking is enabled if (Registry::get('settings.General.inventory_tracking') == 'Y') { if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') { // decrease amount if (fn_update_product_amount($v['product_id'], $v['amount'], @$v['extra']['product_options'], '-') == false) { $status_to = 'B'; //backorder $_error = true; $msg = str_replace('[product]', fn_get_product_name($v['product_id']) . ' #' . $v['product_id'], fn_get_lang_var('low_stock_subj')); fn_set_notification('W', fn_get_lang_var('warning'), $msg); break; } else { $_updated_ids[] = $k; } } elseif ($order_statuses[$status_to]['inventory'] == 'I' && $order_statuses[$status_from]['inventory'] == 'D') { // increase amount fn_update_product_amount($v['product_id'], $v['amount'], @$v['extra']['product_options'], '+'); } } } if ($_error) { if (!empty($_updated_ids)) { foreach ($_updated_ids as $id) { // increase amount fn_update_product_amount($order_info['items'][$id]['product_id'], $order_info['items'][$id]['amount'], @$order_info['items'][$id]['extra']['product_options'], '+'); } unset($_updated_ids); } if ($status_from == $status_to) { return false; } } fn_promotion_post_processing($status_to, $status_from, $order_info, $force_notification); fn_set_hook('change_order_status', $status_to, $status_from, $order_info, $force_notification, $order_statuses, $place_order); // Log order status change fn_log_event('orders', 'status', array('order_id' => $order_id, 'status_from' => $status_from, 'status_to' => $status_to)); if (!empty($order_statuses[$status_to]['appearance_type']) && ($order_statuses[$status_to]['appearance_type'] == 'I' || $order_statuses[$status_to]['appearance_type'] == 'C') && !db_get_field("SELECT doc_id FROM ?:order_docs WHERE type = ?s AND order_id = ?i", $order_statuses[$status_to]['appearance_type'], $order_id)) { $_data = array('order_id' => $order_id, 'type' => $order_statuses[$status_to]['appearance_type']); $order_info['doc_ids'][$order_statuses[$status_to]['appearance_type']] = db_query("INSERT INTO ?:order_docs ?e", $_data); } // Check if we need to remove CC info if (!empty($order_statuses[$status_to]['remove_cc_info']) && $order_statuses[$status_to]['remove_cc_info'] == 'Y' && !empty($order_info['payment_info'])) { fn_cleanup_payment_info($order_id, $order_info['payment_info'], true); } $edp_data = fn_generate_ekeys_for_edp(array('status_from' => $status_from, 'status_to' => $status_to), $order_info); $order_info['status'] = $status_to; fn_order_notification($order_info, $edp_data, $force_notification); db_query("UPDATE ?:orders SET status = ?s WHERE order_id = ?i", $status_to, $order_id); if ($order_info['is_parent_order'] == 'Y') { $child_ids = db_get_fields("SELECT order_id FROM ?:orders WHERE parent_order_id = ?i", $order_id); foreach ($child_ids as $child_order_id) { fn_change_order_status($child_order_id, $status_to, $status_from, $force_notification, $place_order); } } return true; }
/** * Send back in stock notifications for subscribed customers * * @param int $product_id product id * @return boolean always true */ function fn_send_product_notifications($product_id) { if (empty($product_id)) { return false; } $emails = db_get_fields("SELECT email FROM ?:product_subscriptions WHERE product_id = ?i", $product_id); if (!empty($emails)) { $product['name'] = fn_get_product_name($product_id, Registry::get('settings.Appearance.frontend_default_language')); $product['company_id'] = fn_get_company_id('products', 'product_id', $product_id); Mailer::sendMail(array('to' => $emails, 'from' => 'company_orders_department', 'reply_to' => 'company_orders_department', 'data' => array('product' => $product, 'product_id' => $product_id), 'tpl' => 'product/back_in_stock_notification.tpl', 'company_id' => $product['company_id']), 'C', Registry::get('settings.Appearance.frontend_default_language')); if (!defined('ORDER_MANAGEMENT')) { db_query("DELETE FROM ?:product_subscriptions WHERE product_id = ?i", $product_id); } } return true; }
function content_55ccecdc2182d3_82481811($_smarty_tpl) { if (!is_callable('smarty_modifier_truncate')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.truncate.php'; } ?> <div class="hidden" id="content_related_products"> <?php if ($_smarty_tpl->tpl_vars['addons']->value['1clue_related_products_extended']['related_filling'] == 'manual') { ?> <?php echo $_smarty_tpl->getSubTemplate("pickers/products/picker.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('positions' => '', 'input_name' => "related", 'data_id' => "added_products", 'item_ids' => $_smarty_tpl->tpl_vars['related']->value, 'type' => "links"), 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['tags'] = new Smarty_variable(implode(",", $_smarty_tpl->tpl_vars['product_data']->value['1c_tags']), null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __('product_tags')), 0); ?> <input type="text" name="product_data[1c_tags]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tags']->value, ENT_QUOTES, 'UTF-8'); ?> " class="input-text-long" /> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __('tag_related')), 0); ?> <?php if ($_smarty_tpl->tpl_vars['related']->value) { ?> <table cellpadding="0" cellspacing="0" border="0" width="100%" class="table"> <tr> <th width="70%"><?php echo $_smarty_tpl->__('name'); ?> </th> <th><?php echo $_smarty_tpl->__('1c_tags'); ?> </th> </tr> <tbody id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['data_id']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['related']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; ?> <tr> <td><a href="<?php echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> " class="strong"><?php echo htmlspecialchars(htmlspecialchars_decode(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES), ENT_QUOTES, 'UTF-8'); ?> </td> <td><?php echo htmlspecialchars(smarty_modifier_truncate($_smarty_tpl->tpl_vars['product']->value['tags'], 80), ENT_QUOTES, 'UTF-8'); ?> </td> </tr> <?php } ?> </tbody> </table> <?php } else { ?> <?php echo $_smarty_tpl->__('no_related_found'); ?> <?php } } ?> </div> <?php }
function fn_do_call_request($params, $product_data, &$cart, &$auth) { $result = array(); $params['cart_products'] = fn_call_request_get_cart_products($cart); if (!empty($params['product_id']) && !empty($params['email'])) { $params['order_id'] = fn_call_requests_placing_order($params, $product_data, $cart, $auth); } $request_id = fn_update_call_request($params); $company_id = Registry::get('runtime.company_id'); $lang_code = fn_get_company_language($company_id); if (empty($lang_code)) { $lang_code = CART_LANGUAGE; } $url = fn_url('call_requests.manage?id=' . $request_id, 'A', 'current', $lang_code, true); if (empty($params['product_id'])) { // Call request Mailer::sendMail(array('to' => 'company_orders_department', 'from' => 'default_company_orders_department', 'data' => array('url' => $url, 'customer' => $params['name'], 'phone_number' => $params['phone'], 'time_from' => $params['time_from'] ?: CALL_REQUESTS_DEFAULT_TIME_FROM, 'time_to' => $params['time_to'] ?: CALL_REQUESTS_DEFAULT_TIME_TO), 'tpl' => 'addons/call_requests/call_request.tpl', 'company_id' => $company_id), 'A', $lang_code); } elseif (empty($params['order_id'])) { // Buy with one click without order Mailer::sendMail(array('to' => 'company_orders_department', 'from' => 'default_company_orders_department', 'data' => array('url' => $url, 'customer' => $params['name'], 'phone_number' => $params['phone'], 'product_url' => fn_url('products.view?product_id=' . $params['product_id'], 'C'), 'product_name' => fn_get_product_name($params['product_id'], $lang_code)), 'tpl' => 'addons/call_requests/buy_with_one_click.tpl', 'company_id' => $company_id), 'A', $lang_code); } if (!empty($params['order_id'])) { $result['notice'] = __('call_requests.order_placed', array('[order_id]' => $params['order_id'])); } else { $result['notice'] = __('call_requests.request_recieved'); } return $result; }
function content_55ccec9d8f2fb2_09569449($_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_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('total_items', 'total_items', 'subtotal', 'move_to_wishlist', 'options', 'delete', 'cart_is_empty', 'view_cart', 'checkout', 'continue_shopping', 'view_cart', 'checkout', 'continue_shopping', 'total_items', 'total_items', 'subtotal', 'move_to_wishlist', 'options', 'delete', 'cart_is_empty', 'view_cart', 'checkout', 'continue_shopping', 'view_cart', 'checkout', 'continue_shopping')); 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->tpl_vars["dropdown_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['block']->value['snapping_id'], null, 0); ?> <?php $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:cart_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:cart_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ty-dropdown-box ls_cart_wrap" id="cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div id="sw_dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="ty-dropdown-box__title cm-combination ls_car_click"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:dropdown_title")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_SESSION['cart']['amount']) { ?> <span id="ls_cart_no"><?php echo htmlspecialchars($_SESSION['cart']['amount'], ENT_QUOTES, 'UTF-8'); ?> </span> <span id='ls_secondary_currency' style="display:none"><?php echo htmlspecialchars(@constant('CART_SECONDARY_CURRENCY'), ENT_QUOTES, 'UTF-8'); ?> </span> <?php } else { ?> <span id="ls_cart_no">0</span> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </a> </div> <div id="dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-popup-box ty-dropdown-box__content hidden ls_cart_dropdown"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="cm-cart-content <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> cm-cart-content-thumb<?php } ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> cm-cart-content-delete<?php } ?> "> <span style="display: none" id="ls_frontend_language"><?php echo htmlspecialchars($_SESSION['settings']['cart_languageC']['value'], ENT_QUOTES, 'UTF-8'); ?> </span> <div class="ty-cart-items"> <div class="ls_cart_upper_text"> <div class="ls_cart_total_items_text"> <?php if ($_SESSION['cart']['amount']) { ?> <?php echo $_smarty_tpl->__("total_items"); ?> : <span class="ls_cart_no"><?php echo htmlspecialchars($_SESSION['cart']['amount'], ENT_QUOTES, 'UTF-8'); ?> </span> <?php } else { ?> <?php echo $_smarty_tpl->__("total_items"); ?> : <span class="ls_cart_no">0</span> <?php } ?> </div> <div class="ls_cart_subtotal_text"> <?php echo $_smarty_tpl->__("subtotal"); ?> : <span id='ls_subtotal_tpl'><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_SESSION['cart']['display_subtotal']), 0); ?> </span> </div> </div> <div class="ls-vertical-slider-nav"> <button id="ls-vertical-lsc_prev" data-dir="prev">Previous</button> </div> <div class="ls_please-wait" style="display: none;"></div> <div class="ls-vertical-slider ls-vertical-lsc_container"> <?php if ($_SESSION['cart']['amount']) { ?> <ul class="ls_vertical_cart_ul "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:cart_status")); $_block_repeat = true; echo smarty_block_hook(array('name' => "index:cart_status"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_smarty_tpl->tpl_vars["_cart_products"] = new Smarty_variable(array_reverse($_SESSION['cart']['products'], true), null, 0); ?> <?php $_smarty_tpl->tpl_vars["p"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["p"]->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['_cart_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["p"]->key => $_smarty_tpl->tpl_vars["p"]->value) { $_smarty_tpl->tpl_vars["p"]->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["p"]->key; ?> <?php if (!$_smarty_tpl->tpl_vars['p']->value['extra']['parent']) { ?> <?php if ($_smarty_tpl->tpl_vars['p']->value['price']) { ?> <li class="ty-cart-items__list-item"> <span style="display: none" class="ls_cart_combination_hash"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8'); ?> </span> <span style="display: none" class="ls_cart_combination_id"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> </span> <span style="display: none" class="test_product_options"><?php echo htmlspecialchars(var_dump($_smarty_tpl->tpl_vars['p']->value['product_options']), ENT_QUOTES, 'UTF-8'); ?> </span> <div class="ty-cart-items__list-item-desc"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['p']->value['product_id'] . "`&wishlist_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "`"), ENT_QUOTES, 'UTF-8'); ?> "><?php echo fn_get_product_name($_smarty_tpl->tpl_vars['p']->value['product_id']); ?> </a> <p> <span class="ls_cart_product_amount"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> </span><span> x </span><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['p']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value . "_" . (string) $_smarty_tpl->tpl_vars['dropdown_id']->value, 'class' => "none"), 0); ?> </p> <div class='row-fluid'> <span class="span4"> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> <div class="ty-cart-items__list-item-image ls_cart_product_image"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "120", 'image_height' => "168", 'images' => $_smarty_tpl->tpl_vars['p']->value['main_pair'], 'no_ids' => true), 0); ?> </div> <?php } ?> </span> <form class="ls_move_to_wishlist_form"> <input type='hidden' name='product_data[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> ][product_id]' value='<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> '> <input type='hidden' name='ls_cart_combination_hash' value='<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8'); ?> '> <input type='hidden' name='ls_move_to' value='wishlist'> <?php $_smarty_tpl->tpl_vars["option"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["option"]->_loop = false; $_smarty_tpl->tpl_vars['option_id'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['p']->value['product_options']; 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['option_id']->value = $_smarty_tpl->tpl_vars["option"]->key; ?> <input type="hidden" name="product_data[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> ][product_options][<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['option_id']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['option']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php } ?> <span class="ls_move_to_wishlist" title="<?php echo $_smarty_tpl->__("move_to_wishlist"); ?> ">add_to_wishlist</span> </form> <?php if ($_smarty_tpl->tpl_vars['p']->value['product_options']) { ?> <span class="span8"> <!--div class="ls_cart_options"--> <div class="ty-control-group ty-product-options__info clearfix"> <!--div class="ls_cart_options_title"--><label class="ty-product-options__title"><?php echo $_smarty_tpl->__("options"); ?> :</label><!--/div--> <?php echo $_smarty_tpl->getSubTemplate("views/products/components/ls_minicart_options.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('ls_minicart_options' => $_smarty_tpl->tpl_vars['p']->value['ls_minicart_options'], 'product' => $_smarty_tpl->tpl_vars['p']->value, 'name' => "cart_products", 'id' => $_smarty_tpl->tpl_vars['key']->value), 0); ?> </div> <!--/div--> </span> </div> <?php } ?> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> <div class="ty-cart-items__list-item-tools cm-cart-item-delete" title="<?php echo $_smarty_tpl->__("delete"); ?> "> <?php if ((!$_smarty_tpl->tpl_vars['runtime']->value['checkout'] || $_smarty_tpl->tpl_vars['force_items_deletion']->value) && !$_smarty_tpl->tpl_vars['p']->value['extra']['exclude_from_calculate']) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete.from_status?cart_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value, 'but_meta' => "cm-ajax", 'but_target_id' => "cart_status*", 'but_role' => "delete", 'but_name' => "delete_cart_item"), 0); ?> <?php } ?> </div> <?php } ?> </li> <?php } ?> <?php } ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "index:cart_status"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </ul> <?php } else { ?> <div class="ty-cart-items__empty ty-center"><?php echo $_smarty_tpl->__("cart_is_empty"); ?> </div> <?php } ?> </div> <div class="ls-vertical-slider-nav"> <button id="ls-vertical-lsc_next" data-dir="next">Next</button> </div> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_bottom_buttons'] == "Y") { ?> <div class="ls_bottom_buttons_cart cm-cart-buttons ty-cart-content__buttons buttons-container full-cart"> <?php if ($_SESSION['cart']['amount']) { ?> <div class="ty-float-left ls_bottom_cart_view"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("view_cart"); ?> </a> </div> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['checkout_redirect'] != "Y") { ?> <div class="ty-float-right ls_bottom_cart_checkout"> <a href="<?php echo htmlspecialchars(fn_url("checkout.checkout"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__primary"><?php echo $_smarty_tpl->__("checkout"); ?> </a> </div> <?php } ?> <div class="ls_continue_shopping" style="display: none;"> <a href="#" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("continue_shopping"); ?> </a> </div> <?php } else { ?> <div style="display: none;" class="ty-float-left ls_bottom_cart_view"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("view_cart"); ?> </a> </div> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['checkout_redirect'] != "Y") { ?> <div style="display: none;" class="ty-float-right ls_bottom_cart_checkout"> <a href="<?php echo htmlspecialchars(fn_url("checkout.checkout"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__primary"><?php echo $_smarty_tpl->__("checkout"); ?> </a> </div> <?php } ?> <div class="ls_continue_shopping"> <a href="#" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("continue_shopping"); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <!--cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:cart_content"), $_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(); } 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="blocks/cart_content.tpl" id="<?php echo smarty_function_set_id(array('name' => "blocks/cart_content.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->tpl_vars["dropdown_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['block']->value['snapping_id'], null, 0); ?> <?php $_smarty_tpl->tpl_vars["r_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:cart_content")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:cart_content"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="ty-dropdown-box ls_cart_wrap" id="cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div id="sw_dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="ty-dropdown-box__title cm-combination ls_car_click"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:dropdown_title")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_SESSION['cart']['amount']) { ?> <span id="ls_cart_no"><?php echo htmlspecialchars($_SESSION['cart']['amount'], ENT_QUOTES, 'UTF-8'); ?> </span> <span id='ls_secondary_currency' style="display:none"><?php echo htmlspecialchars(@constant('CART_SECONDARY_CURRENCY'), ENT_QUOTES, 'UTF-8'); ?> </span> <?php } else { ?> <span id="ls_cart_no">0</span> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:dropdown_title"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </a> </div> <div id="dropdown_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-popup-box ty-dropdown-box__content hidden ls_cart_dropdown"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:minicart")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:minicart"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <div class="cm-cart-content <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> cm-cart-content-thumb<?php } ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> cm-cart-content-delete<?php } ?> "> <span style="display: none" id="ls_frontend_language"><?php echo htmlspecialchars($_SESSION['settings']['cart_languageC']['value'], ENT_QUOTES, 'UTF-8'); ?> </span> <div class="ty-cart-items"> <div class="ls_cart_upper_text"> <div class="ls_cart_total_items_text"> <?php if ($_SESSION['cart']['amount']) { ?> <?php echo $_smarty_tpl->__("total_items"); ?> : <span class="ls_cart_no"><?php echo htmlspecialchars($_SESSION['cart']['amount'], ENT_QUOTES, 'UTF-8'); ?> </span> <?php } else { ?> <?php echo $_smarty_tpl->__("total_items"); ?> : <span class="ls_cart_no">0</span> <?php } ?> </div> <div class="ls_cart_subtotal_text"> <?php echo $_smarty_tpl->__("subtotal"); ?> : <span id='ls_subtotal_tpl'><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_SESSION['cart']['display_subtotal']), 0); ?> </span> </div> </div> <div class="ls-vertical-slider-nav"> <button id="ls-vertical-lsc_prev" data-dir="prev">Previous</button> </div> <div class="ls_please-wait" style="display: none;"></div> <div class="ls-vertical-slider ls-vertical-lsc_container"> <?php if ($_SESSION['cart']['amount']) { ?> <ul class="ls_vertical_cart_ul "> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "index:cart_status")); $_block_repeat = true; echo smarty_block_hook(array('name' => "index:cart_status"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_smarty_tpl->tpl_vars["_cart_products"] = new Smarty_variable(array_reverse($_SESSION['cart']['products'], true), null, 0); ?> <?php $_smarty_tpl->tpl_vars["p"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["p"]->_loop = false; $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['_cart_products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["p"]->key => $_smarty_tpl->tpl_vars["p"]->value) { $_smarty_tpl->tpl_vars["p"]->_loop = true; $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["p"]->key; ?> <?php if (!$_smarty_tpl->tpl_vars['p']->value['extra']['parent']) { ?> <?php if ($_smarty_tpl->tpl_vars['p']->value['price']) { ?> <li class="ty-cart-items__list-item"> <span style="display: none" class="ls_cart_combination_hash"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8'); ?> </span> <span style="display: none" class="ls_cart_combination_id"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> </span> <span style="display: none" class="test_product_options"><?php echo htmlspecialchars(var_dump($_smarty_tpl->tpl_vars['p']->value['product_options']), ENT_QUOTES, 'UTF-8'); ?> </span> <div class="ty-cart-items__list-item-desc"> <a href="<?php echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['p']->value['product_id'] . "`&wishlist_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "`"), ENT_QUOTES, 'UTF-8'); ?> "><?php echo fn_get_product_name($_smarty_tpl->tpl_vars['p']->value['product_id']); ?> </a> <p> <span class="ls_cart_product_amount"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['amount'], ENT_QUOTES, 'UTF-8'); ?> </span><span> x </span><?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['p']->value['display_price'], 'span_id' => "price_" . (string) $_smarty_tpl->tpl_vars['key']->value . "_" . (string) $_smarty_tpl->tpl_vars['dropdown_id']->value, 'class' => "none"), 0); ?> </p> <div class='row-fluid'> <span class="span4"> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['products_links_type'] == "thumb") { ?> <div class="ty-cart-items__list-item-image ls_cart_product_image"> <?php echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => "120", 'image_height' => "168", 'images' => $_smarty_tpl->tpl_vars['p']->value['main_pair'], 'no_ids' => true), 0); ?> </div> <?php } ?> </span> <form class="ls_move_to_wishlist_form"> <input type='hidden' name='product_data[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> ][product_id]' value='<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> '> <input type='hidden' name='ls_cart_combination_hash' value='<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8'); ?> '> <input type='hidden' name='ls_move_to' value='wishlist'> <?php $_smarty_tpl->tpl_vars["option"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["option"]->_loop = false; $_smarty_tpl->tpl_vars['option_id'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['p']->value['product_options']; 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['option_id']->value = $_smarty_tpl->tpl_vars["option"]->key; ?> <input type="hidden" name="product_data[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['p']->value['product_id'], ENT_QUOTES, 'UTF-8'); ?> ][product_options][<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['option_id']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['option']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php } ?> <span class="ls_move_to_wishlist" title="<?php echo $_smarty_tpl->__("move_to_wishlist"); ?> ">add_to_wishlist</span> </form> <?php if ($_smarty_tpl->tpl_vars['p']->value['product_options']) { ?> <span class="span8"> <!--div class="ls_cart_options"--> <div class="ty-control-group ty-product-options__info clearfix"> <!--div class="ls_cart_options_title"--><label class="ty-product-options__title"><?php echo $_smarty_tpl->__("options"); ?> :</label><!--/div--> <?php echo $_smarty_tpl->getSubTemplate("views/products/components/ls_minicart_options.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('ls_minicart_options' => $_smarty_tpl->tpl_vars['p']->value['ls_minicart_options'], 'product' => $_smarty_tpl->tpl_vars['p']->value, 'name' => "cart_products", 'id' => $_smarty_tpl->tpl_vars['key']->value), 0); ?> </div> <!--/div--> </span> </div> <?php } ?> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_delete_icons'] == "Y") { ?> <div class="ty-cart-items__list-item-tools cm-cart-item-delete" title="<?php echo $_smarty_tpl->__("delete"); ?> "> <?php if ((!$_smarty_tpl->tpl_vars['runtime']->value['checkout'] || $_smarty_tpl->tpl_vars['force_items_deletion']->value) && !$_smarty_tpl->tpl_vars['p']->value['extra']['exclude_from_calculate']) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_href' => "checkout.delete.from_status?cart_id=" . (string) $_smarty_tpl->tpl_vars['key']->value . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['r_url']->value, 'but_meta' => "cm-ajax", 'but_target_id' => "cart_status*", 'but_role' => "delete", 'but_name' => "delete_cart_item"), 0); ?> <?php } ?> </div> <?php } ?> </li> <?php } ?> <?php } ?> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "index:cart_status"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </ul> <?php } else { ?> <div class="ty-cart-items__empty ty-center"><?php echo $_smarty_tpl->__("cart_is_empty"); ?> </div> <?php } ?> </div> <div class="ls-vertical-slider-nav"> <button id="ls-vertical-lsc_next" data-dir="next">Next</button> </div> </div> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['display_bottom_buttons'] == "Y") { ?> <div class="ls_bottom_buttons_cart cm-cart-buttons ty-cart-content__buttons buttons-container full-cart"> <?php if ($_SESSION['cart']['amount']) { ?> <div class="ty-float-left ls_bottom_cart_view"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("view_cart"); ?> </a> </div> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['checkout_redirect'] != "Y") { ?> <div class="ty-float-right ls_bottom_cart_checkout"> <a href="<?php echo htmlspecialchars(fn_url("checkout.checkout"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__primary"><?php echo $_smarty_tpl->__("checkout"); ?> </a> </div> <?php } ?> <div class="ls_continue_shopping" style="display: none;"> <a href="#" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("continue_shopping"); ?> </a> </div> <?php } else { ?> <div style="display: none;" class="ty-float-left ls_bottom_cart_view"> <a href="<?php echo htmlspecialchars(fn_url("checkout.cart"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("view_cart"); ?> </a> </div> <?php if ($_smarty_tpl->tpl_vars['settings']->value['General']['checkout_redirect'] != "Y") { ?> <div style="display: none;" class="ty-float-right ls_bottom_cart_checkout"> <a href="<?php echo htmlspecialchars(fn_url("checkout.checkout"), ENT_QUOTES, 'UTF-8'); ?> " rel="nofollow" class="ty-btn ty-btn__primary"><?php echo $_smarty_tpl->__("checkout"); ?> </a> </div> <?php } ?> <div class="ls_continue_shopping"> <a href="#" class="ty-btn ty-btn__secondary"><?php echo $_smarty_tpl->__("continue_shopping"); ?> </a> </div> <?php } ?> </div> <?php } ?> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:minicart"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <!--cart_status_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['dropdown_id']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:cart_content"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } }
$comment = $_REQUEST['comment']; $total_amount = 0; foreach ($returns as $k => $v) { if (isset($v['chosen']) && $v['chosen'] == 'Y') { $total_amount += $v['amount']; } } $_data = array('order_id' => $order_id, 'user_id' => $user_id, 'action' => $action, 'timestamp' => TIME, 'status' => RMA_DEFAULT_STATUS, 'total_amount' => $total_amount, 'comment' => $comment); $return_id = db_query('INSERT INTO ?:rma_returns ?e', $_data); $order_items = db_get_hash_array("SELECT item_id, order_id, extra, price, amount FROM ?:order_details WHERE order_id = ?i", 'item_id', $order_id); foreach ($returns as $item_id => $v) { if (isset($v['chosen']) && $v['chosen'] == 'Y') { if (true == fn_rma_declined_product_correction($order_id, $k, $v['available_amount'], $v['amount'])) { $_item = $order_items[$item_id]; $extra = @unserialize($_item['extra']); $_data = array('return_id' => $return_id, 'item_id' => $item_id, 'product_id' => $v['product_id'], 'reason' => !empty($v['reason']) ? $v['reason'] : '', 'amount' => $v['amount'], 'product_options' => !empty($extra['product_options_value']) ? serialize($extra['product_options_value']) : '', 'price' => fn_format_price((!isset($extra['exclude_from_calculate']) ? $_item['price'] : 0) * $_item['amount'] / $_item['amount']), 'product' => !empty($extra['product']) ? $extra['product'] : fn_get_product_name($v['product_id'], $oder_lang_code)); db_query('INSERT INTO ?:rma_return_products ?e', $_data); if (!isset($extra['returns'])) { $extra['returns'] = array(); } $extra['returns'][$return_id] = array('amount' => $v['amount'], 'status' => RMA_DEFAULT_STATUS); db_query('UPDATE ?:order_details SET ?u WHERE item_id = ?i AND order_id = ?i', array('extra' => serialize($extra)), $item_id, $order_id); } } } //Send mail $return_info = fn_get_return_info($return_id); $order_info = fn_get_order_info($order_id); fn_send_return_mail($return_info, $order_info, array('C' => true, 'A' => true, 'S' => true)); } return array(CONTROLLER_STATUS_OK, 'rma.details?return_id=' . $return_id);
function fn_get_affiliate_actions($params, $sorting = 'date DESC', $do_pagination = false, $page = 1, $lang_code = CART_LANGUAGE) { $payout_types =& Registry::get('payout_types'); // Define sort fields $sortings = array('action' => "actions.action", 'date' => "actions.date", 'cost' => "actions.amount", 'customer' => array("customers.lastname", "customers.firstname"), 'partner' => "partners.firstname", 'banner' => "?:aff_banner_descriptions.title", 'status' => "actions.payout_id, actions.approved"); $directions = array('asc' => 'asc', 'desc' => 'desc'); if (is_array($params)) { $condition = '1'; if (!empty($params['action_id'])) { $condition .= db_quote(" AND actions.action_id = ?i", $params['action_id']); } if (!empty($params['object_type'])) { $condition .= db_quote(" AND alinks.object_type = ?s", $params['object_type']); } if (!empty($params['object_data'])) { $condition .= db_quote(" AND alinks.object_data = ?s", $params['object_data']); } if (!empty($params['payout_id'])) { $condition .= db_quote(" AND payout_id = ?i", $params['payout_id']); } if (empty($params['sort_order']) || empty($directions[$params['sort_order']])) { $params['sort_order'] = 'asc'; } if (empty($params['sort_by']) || empty($sortings[$params['sort_by']])) { $params['sort_by'] = 'date'; } $sorting = (is_array($sortings[$params['sort_by']]) ? implode(' ' . $directions[$params['sort_order']] . ', ', $sortings[$params['sort_by']]) : $sortings[$params['sort_by']]) . " " . $directions[$params['sort_order']]; } else { $condition = $params; // FIXME if (is_array($sorting)) { $sorting = (is_array($sortings[$sorting['sort_by']]) ? implode(' ' . $directions[$sorting['sort_order']] . ', ', $sortings[$sorting['sort_by']]) : $sortings[$sorting['sort_by']]) . " " . $directions[$sorting['sort_order']]; } } if ($do_pagination) { if (empty($page)) { $page = 1; } $cnt_list_stats = db_get_field("SELECT COUNT(*) FROM ?:aff_partner_actions as actions WHERE {$condition}"); $limit = fn_paginate($page, $cnt_list_stats); } else { $limit = ''; } $actions = db_get_hash_array("SELECT actions.*, alinks.object_data as parent_action_id, customers.firstname as customer_firstname, customers.lastname as customer_lastname, partners.firstname as partner_firstname, partners.lastname as partner_lastname, ?:common_descriptions.object as plan, ?:common_descriptions.description as plan_description, ?:aff_banners.type as banner_type, ?:aff_banner_descriptions.title as banner FROM ?:aff_partner_actions as actions LEFT JOIN ?:users as customers ON customers.user_id = actions.customer_id LEFT JOIN ?:users as partners ON partners.user_id = actions.partner_id LEFT JOIN ?:common_descriptions ON ?:common_descriptions.object_holder = 'affiliate_plans' AND ?:common_descriptions.object_id = actions.plan_id AND ?:common_descriptions.lang_code = ?s LEFT JOIN ?:aff_banners ON ?:aff_banners.banner_id = actions.banner_id LEFT JOIN ?:aff_banner_descriptions ON ?:aff_banner_descriptions.banner_id = actions.banner_id AND ?:aff_banner_descriptions.lang_code = ?s LEFT JOIN ?:aff_action_links as alinks ON alinks.action_id = actions.action_id AND alinks.object_type = 'A' WHERE ?p ORDER BY {$sorting} {$limit}", 'action_id', $lang_code, $lang_code, $condition); if (!empty($actions)) { $extra_data = array(); foreach ($actions as $action_id => $action_data) { $action_data['data'] = db_get_hash_single_array("SELECT object_data, object_type FROM ?:aff_action_links WHERE action_id = ?i", array('object_type', 'object_data'), $action_id); $actions[$action_id]['data'] = $action_data['data']; if (!empty($action_data['data'])) { if (!empty($actions[$action_id]['data']['P'])) { $actions[$action_id]['data']['product_name'] = fn_get_product_name($actions[$action_id]['data']['P'], $lang_code); } if (!empty($actions[$action_id]['data']['O'])) { $tmp_order = fn_get_order_info($actions[$action_id]['data']['O']); $actions[$action_id]['data']['order_status'] = $tmp_order['status']; } if (!empty($actions[$action_id]['data']['D'])) { $actions[$action_id]['data']['coupon'] = fn_get_promotion_data($actions[$action_id]['data']['D']); } } else { $actions[$action_id]['data'] = array(); } if (!empty($action_data['parent_action_id']) && empty($extra_data[$action_data['parent_action_id']])) { $extra_data[$action_data['parent_action_id']] = db_get_hash_array("SELECT actions.action_id, actions.action, actions.amount, actions.partner_id, alinks.object_data as tier, partners.firstname, partners.lastname FROM ?:aff_partner_actions as actions LEFT JOIN ?:aff_action_links as alinks ON alinks.action_id = actions.action_id AND alinks.object_type = 'L' LEFT JOIN ?:users as partners ON partners.user_id = actions.partner_id WHERE actions.action_id = ?i OR actions.action_id IN(SELECT links.action_id FROM ?:aff_action_links as links WHERE links.object_type = 'A' AND links.object_data = ?i) ORDER BY actions.action_id ASC", 'action_id', $action_data['parent_action_id'], $action_data['parent_action_id']); if (!empty($extra_data[$action_data['parent_action_id']])) { foreach ($extra_data[$action_data['parent_action_id']] as $related_id => $related_data) { $extra_data[$action_data['parent_action_id']][$related_id]['title'] = empty($payout_types[$related_data['action']]['title']) ? '' : fn_get_lang_var($payout_types[$related_data['action']]['title'], $lang_code); } } } if (!empty($extra_data[$action_data['parent_action_id']])) { $actions[$action_id]['extra_data'] = $extra_data[$action_data['parent_action_id']]; } $actions[$action_id]['title'] = empty($payout_types[$action_data['action']]['title']) ? '' : fn_get_lang_var($payout_types[$action_data['action']]['title'], $lang_code); if (!empty($actions[$action_id]['data']['L']) && !empty($actions[$action_id]['title'])) { $_level = strval($actions[$action_id]['data']['L']); $actions[$action_id]['title'] .= ' (' . $_level . ' ' . fn_get_lang_var('tier_account', $lang_code) . ')'; } } } return empty($actions) ? false : $actions; }
function content_55d3125033b7a9_87422872($_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_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('calculate_shipping_cost', 'country', 'select_country', 'state', 'select_state', 'select_state', 'zip_postal_code', 'get_rates', 'select_shipping_method', 'vendor', 'none', 'free_shipping', 'no_shipping_required', 'free_shipping', 'text_no_shipping_methods', 'total', 'select', 'text_no_shipping_methods', 'recalculate_rates', 'select_shipping_method', 'get_rates', 'calculate_shipping_cost', 'country', 'select_country', 'state', 'select_state', 'select_state', 'zip_postal_code', 'get_rates', 'select_shipping_method', 'vendor', 'none', 'free_shipping', 'no_shipping_required', 'free_shipping', 'text_no_shipping_methods', 'total', 'select', 'text_no_shipping_methods', 'recalculate_rates', 'select_shipping_method', 'get_rates')); 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(); ?> <script type="text/javascript"> function fn_calculate_total_shipping() { var $ = Tygh.$; params = []; parents = $('#shipping_estimation'); radio = $('input[type=radio]:checked', parents); $.each(radio, function(id, elm) { params.push({name: elm.name, value: elm.value}); }); params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_country').val()}); params.push({name: $('#elm_state').prop('name'), value: $('#elm_state').val()}); params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_zipcode').val()}); url = fn_url('checkout.shipping_estimation'); for (i in params) { url += '&' + params[i]['name'] + '=' + encodeURIComponent(params[i]['value']); } $.ceAjax('request', url, { result_ids: 'shipping_estimation', method: 'post' }); } </script> <?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> <?php $_smarty_tpl->tpl_vars["prefix"] = new Smarty_variable("sidebox_", null, 0); } if ($_smarty_tpl->tpl_vars['location']->value == "popup") { ?> <?php $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("hidden", null, 0); } else { ?> <?php $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("buttons-container", null, 0); } if ($_smarty_tpl->tpl_vars['additional_id']->value) { ?> <?php $_smarty_tpl->tpl_vars["class_suffix"] = new Smarty_variable("-" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0); ?> <?php $_smarty_tpl->tpl_vars["id_suffix"] = new Smarty_variable("_" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0); } ?> <?php if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") { ?> <div id="est_box<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div class="ty-estimation-box"> <h3 class="ty-subheader"><?php echo $_smarty_tpl->__("calculate_shipping_cost"); ?> </h3> <?php } ?> <div id="shipping_estimation<?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> _sidebox<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->tpl_vars['states'] = new Smarty_variable(fn_get_all_states(1), null, 0); ?> <?php if (!Smarty::$_smarty_vars['capture']['states_built']) { ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('states' => $_smarty_tpl->tpl_vars['states']->value), 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("states_built", null, null); ob_start(); ?> Y<?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 } ?> <form class="cm-ajax" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> estimation_form<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post"> <?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> <input type="hidden" name="location" value="sidebox" /><?php } ?> <?php if ($_smarty_tpl->tpl_vars['additional_id']->value) { ?> <input type="hidden" name="additional_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['additional_id']->value, ENT_QUOTES, 'UTF-8'); ?> " /><?php } ?> <input type="hidden" name="result_ids" value="shipping_estimation<?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> _sidebox<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> ,shipping_estimation_buttons" /> <div class="ty-control-group"> <label class="ty-control-group__label" for="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_country<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("country"); ?> </label> <select id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_country<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-country cm-location-estimation<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> ty-input-text-medium" name="customer_location[country]"> <option value="">- <?php echo $_smarty_tpl->__("select_country"); ?> -</option> <?php $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(1), null, 0); ?> <?php $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["country"]->_loop = false; $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['countries']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) { $_smarty_tpl->tpl_vars["country"]->_loop = true; $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] == $_smarty_tpl->tpl_vars['code']->value || !$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] && $_smarty_tpl->tpl_vars['code']->value == $_smarty_tpl->tpl_vars['settings']->value['General']['default_country']) { ?> selected="selected"<?php } ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8'); ?> </option> <?php } ?> </select> </div> <?php $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_state'], null, 0); ?> <?php if (fn_is_empty($_smarty_tpl->tpl_vars['_state']->value)) { ?> <?php $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['General']['default_state'], null, 0); ?> <?php } ?> <div class="ty-control-group"> <label class="ty-control-group__label" for="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_state<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("state"); ?> </label> <select class="cm-state cm-location-estimation<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> <?php if (!$_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) { ?> hidden<?php } ?> ty-input-text-medium" id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_state<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " name="customer_location[state]"> <option value="">- <?php echo $_smarty_tpl->__("select_state"); ?> -</option> <?php $_smarty_tpl->tpl_vars['state'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['state']->_loop = false; $_from = $_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['state']->key => $_smarty_tpl->tpl_vars['state']->value) { $_smarty_tpl->tpl_vars['state']->_loop = true; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['code'], ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['state']->value['code'] == $_smarty_tpl->tpl_vars['_state']->value) { ?> selected="selected"<?php } ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['state'], ENT_QUOTES, 'UTF-8'); ?> </option> <?php } if (!$_smarty_tpl->tpl_vars['state']->_loop) { ?> <option label="" value="">- <?php echo $_smarty_tpl->__("select_state"); ?> -</option> <?php } ?> </select> <input type="text" class="cm-state cm-location-estimation<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> ty-input-text-medium <?php if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) { ?> hidden<?php } ?> " id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_state<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> _d" name="customer_location[state]" size="20" maxlength="64" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_state']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) { ?> disabled="disabled"<?php } ?> /> </div> <div class="ty-control-group"> <label class="ty-control-group__label" for="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_zipcode<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("zip_postal_code"); ?> </label> <input type="text" class="ty-input-text-medium" id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_zipcode<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " name="customer_location[zipcode]" size="20" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_zipcode'], ENT_QUOTES, 'UTF-8'); ?> " /> </div> <div class="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, 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' => __("get_rates"), 'but_name' => "dispatch[checkout.shipping_estimation]", 'but_role' => "text", 'but_id' => "but_get_rates"), 0); ?> </div> </form> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") { ?> <?php if (!$_smarty_tpl->tpl_vars['cart']->value['shipping_failed'] && !$_smarty_tpl->tpl_vars['cart']->value['company_shipping_failed']) { ?> <?php if ($_smarty_tpl->tpl_vars['location']->value == "popup") { ?> <div class="ty-estimation__title"><?php echo $_smarty_tpl->__("select_shipping_method"); ?> </div> <?php } ?> <form class="cm-ajax" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> select_shipping_form<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post"> <input type="hidden" name="redirect_mode" value="cart" /> <input type="hidden" name="result_ids" value="checkout_totals" /> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group']->_loop = false; $_smarty_tpl->tpl_vars['group_key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['product_groups']->value; 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_key']->value = $_smarty_tpl->tpl_vars['group']->key; ?> <p> <strong><?php echo $_smarty_tpl->__("vendor"); ?> : </strong><?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['group']->value['name']) === null || $tmp === '' ? $_smarty_tpl->__("none") : $tmp, ENT_QUOTES, 'UTF-8'); ?> </p> <?php if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) { ?> <ul> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['products']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; ?> <li> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php echo $_smarty_tpl->tpl_vars['product']->value['product']; ?> <?php } else { ?> <?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> <?php } ?> </li> <?php } ?> </ul> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <?php $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["shipping"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['shippings']; 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; ?> <?php if ($_smarty_tpl->tpl_vars['cart']->value['chosen_shipping'][$_smarty_tpl->tpl_vars['group_key']->value] == $_smarty_tpl->tpl_vars['shipping']->value['shipping_id']) { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable("checked=\"checked\"", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['delivery_time']) { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable("(" . (string) $_smarty_tpl->tpl_vars['shipping']->value['delivery_time'] . ")", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation_method")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "rate", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['rate']), 0); 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['shipping']->value['inc_tax']) { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (", null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] && $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] != $_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "tax", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'], 'class' => "ty-nowrap"), 0); 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->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (" . (string) $_smarty_tpl->tpl_vars['tax']->value . " ", null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["inc_tax_lang"] = new Smarty_variable($_smarty_tpl->__('inc_tax'), null, 0); ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . (string) $_smarty_tpl->tpl_vars['inc_tax_lang']->value . ")", null, 0); ?> <?php } ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable($_smarty_tpl->__("free_shipping"), null, 0); ?> <?php } ?> <p> <input type="radio" class="ty-valign" id="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " name="shipping_ids[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " onclick="fn_calculate_total_shipping();" <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['checked']->value, ENT_QUOTES, 'UTF-8'); ?> /><label for="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="ty-valign"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; ?> </label> </p> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <p><?php echo $_smarty_tpl->__("no_shipping_required"); ?> </p> <?php } elseif ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['free_shipping']) { ?> <p><?php echo $_smarty_tpl->__("free_shipping"); ?> </p> <?php } else { ?> <p><?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> </p> <?php } ?> <?php } ?> <?php } ?> <p><strong><?php echo $_smarty_tpl->__("total"); ?> :</strong> <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['cart']->value['display_shipping_cost'], 'class' => "ty-price"), 0); ?> </p> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <div class="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, 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' => __("select"), 'but_role' => "text", 'but_name' => "dispatch[checkout.update_shipping]", 'but_id' => "but_select_shipping", 'but_meta' => "cm-dialog-closer"), 0); ?> </div> </form> <?php } else { ?> <p class="ty-error-text"> <?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> </p> <?php } ?> <?php } ?> <!--shipping_estimation<?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> _sidebox<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") { ?> </div> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['location']->value == "popup") { ?> <div class="ty-estimation-buttons buttons-container" id="shipping_estimation_buttons"> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("recalculate_rates"), 'but_external_click_id' => "but_get_rates", 'but_role' => "text", 'but_meta' => "ty-btn__secondary cm-external-click ty-float-right ty-estimation-buttons__rate"), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("select_shipping_method"), 'but_external_click_id' => "but_select_shipping", 'but_meta' => "ty-btn__secondary cm-external-click cm-dialog-closer"), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("get_rates"), 'but_external_click_id' => "but_get_rates", 'but_meta' => "ty-btn__secondary cm-external-click"), 0); ?> <?php } ?> <!--shipping_estimation_buttons--></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/checkout/components/shipping_estimation.tpl" id="<?php echo smarty_function_set_id(array('name' => "views/checkout/components/shipping_estimation.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 { ?> <script type="text/javascript"> function fn_calculate_total_shipping() { var $ = Tygh.$; params = []; parents = $('#shipping_estimation'); radio = $('input[type=radio]:checked', parents); $.each(radio, function(id, elm) { params.push({name: elm.name, value: elm.value}); }); params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_country').val()}); params.push({name: $('#elm_state').prop('name'), value: $('#elm_state').val()}); params.push({name: $('#elm_zipcode').prop('name'), value: $('#elm_zipcode').val()}); url = fn_url('checkout.shipping_estimation'); for (i in params) { url += '&' + params[i]['name'] + '=' + encodeURIComponent(params[i]['value']); } $.ceAjax('request', url, { result_ids: 'shipping_estimation', method: 'post' }); } </script> <?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> <?php $_smarty_tpl->tpl_vars["prefix"] = new Smarty_variable("sidebox_", null, 0); } if ($_smarty_tpl->tpl_vars['location']->value == "popup") { ?> <?php $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("hidden", null, 0); } else { ?> <?php $_smarty_tpl->tpl_vars["buttons_class"] = new Smarty_variable("buttons-container", null, 0); } if ($_smarty_tpl->tpl_vars['additional_id']->value) { ?> <?php $_smarty_tpl->tpl_vars["class_suffix"] = new Smarty_variable("-" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0); ?> <?php $_smarty_tpl->tpl_vars["id_suffix"] = new Smarty_variable("_" . (string) $_smarty_tpl->tpl_vars['additional_id']->value, null, 0); } ?> <?php if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") { ?> <div id="est_box<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "> <div class="ty-estimation-box"> <h3 class="ty-subheader"><?php echo $_smarty_tpl->__("calculate_shipping_cost"); ?> </h3> <?php } ?> <div id="shipping_estimation<?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> _sidebox<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "> <?php $_smarty_tpl->tpl_vars['states'] = new Smarty_variable(fn_get_all_states(1), null, 0); ?> <?php if (!Smarty::$_smarty_vars['capture']['states_built']) { ?> <?php echo $_smarty_tpl->getSubTemplate("views/profiles/components/profiles_scripts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('states' => $_smarty_tpl->tpl_vars['states']->value), 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("states_built", null, null); ob_start(); ?> Y<?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 } ?> <form class="cm-ajax" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> estimation_form<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post"> <?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> <input type="hidden" name="location" value="sidebox" /><?php } ?> <?php if ($_smarty_tpl->tpl_vars['additional_id']->value) { ?> <input type="hidden" name="additional_id" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['additional_id']->value, ENT_QUOTES, 'UTF-8'); ?> " /><?php } ?> <input type="hidden" name="result_ids" value="shipping_estimation<?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> _sidebox<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> ,shipping_estimation_buttons" /> <div class="ty-control-group"> <label class="ty-control-group__label" for="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_country<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("country"); ?> </label> <select id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_country<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " class="cm-country cm-location-estimation<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> ty-input-text-medium" name="customer_location[country]"> <option value="">- <?php echo $_smarty_tpl->__("select_country"); ?> -</option> <?php $_smarty_tpl->tpl_vars["countries"] = new Smarty_variable(fn_get_simple_countries(1), null, 0); ?> <?php $_smarty_tpl->tpl_vars["country"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["country"]->_loop = false; $_smarty_tpl->tpl_vars["code"] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['countries']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["country"]->key => $_smarty_tpl->tpl_vars["country"]->value) { $_smarty_tpl->tpl_vars["country"]->_loop = true; $_smarty_tpl->tpl_vars["code"]->value = $_smarty_tpl->tpl_vars["country"]->key; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['code']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] == $_smarty_tpl->tpl_vars['code']->value || !$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country'] && $_smarty_tpl->tpl_vars['code']->value == $_smarty_tpl->tpl_vars['settings']->value['General']['default_country']) { ?> selected="selected"<?php } ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['country']->value, ENT_QUOTES, 'UTF-8'); ?> </option> <?php } ?> </select> </div> <?php $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_state'], null, 0); ?> <?php if (fn_is_empty($_smarty_tpl->tpl_vars['_state']->value)) { ?> <?php $_smarty_tpl->tpl_vars['_state'] = new Smarty_variable($_smarty_tpl->tpl_vars['settings']->value['General']['default_state'], null, 0); ?> <?php } ?> <div class="ty-control-group"> <label class="ty-control-group__label" for="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_state<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("state"); ?> </label> <select class="cm-state cm-location-estimation<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> <?php if (!$_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) { ?> hidden<?php } ?> ty-input-text-medium" id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_state<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " name="customer_location[state]"> <option value="">- <?php echo $_smarty_tpl->__("select_state"); ?> -</option> <?php $_smarty_tpl->tpl_vars['state'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['state']->_loop = false; $_from = $_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['state']->key => $_smarty_tpl->tpl_vars['state']->value) { $_smarty_tpl->tpl_vars['state']->_loop = true; ?> <option value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['code'], ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['state']->value['code'] == $_smarty_tpl->tpl_vars['_state']->value) { ?> selected="selected"<?php } ?> ><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['state'], ENT_QUOTES, 'UTF-8'); ?> </option> <?php } if (!$_smarty_tpl->tpl_vars['state']->_loop) { ?> <option label="" value="">- <?php echo $_smarty_tpl->__("select_state"); ?> -</option> <?php } ?> </select> <input type="text" class="cm-state cm-location-estimation<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['class_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> ty-input-text-medium <?php if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) { ?> hidden<?php } ?> " id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_state<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> _d" name="customer_location[state]" size="20" maxlength="64" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['_state']->value, ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['states']->value[$_smarty_tpl->tpl_vars['cart']->value['user_data']['s_country']]) { ?> disabled="disabled"<?php } ?> /> </div> <div class="ty-control-group"> <label class="ty-control-group__label" for="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_zipcode<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> "><?php echo $_smarty_tpl->__("zip_postal_code"); ?> </label> <input type="text" class="ty-input-text-medium" id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> elm_zipcode<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " name="customer_location[zipcode]" size="20" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['cart']->value['user_data']['s_zipcode'], ENT_QUOTES, 'UTF-8'); ?> " /> </div> <div class="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, 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' => __("get_rates"), 'but_name' => "dispatch[checkout.shipping_estimation]", 'but_role' => "text", 'but_id' => "but_get_rates"), 0); ?> </div> </form> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") { ?> <?php if (!$_smarty_tpl->tpl_vars['cart']->value['shipping_failed'] && !$_smarty_tpl->tpl_vars['cart']->value['company_shipping_failed']) { ?> <?php if ($_smarty_tpl->tpl_vars['location']->value == "popup") { ?> <div class="ty-estimation__title"><?php echo $_smarty_tpl->__("select_shipping_method"); ?> </div> <?php } ?> <form class="cm-ajax" name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> select_shipping_form<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> " action="<?php echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8'); ?> " method="post"> <input type="hidden" name="redirect_mode" value="cart" /> <input type="hidden" name="result_ids" value="checkout_totals" /> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group']->_loop = false; $_smarty_tpl->tpl_vars['group_key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['product_groups']->value; 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_key']->value = $_smarty_tpl->tpl_vars['group']->key; ?> <p> <strong><?php echo $_smarty_tpl->__("vendor"); ?> : </strong><?php echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['group']->value['name']) === null || $tmp === '' ? $_smarty_tpl->__("none") : $tmp, ENT_QUOTES, 'UTF-8'); ?> </p> <?php if (!fn_allowed_for("ULTIMATE") || count($_smarty_tpl->tpl_vars['product_groups']->value) > 1) { ?> <ul> <?php $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["product"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['products']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) { $_smarty_tpl->tpl_vars["product"]->_loop = true; ?> <li> <?php if ($_smarty_tpl->tpl_vars['product']->value['product']) { ?> <?php echo $_smarty_tpl->tpl_vars['product']->value['product']; ?> <?php } else { ?> <?php echo htmlspecialchars(fn_get_product_name($_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8'); ?> <?php } ?> </li> <?php } ?> </ul> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['shippings'] && !$_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['free_shipping'] && !$_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <?php $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["shipping"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['group']->value['shippings']; 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; ?> <?php if ($_smarty_tpl->tpl_vars['cart']->value['chosen_shipping'][$_smarty_tpl->tpl_vars['group_key']->value] == $_smarty_tpl->tpl_vars['shipping']->value['shipping_id']) { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable("checked=\"checked\"", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["checked"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['delivery_time']) { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable("(" . (string) $_smarty_tpl->tpl_vars['shipping']->value['delivery_time'] . ")", null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["delivery_time"] = new Smarty_variable('', null, 0); ?> <?php } ?> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "checkout:shipping_estimation_method")); $_block_repeat = true; echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "rate", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['rate']), 0); 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['shipping']->value['inc_tax']) { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (", null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] && $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'] != $_smarty_tpl->tpl_vars['shipping']->value['rate']) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array('default', "tax", null); ob_start(); echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['shipping']->value['taxed_price'], 'class' => "ty-nowrap"), 0); 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->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . " (" . (string) $_smarty_tpl->tpl_vars['tax']->value . " ", null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["inc_tax_lang"] = new Smarty_variable($_smarty_tpl->__('inc_tax'), null, 0); ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['rate']->value . (string) $_smarty_tpl->tpl_vars['inc_tax_lang']->value . ")", null, 0); ?> <?php } ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["rate"] = new Smarty_variable($_smarty_tpl->__("free_shipping"), null, 0); ?> <?php } ?> <p> <input type="radio" class="ty-valign" id="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " name="shipping_ids[<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> ]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " onclick="fn_calculate_total_shipping();" <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['checked']->value, ENT_QUOTES, 'UTF-8'); ?> /><label for="sh_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['group_key']->value, ENT_QUOTES, 'UTF-8'); ?> _<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="ty-valign"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['delivery_time']->value, ENT_QUOTES, 'UTF-8'); ?> - <?php echo $_smarty_tpl->tpl_vars['rate']->value; ?> </label> </p> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_estimation_method"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <?php } ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['group']->value['all_edp_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['shipping_no_required']) { ?> <p><?php echo $_smarty_tpl->__("no_shipping_required"); ?> </p> <?php } elseif ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping'] || $_smarty_tpl->tpl_vars['group']->value['free_shipping']) { ?> <p><?php echo $_smarty_tpl->__("free_shipping"); ?> </p> <?php } else { ?> <p><?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> </p> <?php } ?> <?php } ?> <?php } ?> <p><strong><?php echo $_smarty_tpl->__("total"); ?> :</strong> <?php echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['cart']->value['display_shipping_cost'], 'class' => "ty-price"), 0); ?> </p> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "checkout:shipping_estimation"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> <div class="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['buttons_class']->value, 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' => __("select"), 'but_role' => "text", 'but_name' => "dispatch[checkout.update_shipping]", 'but_id' => "but_select_shipping", 'but_meta' => "cm-dialog-closer"), 0); ?> </div> </form> <?php } else { ?> <p class="ty-error-text"> <?php echo $_smarty_tpl->__("text_no_shipping_methods"); ?> </p> <?php } ?> <?php } ?> <!--shipping_estimation<?php if ($_smarty_tpl->tpl_vars['location']->value == "sidebox") { ?> _sidebox<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['id_suffix']->value, ENT_QUOTES, 'UTF-8'); ?> --></div> <?php if ($_smarty_tpl->tpl_vars['location']->value != "sidebox" && $_smarty_tpl->tpl_vars['location']->value != "popup") { ?> </div> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['location']->value == "popup") { ?> <div class="ty-estimation-buttons buttons-container" id="shipping_estimation_buttons"> <?php if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "shipping_estimation" || $_REQUEST['show_shippings'] == "Y") { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("recalculate_rates"), 'but_external_click_id' => "but_get_rates", 'but_role' => "text", 'but_meta' => "ty-btn__secondary cm-external-click ty-float-right ty-estimation-buttons__rate"), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("select_shipping_method"), 'but_external_click_id' => "but_select_shipping", 'but_meta' => "ty-btn__secondary cm-external-click cm-dialog-closer"), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("get_rates"), 'but_external_click_id' => "but_get_rates", 'but_meta' => "ty-btn__secondary cm-external-click"), 0); ?> <?php } ?> <!--shipping_estimation_buttons--></div> <?php } } }
$banner['type'] = 'T'; $banner['link_to'] = 'U'; $banner['url'] = Registry::get('config.http_location'); } } if (!empty($banner['link_to']) && $banner['type'] != 'P') { $link_to = $banner['link_to']; $data =& $banner; if ($link_to == 'G' && !empty($banner['group_id'])) { $group = fn_get_group_data($banner['group_id'], true); if (empty($group) || $group['status'] == 'D') { return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.http_location') . '/' . Registry::get('config.customer_index')); } $link_to = @$group['link_to']; if (!empty($group['product_ids'])) { $group['products'] = fn_get_product_name($group['product_ids']); } $data =& $group; } elseif ($link_to == 'G' && empty($banner['group_id'])) { return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.http_location') . '/' . Registry::get('config.customer_index')); } if ($link_to == 'U') { $redirect_url = empty($data['url']) ? '' : $data['url']; } elseif ($link_to == 'P') { if (empty($data['products'])) { $data['products'] = array(); } if (count($data['products']) == 1) { $redirect_url = "products.view?product_id=" . key($data['products']); } $not_redirect = 'Y';
function fn_rma_get_order_info(&$order, &$additional_data) { if (!empty($order)) { $status_data = fn_get_status_params($order['status'], STATUSES_ORDER); if (!empty($status_data) && (!empty($status_data['allow_return']) && $status_data['allow_return'] == 'Y') && isset($additional_data[ORDER_DATA_PRODUCTS_DELIVERY_DATE])) { $order_returnable_products = fn_get_order_returnable_products($order['products'], $additional_data[ORDER_DATA_PRODUCTS_DELIVERY_DATE]); if (!empty($order_returnable_products['items'])) { $order['allow_return'] = 'Y'; } if (!empty($order_returnable_products['item_returns_info'])) { foreach ($order_returnable_products['item_returns_info'] as $item_id => $returns_info) { $order['products'][$item_id]['returns_info'] = $returns_info; } } } if (!empty($additional_data[ORDER_DATA_PRODUCTS_DELIVERY_DATE])) { $order['products_delivery_date'] = $additional_data[ORDER_DATA_PRODUCTS_DELIVERY_DATE]; } if (!empty($additional_data[ORDER_DATA_RETURN])) { $order_return_info = @unserialize($additional_data[ORDER_DATA_RETURN]); $order['return'] = @$order_return_info['return']; $order['returned_products'] = @$order_return_info['returned_products']; foreach ((array) $order['returned_products'] as $k => $v) { $v['product'] = !empty($v['extra']['product']) ? $v['extra']['product'] : fn_get_product_name($v['product_id'], CART_LANGUAGE); if (empty($v['product'])) { $v['product'] = strtoupper(__('deleted_product')); } $v['discount'] = !empty($v['extra']['discount']) && floatval($v['extra']['discount']) ? $v['extra']['discount'] : 0; if (!empty($v['extra']['product_options_value'])) { $v['product_options'] = $v['extra']['product_options_value']; } $v['subtotal'] = $v['price'] * $v['amount'] - $v['discount']; $order['returned_products'][$k] = $v; } } if (0 < ($returns_count = db_get_field("SELECT COUNT(*) FROM ?:rma_returns WHERE order_id = ?i", $order['order_id']))) { $order['isset_returns'] = 'Y'; } } }
function fn_recurring_billing_buy_together_restricted_product($product_id, $auth, $is_restricted, $show_notification) { if ($is_restricted) { return true; } $plan = db_get_row("SELECT plan_id, duration FROM ?:recurring_plans WHERE status = 'A' AND FIND_IN_SET(?i, product_ids)", $product_id); if (!empty($plan)) { $is_restricted = true; } if ($is_restricted && $show_notification) { $product_name = fn_get_product_name($product_id); fn_set_notification('E', fn_get_lang_var('error'), str_replace('[product_name]', $product_name, fn_get_lang_var('buy_together_is_not_compatible_with_recurring_billing'))); } }