function modePayment() { $rid = $_REQUEST['order_id']; $orderId = $_SESSION['pw_order_id']; $iframe = ''; $matchOrder = $rid == $orderId; $orderInfo = fn_get_order_info($orderId); if ($matchOrder && $orderInfo) { // Prepare Widget $iframe = fn_paymentwall_generateWidget($orderInfo, fn_paymentwall_getPaymentConfigs($orderInfo['payment_id'])); } fn_add_breadcrumb('Paymentwall Payment', '#', true); Tygh::$app['view']->assign('params', array('matchOrder' => $matchOrder, 'orderId' => $orderId, 'baseUrl' => fn_url(), 'iframe' => $iframe)); }
if (fn_request_usergroup($auth['user_id'], $_REQUEST['usergroup_id'], $_REQUEST['type'])) { $user_data = fn_get_user_info($auth['user_id']); Mailer::sendMail(array('to' => 'default_company_users_department', 'from' => 'default_company_users_department', 'reply_to' => $user_data['email'], 'data' => array('user_data' => $user_data, 'usergroups' => fn_get_usergroups('F', Registry::get('settings.Appearance.backend_default_language')), 'usergroup_id' => $_REQUEST['usergroup_id']), 'tpl' => 'profiles/usergroup_request.tpl', 'company_id' => $user_data['company_id']), 'A', Registry::get('settings.Appearance.backend_default_language')); } return array(CONTROLLER_STATUS_OK, "profiles.update"); } elseif ($mode == 'success_add') { if (empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, "profiles.add"); } fn_add_breadcrumb(__('registration')); } elseif ($mode == "profile_home_page") { if (empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, "auth.login_form?return_url=" . urlencode(Registry::get('config.current_url'))); } $profile_id = empty($_REQUEST['profile_id']) ? 0 : $_REQUEST['profile_id']; fn_add_breadcrumb(__('profile_home')); if (!empty($_REQUEST['profile']) && $_REQUEST['profile'] == 'new') { $user_data = fn_get_user_info($auth['user_id'], false); } else { $user_data = fn_get_user_info($auth['user_id'], true, $profile_id); } if (empty($user_data)) { return array(CONTROLLER_STATUS_NO_PAGE); } $restored_user_data = fn_restore_post_data('user_data'); if ($restored_user_data) { $user_data = fn_array_merge($user_data, $restored_user_data); } Registry::set('navigation.tabs.general', array('title' => __('general'), 'js' => true)); $show_usergroups = true; if (Registry::get('settings.General.allow_usergroup_signup') != 'Y') {
} elseif ($mode == 'on_sale') { $title = __("on_sale"); $params['on_sale'] = true; } elseif ($mode == 'bestsellers') { $title = __("bestsellers"); $params['bestsellers'] = true; $params['sales_amount_from'] = Registry::get('addons.bestsellers.sales_amount_from'); } elseif ($mode == 'newest') { $title = __("newest"); $params['sort_by'] = empty($params['sort_by']) ? 'timestamp' : $params['sort_by']; $params['plain'] = true; $params['visible'] = true; $period = Registry::get('addons.bestsellers.period'); $params['period'] = 'A'; if ($period == 'today') { $params['period'] = 'D'; } elseif ($period == 'last_days') { $params['period'] = 'HC'; $params['last_days'] = Registry::get('addons.bestsellers.last_days'); } } else { $title = __('products'); } fn_add_breadcrumb($title); list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page')); fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_options' => true)); $selected_layout = fn_get_products_layout($params); Registry::get('view')->assign('products', $products); Registry::get('view')->assign('search', $search); Registry::get('view')->assign('selected_layout', $selected_layout); }
if ($mode == 'login_form') { if (defined('AJAX_REQUEST') && empty($auth)) { exit; } if (!empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, $index_script); } fn_add_breadcrumb(fn_get_lang_var('my_account')); } elseif ($mode == 'password_change' && AREA == 'A') { if (defined('AJAX_REQUEST') && empty($auth)) { exit; } if (empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, $index_script); } fn_add_breadcrumb(fn_get_lang_var('my_account')); $profile_id = 0; $user_data = fn_get_user_info($auth['user_id'], true, $profile_id); $view->assign('user_data', $user_data); $view->assign('view_mode', 'simple'); } elseif ($mode == 'change_login') { $auth = $_SESSION['auth']; if (!empty($auth['user_id'])) { // Log user logout fn_log_event('users', 'session', array('user_id' => $auth['user_id'], 'time' => TIME - $auth['this_login'], 'timeout' => false)); } unset($_SESSION['auth'], $_SESSION['cart']['user_data']); fn_delete_cookies(AREA_NAME . '_user_id', AREA_NAME . '_password'); return array(CONTROLLER_STATUS_OK, fn_url('checkout.checkout')); } function fn_auth_routines($request)
$allowed_id = db_get_field("SELECT user_id FROM ?:orders WHERE user_id = ?i AND order_id = ?i", $auth['user_id'], $_REQUEST['order_id']); } fn_set_hook('is_order_allowed', $_REQUEST['order_id'], $allowed_id); if (empty($allowed_id)) { // Access denied return array(CONTROLLER_STATUS_DENIED); } $order_info = fn_get_order_info($_REQUEST['order_id']); if (!empty($order_info['is_parent_order']) && $order_info['is_parent_order'] == 'Y') { $order_info['child_ids'] = implode(',', db_get_fields("SELECT order_id FROM ?:orders WHERE parent_order_id = ?i", $_REQUEST['order_id'])); } if (!empty($order_info)) { Tygh::$app['view']->assign('order_info', $order_info); } } fn_add_breadcrumb(__('landing_header')); } elseif ($mode == 'process_payment') { if (fn_allow_place_order($cart, $auth) == true) { $order_info = $cart; $order_info['products'] = $cart['products']; $order_info = fn_array_merge($order_info, $cart['user_data']); $order_info['order_id'] = $order_id = TIME . "_" . (!empty($auth['user_id']) ? $auth['user_id'] : 0); unset($order_info['user_data']); list($is_processor_script, $processor_data) = fn_check_processor_script($order_info['payment_id']); if ($is_processor_script) { set_time_limit(300); fn_define('IFRAME_MODE', true); include Registry::get('config.dir.payments') . $processor_data['processor_script']; fn_finish_payment($order_id, $pp_response, array()); fn_order_placement_routines('route', $order_id); }
} if (AREA != 'A') { fn_add_breadcrumb(__('hybrid_auth.connect_social')); } $user_id = fn_is_user_exists(0, array('email' => $email)); if (!empty($user_id)) { $user_data = fn_get_user_short_info($user_id); $user_login = $user_data['email']; } else { $user_login = ''; } Tygh::$app['view']->assign('user_login', $user_login); Tygh::$app['view']->assign('identifier', $identifier); Tygh::$app['view']->assign('view_mode', 'simple'); } elseif ($mode == 'specify_email') { if (!empty($_REQUEST['user_email'])) { fn_hybrid_auth_process('login_provider', $redirect_url); $_REQUEST['redirect_url'] = $redirect_url; return array(CONTROLLER_STATUS_REDIRECT, fn_url($redirect_url)); } $identifier = !empty($_SESSION['hybrid_auth']['identifier']) ? $_SESSION['hybrid_auth']['identifier'] : ''; $provider = !empty($_SESSION['hybrid_auth']['provider']) ? $_SESSION['hybrid_auth']['provider'] : ''; $redirect_url = !empty($_SESSION['hybrid_auth']['redirect_url']) ? $_SESSION['hybrid_auth']['redirect_url'] : fn_url(); if (AREA != 'A') { fn_add_breadcrumb(__('hybrid_auth.specify_email')); } Tygh::$app['view']->assign('identifier', $identifier); Tygh::$app['view']->assign('provider', $provider); Tygh::$app['view']->assign('redirect_url', $redirect_url); Tygh::$app['view']->assign('view_mode', 'simple'); }
Tygh::$app['view']->assign('search', $search); Tygh::$app['view']->assign('selected_layout', $selected_layout); Tygh::$app['view']->assign('category_data', $category_data); // If page title for this category is exist than assign it to template if (!empty($category_data['page_title'])) { Tygh::$app['view']->assign('page_title', $category_data['page_title']); } // [Breadcrumbs] if (!empty($category_parent_ids)) { Registry::set('runtime.active_category_ids', $category_parent_ids); $cats = fn_get_category_name($category_parent_ids); foreach ($category_parent_ids as $c_id) { fn_add_breadcrumb($cats[$c_id], "categories.view?category_id={$c_id}"); } } fn_add_breadcrumb($category_data['category'], empty($_REQUEST['features_hash']) ? '' : "categories.view?category_id={$_REQUEST['category_id']}"); // [/Breadcrumbs] } else { return array(CONTROLLER_STATUS_NO_PAGE); } } elseif ($mode == 'picker') { $category_count = db_get_field("SELECT COUNT(*) FROM ?:categories"); if ($category_count < CATEGORY_THRESHOLD) { $params = array('simple' => false); list($categories_tree, ) = fn_get_categories($params); Tygh::$app['view']->assign('show_all', true); } else { $params = array('category_id' => $_REQUEST['category_id'], 'current_category_id' => $_REQUEST['category_id'], 'visible' => true, 'simple' => false); list($categories_tree, ) = fn_get_categories($params); } if (!empty($_REQUEST['root'])) {
} Tygh::$app['view']->assign('verify_data', $verify_data); } else { fn_set_notification('W', __('warning'), __('error_gift_cert_code')); if (defined('AJAX_REQUEST')) { exit; } } } elseif ($mode == 'add') { fn_add_breadcrumb(__('gift_certificates')); Tygh::$app['view']->assign('templates', fn_get_gift_certificate_templates()); Tygh::$app['view']->assign('states', fn_get_all_states()); Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE)); } elseif ($mode == 'update') { if (!empty($_REQUEST['gift_cert_id']) && !isset($_SESSION['cart']['gift_certificates'][$_REQUEST['gift_cert_id']])) { return array(CONTROLLER_STATUS_REDIRECT, 'gift_certificates.add'); } fn_add_breadcrumb(__('gift_certificates')); if (!empty($_REQUEST['gift_cert_id'])) { $gift_cert_data = fn_get_gift_certificate_info($_REQUEST['gift_cert_id'], 'C'); if (!empty($gift_cert_data['extra']['exclude_from_calculate'])) { return array(CONTROLLER_STATUS_NO_PAGE); } Tygh::$app['view']->assign('gift_cert_data', $gift_cert_data); Tygh::$app['view']->assign('gift_cert_id', $_REQUEST['gift_cert_id']); } Tygh::$app['view']->assign('templates', fn_get_gift_certificate_templates()); Tygh::$app['view']->assign('states', fn_get_all_states()); Tygh::$app['view']->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE)); Tygh::$app['view']->assign('type', 'C'); }
// // Check if store is closed // if (Registry::get('settings.store_mode') == 'closed') { if (!empty($_REQUEST['store_access_key'])) { $_SESSION['store_access_key'] = $_GET['store_access_key']; } var_dump($_SESSION['store_access_key']); if (empty($_SESSION['store_access_key']) || $_SESSION['store_access_key'] != Registry::get('settings.General.store_access_key')) { return array(CONTROLLER_STATUS_REDIRECT, Registry::get('config.current_location') . '/store_closed.html'); } } if (empty($_REQUEST['product_id']) && empty($_REQUEST['category_id'])) { unset($_SESSION['current_category_id']); } fn_add_breadcrumb(fn_get_lang_var('home'), $index_script); $request_params = $_REQUEST; $request_params['location'] = fn_get_blocks_location(CONTROLLER); list($blocks) = fn_get_blocks($request_params); $view->assign('blocks', $blocks); $view->assign('location_data', fn_get_location_data($request_params['location'], true)); // Get quick links Registry::register_cache('quick_links', array('static_data'), CACHE_LEVEL_LOCALE); if (Registry::is_exist('quick_links') == false) { Registry::set('quick_links', fn_get_static_data_section('N')); } // Get top menu Registry::register_cache('top_menu', array('static_data', 'categories', 'pages'), CACHE_LEVEL_LOCALE_AUTH); if (Registry::is_exist('top_menu') == false) { Registry::set('top_menu', fn_top_menu_form(fn_get_static_data_section('A', true))); }
**************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { define('FORCE_SESSION_START', true); //it will be merged with the $_REQUEST later $_GET['dispatch'] = 'checkout.cresecure_template'; require './init_payment.php'; require Registry::get('config.dir.root') . '/app/controllers/frontend/init.php'; Tygh::$app['view']->assign('display_base_href', true); //We should assign this information to display in the default checkout blocks (Order summary and Products in your order) Tygh::$app['view']->assign('cart', Tygh::$app['session']['cart']); Tygh::$app['view']->assign('cart_products', Tygh::$app['session']['cart']['products']); fn_add_breadcrumb(__('payment_information')); Tygh::$app['view']->assign('content_tpl', 'views/orders/processors/cresecure.tpl'); Tygh::$app['view']->display(Registry::get('runtime.root_template')); } else { if (defined('PAYMENT_NOTIFICATION')) { if ($mode == 'return') { //NOTE: do not remove intval() ! $order_id = intval($_REQUEST['order_id']); $pp_response = array(); $payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id=?i", $order_id); $processor_data = fn_get_processor_data($payment_id); if (empty($_REQUEST['error']) && !empty($_REQUEST['msg']) && ($_REQUEST['msg'] == 'Success' || $_REQUEST['msg'] == 'Approved')) { $pp_response['order_status'] = 'P'; $pp_response['reason_text'] = $_REQUEST['msg']; $pp_response['transaction_id'] = $_REQUEST['TxnGUID']; $pp_response['card_number'] = $_REQUEST['mPAN'];
Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'products' => array('title' => fn_get_lang_var('products'), 'js' => true))); list($steps) = fn_get_configurator_steps($_REQUEST); $view->assign('steps', $steps); } elseif ($mode == 'update_class') { fn_add_breadcrumb(fn_get_lang_var('product_classes'), "configurator.manage?selected_section=classes"); $product_class = db_get_row("SELECT ?:conf_classes.*, ?:conf_class_descriptions.class_name FROM ?:conf_classes LEFT JOIN ?:conf_class_descriptions ON ?:conf_class_descriptions.class_id = ?:conf_classes.class_id WHERE ?:conf_class_descriptions.lang_code = ?s AND ?:conf_classes.class_id = ?i", DESCR_SL, $_REQUEST['class_id']); // Get class products $product_class['product_ids'] = db_get_fields("SELECT ?:products.product_id FROM ?:products LEFT JOIN ?:conf_class_products ON ?:conf_class_products.product_id = ?:products.product_id WHERE ?:conf_class_products.class_id = ?i", $_REQUEST['class_id']); $product_class['compatible_classes'] = db_get_fields("SELECT ?:conf_compatible_classes.slave_class_id FROM ?:conf_compatible_classes WHERE master_class_id = ?i", $_REQUEST['class_id']); Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'products' => array('title' => fn_get_lang_var('products'), 'js' => true))); $view->assign('product_class', $product_class); list($groups) = fn_get_configurator_groups($_REQUEST); $view->assign('groups', $groups); $view->assign('classes', fn_get_configurator_classes(array('simple' => true))); } elseif ($mode == 'add_class') { fn_add_breadcrumb(fn_get_lang_var('product_classes'), "configurator.manage?selected_section=classes"); Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'products' => array('title' => fn_get_lang_var('products'), 'js' => true))); list($groups) = fn_get_configurator_groups($_REQUEST); $view->assign('groups', $groups); $view->assign('classes', fn_get_configurator_classes(array('simple' => true))); } elseif ($mode == 'manage') { list($classes, $search) = fn_get_configurator_classes($_REQUEST); $view->assign('classes', $classes); $view->assign('classes_search', $search); list($steps, $search) = fn_get_configurator_steps($_REQUEST); $view->assign('steps', $steps); $view->assign('steps_search', $search); list($groups, $search) = fn_get_configurator_groups($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page')); $view->assign('groups', $groups); $view->assign('groups_search', $search); list($all_groups) = fn_get_configurator_groups($_REQUEST);
<?php /*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'results') { $params = $_REQUEST; $params['objects'] = array_keys(fn_search_get_customer_objects()); unset($params['compact']); list($search_results, $search) = fn_search($params, Registry::get('settings.Appearance.products_per_page')); Tygh::$app['view']->assign('search_results', $search_results); Tygh::$app['view']->assign('search', $search); fn_add_breadcrumb(__('search_results')); }
if (!empty($shipment)) { $shipment = array_pop($shipment); foreach ($order_info['items'] as $item_id => $item) { if (isset($shipment['items'][$item_id])) { $order_info['items'][$item_id]['amount'] = $shipment['items'][$item_id]; } else { $order_info['items'][$item_id]['amount'] = 0; } } } else { $shipment = array(); } $view->assign('shipment', $shipment); } fn_add_breadcrumb(fn_get_lang_var('shipments'), 'shipments.manage.reset_view'); fn_add_breadcrumb(fn_get_lang_var('search_results'), "shipments.manage.last_view"); $view->assign('shippings', $shippings); $view->assign('order_info', $order_info); } elseif ($mode == 'manage') { list($shipments, $search, $totals) = fn_get_shipments_info($params); $view->assign('shipments', $shipments); $view->assign('search', $search); $view->assign('totals', $totals); } elseif ($mode == 'packing_slip' && !empty($_REQUEST['shipment_ids'])) { $html = array(); $params = $_REQUEST; foreach ($params['shipment_ids'] as $k => $v) { list($shipment, $order_info) = fn_get_packing_info($v); $view_mail->assign('order_info', $order_info); $view_mail->assign('shipment', $shipment); if (DISPATCH_EXTRA == 'pdf') {
$view->assign('all_pages_list', $pages_tree); $view->assign('page_type', $page_type); $view->assign('page_type_data', fn_get_page_object_by_type($page_type)); $view->assign('companies', fn_get_short_companies()); // // 'page update' page // } elseif ($mode == 'update') { Registry::set('navigation.tabs', array('basic' => array('title' => fn_get_lang_var('general'), 'js' => true), 'blocks' => array('title' => fn_get_lang_var('blocks'), 'js' => true), 'addons' => array('title' => fn_get_lang_var('addons'), 'js' => true))); // Get current page data $page_data = fn_get_page_data($page_id, DESCR_SL); if (!$page_data) { return array(CONTROLLER_STATUS_NO_PAGE); } // [Breadcrumbs] fn_add_breadcrumb(fn_get_lang_var('pages'), "pages.manage&get_tree=multi_level"); // [/Breadcrumbs] if ($page_data['page_type'] == PAGE_TYPE_LINK) { Registry::set('navigation.selected_tab', 'content'); Registry::set('navigation.subsection', 'links'); } // [Block manager] list($blocks) = fn_get_blocks(array('location' => 'pages', 'block_type' => 'B', 'all' => true)); if (!empty($blocks)) { $view->assign('blocks', $blocks); $view->assign('selected_block', fn_get_selected_block_data($_REQUEST, $blocks, $_REQUEST['page_id'], 'pages')); $view->assign('block_properties', fn_get_block_properties()); } // [/Block manager] list($pages_tree, $params) = fn_get_pages(array('get_tree' => 'plain')); $view->assign('all_pages_list', $pages_tree);
} if ($mode == 'clear') { $wishlist = array(); fn_save_cart_content($wishlist, $auth['user_id'], 'W'); return array(CONTROLLER_STATUS_REDIRECT, "wishlist.view"); } elseif ($mode == 'delete' && !empty($_REQUEST['cart_id'])) { fn_delete_wishlist_product($wishlist, $_REQUEST['cart_id']); fn_save_cart_content($wishlist, $auth['user_id'], 'W'); return array(CONTROLLER_STATUS_OK, "wishlist.view"); } elseif ($mode == 'delete_footer' && !empty($_REQUEST['cart_id'])) { fn_delete_wishlist_product($wishlist, $_REQUEST['cart_id']); fn_save_cart_content($wishlist, $auth['user_id'], 'W'); exit; } elseif ($mode == 'view') { if (!$auth['user_id']) { fn_add_breadcrumb(__('wishlist_content')); } $products = !empty($wishlist['products']) ? $wishlist['products'] : array(); $extra_products = array(); $wishlist_is_empty = fn_cart_is_empty($wishlist); if (!empty($products)) { foreach ($products as $k => $v) { $_options = array(); $extra = $v['extra']; if (!empty($v['product_options'])) { $_options = $v['product_options']; } $products[$k] = fn_get_product_data($v['product_id'], $auth, CART_LANGUAGE, '', true, true, true, false, false, true, false, true); if (empty($products[$k])) { unset($products[$k], $wishlist['products'][$k]); continue;
$view->assign('filter_features', $filters); } // [Breadcrumbs] $parent_ids = explode('/', $category_data['id_path']); array_pop($parent_ids); if (!empty($parent_ids)) { $cats = fn_get_category_name($parent_ids); foreach ($parent_ids as $c_id) { fn_add_breadcrumb($cats[$c_id], "categories.view?category_id={$c_id}"); } } fn_add_breadcrumb($category_data['category'], empty($_REQUEST['features_hash']) && empty($_REQUEST['advanced_filter']) ? '' : "categories.view?category_id={$_REQUEST['category_id']}"); if (!empty($params['features_hash'])) { fn_add_filter_ranges_breadcrumbs($params, "categories.view?category_id={$_REQUEST['category_id']}"); } elseif (!empty($_REQUEST['advanced_filter'])) { fn_add_breadcrumb(fn_get_lang_var('advanced_filter')); } // [/Breadcrumbs] } else { return array(CONTROLLER_STATUS_NO_PAGE); } } elseif ($mode == 'picker') { $category_count = db_get_field("SELECT COUNT(*) FROM ?:categories"); if ($category_count < CATEGORY_THRESHOLD) { $params = array('simple' => false); list($categories_tree, ) = fn_get_categories($params); $view->assign('show_all', true); } else { $params = array('category_id' => $_REQUEST['category_id'], 'current_category_id' => $_REQUEST['category_id'], 'visible' => true, 'simple' => false); list($categories_tree, ) = fn_get_categories($params); }
$params['user_id'] = $auth['user_id']; if (!empty($auth['order_ids'])) { $params['order_ids'] = $auth['order_ids']; } } list($return_requests, $search) = fn_get_rma_returns($params, Registry::get('settings.Appearance.' . (AREA == 'A' ? 'admin_' : '') . 'elements_per_page')); Tygh::$app['view']->assign('return_requests', $return_requests); Tygh::$app['view']->assign('search', $search); fn_rma_generate_sections('requests'); Tygh::$app['view']->assign('actions', fn_get_rma_properties(RMA_ACTION)); } elseif ($mode == 'create_return' && !empty($_REQUEST['order_id'])) { $order_id = intval($_REQUEST['order_id']); // [Breadcrumbs] if (AREA != 'A') { fn_add_breadcrumb(__('order') . ' #' . $order_id, "orders.details?order_id={$order_id}"); fn_add_breadcrumb(__('return_registration')); } // [/Breadcrumbs] $order_info = fn_get_order_info($order_id); $order_returnable_products = fn_get_order_returnable_products($order_info['products'], $order_info['products_delivery_date']); $order_info['products'] = $order_returnable_products['items']; if (!isset($order_info['allow_return'])) { return array(CONTROLLER_STATUS_DENIED); } Tygh::$app['view']->assign('order_info', $order_info); Tygh::$app['view']->assign('reasons', fn_get_rma_properties(RMA_REASON)); Tygh::$app['view']->assign('actions', fn_get_rma_properties(RMA_ACTION)); } function fn_get_rma_returns($params, $items_per_page = 0) { // Init filter
// if ($mode == 'update') { $banner_id = fn_update_banner($_REQUEST['banner_data'], $_REQUEST['banner_id'], DESCR_SL); $suffix = ".update?banner_id={$banner_id}"; } return array(CONTROLLER_STATUS_OK, "banners{$suffix}"); } if ($mode == 'update') { $banner = fn_get_banner_data($_REQUEST['banner_id'], DESCR_SL); if (empty($banner)) { return array(CONTROLLER_STATUS_NO_PAGE); } fn_add_breadcrumb(fn_get_lang_var('banners'), "banners.manage"); $view->assign('banner', $banner); } elseif ($mode == 'add') { fn_add_breadcrumb(fn_get_lang_var('banners'), "banners.manage"); } elseif ($mode == 'manage' || $mode == 'picker') { list($banners, ) = fn_get_banners(array(), DESCR_SL); $view->assign('banners', $banners); } elseif ($mode == 'delete') { if (!empty($_REQUEST['banner_id'])) { fn_delete_banner_by_id($_REQUEST['banner_id']); } return array(CONTROLLER_STATUS_REDIRECT, "banners.manage"); } // // Categories picker // if ($mode == 'picker') { $view->display('addons/banners/pickers/banners_picker_contents.tpl'); exit;
if ($mode == 'update') { $group_id = fn_update_affiliate_group($_REQUEST['group'], $_REQUEST['group_id'], DESCR_SL); $suffix = ".update?group_id={$group_id}"; } return array(CONTROLLER_STATUS_OK, "product_groups{$suffix}"); } if ($mode == 'update') { $group = fn_get_group_data($_REQUEST['group_id'], DESCR_SL); if (empty($group)) { return array(CONTROLLER_STATUS_NO_PAGE); } fn_add_breadcrumb(fn_get_lang_var('product_groups'), "product_groups.manage?link_to={$group['link_to']}"); $view->assign('group', $group); } elseif ($mode == 'add') { $link_to = empty($_REQUEST['link_to']) ? 'C' : $_REQUEST['link_to']; fn_add_breadcrumb(fn_get_lang_var('product_groups'), "product_groups.manage?link_to={$link_to}"); $view->assign('link_to', $link_to); } elseif ($mode == 'manage') { $link_to = empty($_REQUEST['link_to']) ? 'C' : $_REQUEST['link_to']; Registry::set('navigation.tabs', array('C' => array('title' => fn_get_lang_var('group_for_category'), 'href' => "product_groups.manage?link_to=C", 'ajax' => true), 'P' => array('title' => fn_get_lang_var('group_for_product'), 'href' => "product_groups.manage?link_to=P", 'ajax' => true), 'U' => array('title' => fn_get_lang_var('url'), 'href' => "product_groups.manage?link_to=U", 'ajax' => true))); // [/Page sections] $groups = fn_get_groups($link_to, false, @$_REQUEST['page'], DESCR_SL); // FIXME $view->assign('groups', $groups); $view->assign('link_to', $link_to); } elseif ($mode == 'delete') { if (!empty($_REQUEST['group_id'])) { fn_delete_affiliate_groups((array) $_REQUEST['group_id']); } else { fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_no_data')); }
foreach ($affiliate_plan['coupons'] as $promotion_id => $coupon_data) { if (isset($affiliate_plan['promotion_ids'][$promotion_id])) { $affiliate_plan['coupons'][$promotion_id]['use_coupon'] = $affiliate_plan['promotion_ids'][$promotion_id]; } } $params = array('coupons' => true); list($coupons) = fn_get_promotions($params); foreach (array_keys($affiliate_plan['promotion_ids']) as $promotion_id) { unset($coupons[$promotion_id]); } $view->assign('coupons', $coupons); $view->assign('affiliate_plan', $affiliate_plan); $view->assign('payout_types', Registry::get('payout_types')); } elseif ($mode == 'add') { // [Breadcrumbs] fn_add_breadcrumb(fn_get_lang_var('plans'), "affiliate_plans.manage"); // [/Breadcrumbs] // [Page sections] Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'linked_products' => array('title' => fn_get_lang_var('products'), 'js' => true), 'linked_categories' => array('title' => fn_get_lang_var('categories'), 'js' => true), 'coupons' => array('title' => fn_get_lang_var('coupons'), 'js' => true), 'multi_tier_affiliates' => array('title' => fn_get_lang_var('multi_tier_affiliates'), 'js' => true))); // [/Page sections] $view->assign('payout_types', Registry::get('payout_types')); } elseif ($mode == 'manage') { $plans = fn_get_affiliate_plans($_REQUEST, DESCR_SL); $view->assign('affiliate_plans', $plans); } elseif ($mode == 'delete_commission') { if (!empty($_REQUEST['plan_id']) && isset($_REQUEST['commission_id'])) { $plan_id = fn_delete_affiliate_commissions((array) $_REQUEST['commission_id'], $_REQUEST['plan_id']); return array(CONTROLLER_STATUS_REDIRECT, "affiliate_plans.update?plan_id={$plan_id}&selected_section=multi_tier_affiliates"); } return array(CONTROLLER_STATUS_REDIRECT, "affiliate_plans.manage"); } elseif ($mode == 'delete_product') {
if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return; } // // View page details // if ($mode == 'view') { $_REQUEST['page_id'] = empty($_REQUEST['page_id']) ? 0 : $_REQUEST['page_id']; $preview = fn_is_preview_action($auth, $_REQUEST); $page = fn_get_page_data($_REQUEST['page_id'], CART_LANGUAGE, $preview); if (empty($page) || $page['status'] == 'D' && !$preview) { return array(CONTROLLER_STATUS_NO_PAGE); } if (!empty($page['meta_description']) || !empty($page['meta_keywords'])) { Registry::get('view')->assign('meta_description', $page['meta_description']); Registry::get('view')->assign('meta_keywords', $page['meta_keywords']); } // If page title for this page is exist than assign it to template if (!empty($page['page_title'])) { Registry::get('view')->assign('page_title', $page['page_title']); } $parent_ids = explode('/', $page['id_path']); foreach ($parent_ids as $p_id) { $_page = fn_get_page_data($p_id); fn_add_breadcrumb($_page['page'], $p_id == $page['page_id'] ? '' : ($_page['page_type'] == PAGE_TYPE_LINK && !empty($_page['link']) ? $_page['link'] : "pages.view?page_id={$p_id}")); } Registry::get('view')->assign('page', $page); }
$suffix = '.manage'; } return array(CONTROLLER_STATUS_OK, "recurring_plans{$suffix}"); } // ---------------------- GET routines --------------------------------------- if ($mode == 'update') { $recurring_plan = fn_get_recurring_plan_data($_REQUEST['plan_id'], DESCR_SL); if (empty($recurring_plan)) { return array(CONTROLLER_STATUS_NO_PAGE); } fn_add_breadcrumb(fn_get_lang_var('rb_recurring_plans'), "recurring_plans.manage"); Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'linked_products' => array('title' => fn_get_lang_var('products'), 'js' => true))); $view->assign('recurring_plan', $recurring_plan); $view->assign('recurring_billing_data', Registry::get('recurring_billing_data')); } elseif ($mode == 'add') { fn_add_breadcrumb(fn_get_lang_var('plans'), "recurring_plans.manage"); Registry::set('navigation.tabs', array('general' => array('title' => fn_get_lang_var('general'), 'js' => true), 'linked_products' => array('title' => fn_get_lang_var('products'), 'js' => true))); $view->assign('recurring_billing_data', Registry::get('recurring_billing_data')); } elseif ($mode == 'manage' || $mode == 'picker') { $plans = fn_get_recurring_plans($_REQUEST, DESCR_SL); $view->assign('recurring_plans', $plans); } elseif ($mode == 'delete') { if (!empty($_REQUEST['plan_id'])) { fn_delete_recurring_plans((array) $_REQUEST['plan_id']); } return array(CONTROLLER_STATUS_REDIRECT, "recurring_plans.manage"); } // // Recurring plans picker // if ($mode == 'picker') {
if (AREA == 'A') { $user = fn_get_user_info($params['user_id'], false); if (fn_allowed_for('ULTIMATE')) { if (empty($user)) { return array(CONTROLLER_STATUS_NO_PAGE); } if (Registry::get('settings.Stores.share_users') == 'Y' && Registry::get('runtime.company_id')) { $orders_ids = db_get_fields("SELECT order_id FROM ?:orders WHERE user_id = ?i AND company_id = ?i", $params['user_id'], Registry::get('runtime.company_id')); if (empty($orders_ids)) { return array(CONTROLLER_STATUS_NO_PAGE); } } } Registry::get('view')->assign('user', $user); } else { fn_add_breadcrumb(__('reward_points_log')); } list($userlog, $search) = fn_gift_registry_get_userlog($params, Registry::get('addons.reward_points.log_per_page')); Registry::get('view')->assign('userlog', $userlog); Registry::get('view')->assign('search', $search); } function fn_gift_registry_get_userlog($params, $items_per_page = 0) { // Set default values to input params $default_params = array('page' => 1, 'items_per_page' => $items_per_page); $params = array_merge($default_params, $params); $sortings = array('timestamp' => 'timestamp', 'amount' => 'amount'); $sorting = db_sort($params, $sortings, 'timestamp', 'desc'); $limit = ''; if (!empty($params['items_per_page'])) { $params['total_items'] = db_get_field("SELECT COUNT(*) FROM ?:reward_point_changes WHERE user_id = ?i", $params['user_id']);
* * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; use Tygh\Settings; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'view') { fn_add_breadcrumb(__('sitemap')); $sitemap_settings = Settings::instance()->getValues('Sitemap'); Registry::get('view')->assign('sitemap_settings', $sitemap_settings); if ($sitemap_settings['show_cats'] == 'Y') { if ($sitemap_settings['show_rootcats_only'] == 'Y') { $categories = fn_get_plain_categories_tree(0, true); $sitemap['categories'] = array(); foreach ($categories as $c) { if ($c['level'] == 0) { $sitemap['categories'][] = $c; } } } else { $sitemap['categories_tree'] = fn_get_plain_categories_tree(0, true); } }
foreach ($parent_ids as $c_id) { fn_add_breadcrumb($cats[$c_id], "companies.products?category_id={$c_id}&company_id={$company_id}"); } } fn_add_breadcrumb($category_data['category']); } // Get subcategories list for current category Tygh::$app['view']->assign('subcategories', fn_get_subcategories($category_id)); Tygh::$app['view']->assign('category_data', $category_data); Tygh::$app['view']->assign('reset_url', fn_url('companies.products?category_id=' . $category_id . '&company_id=' . $company_id)); } else { if (!empty($_REQUEST['q'])) { fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id); fn_add_breadcrumb(__('search')); } else { fn_add_breadcrumb($company_data['company']); } Tygh::$app['view']->assign('reset_url', fn_url('companies.products?company_id=' . $company_id)); } list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page')); if (defined('AJAX_REQUEST') && (!empty($params['features_hash']) && !$products)) { fn_filters_not_found_notification(); exit; } fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_options' => true)); if (!empty($products)) { $_SESSION['continue_url'] = Registry::get('config.current_url'); } $selected_layout = fn_get_products_layout($params); Tygh::$app['view']->assign('products', $products); Tygh::$app['view']->assign('search', $search);
// // Display login form in the mainbox // if ($mode == 'login_form') { if (defined('AJAX_REQUEST') && empty($auth)) { exit; } if (!empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, fn_url()); } $stored_user_login = fn_restore_post_data('user_login'); if (!empty($stored_user_login)) { Registry::get('view')->assign('stored_user_login', $stored_user_login); } if (AREA != 'A') { fn_add_breadcrumb(__('sign_in')); } Registry::get('view')->assign('view_mode', 'simple'); } elseif ($mode == 'password_change' && AREA == 'A') { if (defined('AJAX_REQUEST') && empty($auth)) { exit; } if (empty($auth['user_id'])) { return array(CONTROLLER_STATUS_REDIRECT, fn_url()); } $profile_id = 0; $user_data = fn_get_user_info($auth['user_id'], true, $profile_id); Registry::get('view')->assign('user_data', $user_data); Registry::get('view')->assign('view_mode', 'simple'); } elseif ($mode == 'change_login') { $auth = $_SESSION['auth'];
return array(CONTROLLER_STATUS_OK, !empty($_REQUEST['redirect_url']) ? $_REQUEST['redirect_url'] : "gift_certificates{$suffix}"); } if ($mode == 'add') { fn_add_breadcrumb(fn_get_lang_var('gift_certificates'), "gift_certificates.manage"); if (!empty($_REQUEST['user_id'])) { $user_data = fn_get_user_info($_REQUEST['user_id']); $gift_cert_data = array('send_via' => 'E', 'recipient' => "{$user_data['firstname']} {$user_data['lastname']}", 'sender' => Registry::get('settings.Company.company_name'), 'email' => $user_data['email'], 'address' => $user_data['s_address'], 'address_2' => $user_data['s_address_2'], 'city' => $user_data['s_city'], 'country' => $user_data['s_country'], 'state' => $user_data['s_state'], 'zipcode' => $user_data['s_zipcode'], 'phone' => $user_data['phone']); $view->assign('gift_cert_data', $gift_cert_data); } $view->assign('templates', fn_get_gift_certificate_templates()); $view->assign('states', fn_get_all_states()); $view->assign('countries', fn_get_countries(CART_LANGUAGE, true)); $view->assign('amount_variants', fn_get_gift_certificate_amount_variants()); } elseif ($mode == 'update') { fn_add_breadcrumb(fn_get_lang_var('gift_certificates'), "gift_certificates.manage.reset_view"); fn_add_breadcrumb(fn_get_lang_var('search_results'), "gift_certificates.manage.last_view"); $gift_cert_id = intval($_REQUEST['gift_cert_id']); $gift_cert_data = fn_get_gift_certificate_info($gift_cert_id); if (empty($gift_cert_data)) { return array(CONTROLLER_STATUS_NO_PAGE); } // [Page sections] Registry::set('navigation.tabs', array('detailed' => array('title' => fn_get_lang_var('detailed_info'), 'js' => true), 'log' => array('title' => fn_get_lang_var('history'), 'js' => true))); // [/Page sections] list($log, $sort_order, $sort_by) = fn_get_gift_certificate_log($gift_cert_id, $_REQUEST); $view->assign('log', $log); $view->assign('sort_order', $sort_order); $view->assign('sort_by', $sort_by); if (false != ($last_item = reset($log))) { $gift_cert_data['amount'] = $last_item['debit']; $gift_cert_data['products'] = $last_item['debit_products'];
Registry::get('view')->assign('meta_description', $meta_tags['meta_description']); Registry::get('view')->assign('meta_keywords', $meta_tags['meta_keywords']); } } if (!empty($_SESSION['current_category_id'])) { $_SESSION['continue_url'] = "categories.view?category_id={$_SESSION['current_category_id']}"; $parent_ids = fn_explode('/', db_get_field("SELECT id_path FROM ?:categories WHERE category_id = ?i", $_SESSION['current_category_id'])); if (!empty($parent_ids)) { Registry::set('runtime.active_category_ids', $parent_ids); $cats = fn_get_category_name($parent_ids); foreach ($parent_ids as $c_id) { fn_add_breadcrumb($cats[$c_id], "categories.view?category_id={$c_id}"); } } } fn_add_breadcrumb($product['product']); if (!empty($_REQUEST['combination'])) { $product['combination'] = $_REQUEST['combination']; } //wishlist options selected $wishlistOptionsVariantsSelected = array(); if (isset($_REQUEST['wishlist_id'])) { $conditionWishListSql = db_quote(' ?:user_session_products.product_id = ?i AND ?:user_session_products.item_id=?i', $_REQUEST['product_id'], $_REQUEST['wishlist_id']); $optsVariantsWishListSerialized = db_get_field("SELECT ?:user_session_products.extra FROM ?:user_session_products WHERE " . $conditionWishListSql . " LIMIT 1"); $optsVariantsWishListUnSerialized = unserialize($optsVariantsWishListSerialized); $wishlistOptionsVariantsSelected = $optsVariantsWishListUnSerialized['product_options']; $product['selected_options'] = $wishlistOptionsVariantsSelected; // echo "selected_options:";var_dump($product['selected_options']); } if ($_REQUEST['selected_product_options']) { $product['selected_options'] = $_REQUEST['selected_product_options'];
$_REQUEST['page'] = $page; } $_SESSION['discussion_post_id'] = $_REQUEST['post_id']; return array(CONTROLLER_STATUS_REDIRECT, fn_query_remove(Registry::get('config.current_url'), 'page', 'post_id')); } } } $show_discussion_crumb = true; if ($data['object_type'] == 'E') { // testimonials $show_discussion_crumb = false; } $discussion_object_data = fn_get_discussion_object_data($data['object_id'], $data['object_type']); fn_add_breadcrumb($discussion_object_data['description'], $discussion_object_data['url']); if ($show_discussion_crumb && AREA != 'A') { fn_add_breadcrumb(fn_get_lang_var('discussion')); } if (!empty($_SESSION['discussion_post_id'])) { $view->assign('current_post_id', $_SESSION['discussion_post_id']); unset($_SESSION['discussion_post_id']); } $view->assign('object_id', $data['object_id']); $view->assign('title', $discussion_object_data['description']); $view->assign('object_type', $data['object_type']); } function fn_discussion_get_object_by_thread($thread_id) { static $cache = array(); if (empty($cache[$thread_id])) { $cache[$thread_id] = db_get_row("SELECT object_type, object_id, type FROM ?:discussion WHERE thread_id = ?i", $thread_id); }
* * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'view' && !empty($_REQUEST['category_id'])) { list($result, $category_id) = fn_age_verification_category_check($_REQUEST['category_id']); if ($category_id) { $message = db_get_field("SELECT age_warning_message FROM ?:category_descriptions WHERE category_id = ?i AND lang_code = ?s", $category_id, CART_LANGUAGE); Registry::get('view')->assign('age_warning_message', $message); } if ($result == 'form') { fn_add_breadcrumb(__('age_verification')); Registry::get('view')->assign('content_tpl', 'addons/age_verification/views/categories/components/form.tpl'); return array(CONTROLLER_STATUS_OK); } elseif ($result == 'deny') { fn_set_notification('E', __('error'), __('access_denied')); Registry::get('view')->assign('content_tpl', 'addons/age_verification/views/categories/components/deny.tpl'); return array(CONTROLLER_STATUS_OK); } }