function setProductDescription2($products_id, $focus = null) { use_class('element'); $q = tep_db_query("SELECT * FROM products_description2 WHERE products_id={$products_id}"); $pd2 = tep_db_fetch_array($q); $elements_used = $this->retrieveElementsUsed($products_id); if (!is_null($focus) && !is_array($focus)) { $focus = explode(',', $focus); } $need_tobe_filled_c = is_null($focus) || in_array('c', $focus) && ($pd2['clasp_type'] == '' || $pd2['clasp_type'] == 0) ? true : false; $need_tobe_filled_s = is_null($focus) || in_array('s', $focus) && ($pd2['setting_type'] == '' || $pd2['setting_type'] == 0) ? true : false; if ($need_tobe_filled_c || $need_tobe_filled_s) { $sda = array(); foreach ($elements_used as $eid) { $el = new element($eid); if ($need_tobe_filled_c && !isset($sda['clasp_type']) && $sda['clasp_type'] == '') { $sda['clasp_type'] = $el->attributes['clasp']['id']; } if ($need_tobe_filled_s && !isset($sda['setting_type']) && $sda['setting_type'] == '') { $sda['setting_type'] = $el->attributes['setting']['id']; } } if (count($sda) > 0) { if (tep_db_num_rows($q) > 0) { tep_db_perform('products_description2', $sda, 'update', "products_id={$products_id}"); } else { $sda['products_id'] = $products_id; tep_db_perform('products_description2', $sda); } } } }
function affiliate_insert($sql_data_array, $affiliate_parent = 0) { // LOCK TABLES tep_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE"); if ($affiliate_parent > 0) { $affiliate_root_query = tep_db_query("select affiliate_root, affiliate_rgt, affiliate_lft�from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_parent . "' "); // Check if we have a parent affiliate if ($affiliate_root_array = tep_db_fetch_array($affiliate_root_query)) { tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . " AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " "); tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " "); $sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root']; $sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt']; $sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1; tep_db_perform(TABLE_AFFILIATE, $sql_data_array); $affiliate_id = tep_db_insert_id(); } // no parent -> new root } else { $sql_data_array['affiliate_lft'] = '1'; $sql_data_array['affiliate_rgt'] = '2'; tep_db_perform(TABLE_AFFILIATE, $sql_data_array); $affiliate_id = tep_db_insert_id(); tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' "); } // UNLOCK TABLES tep_db_query("UNLOCK TABLES"); return $affiliate_id; }
function updateOrder($orderId, $orderStatusId, $comment, $notify) { $order_status_history_data_array = array('orders_id' => $orderId, 'orders_status_id' => $orderStatusId, 'comments' => $comment, 'customer_notified' => '0', 'date_added' => 'now()'); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $order_status_history_data_array); $order_data_array = array('orders_id' => $orderId, 'orders_status' => $orderStatusId); tep_db_perform(TABLE_ORDERS, array('orders_status' => $orderStatusId), 'update', "orders_id = {$orderId}"); }
function add($products_id, $type, $links_id, $prepared = false) { if (is_array($links_id) && count($links_id) > 0) { if (!$prepared) { $products_id = tep_db_prepare_input($products_id); $type = tep_db_prepare_input($type); } $plids = array(); foreach ($links_id as $lid) { if (!$prepared) { $lid = tep_db_prepare_input($lid); } if (intval($lid) != 0 && $products_id != $lid) { //$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id=$products_id AND type='$type' AND links_id=$lid"); $check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id={$products_id} AND links_id={$lid}"); if (tep_db_num_rows($check_exist) == 0) { $sda = array(); $sda['products_id'] = $products_id; $sda['type'] = $type; $sda['links_id'] = $lid; $sda['date_added'] = date('Y-m-d H:i:s'); tep_db_perform('products_linking', $sda); $plids[] = tep_db_insert_id(); } } } } else { if ($links_id != '') { $links = explode(',', $links_id); $plids = $this->add($products_id, $type, $links, $prepared); } } return $plids; }
/** * Create a new category top * @param String $name Name of new category top * @param Boolean $is_using_size True if category is using size instead of length * @return Int ID of new category top or 0 if insert failed */ public static function createNewCategoryTop($name, $is_using_size) { $sda = array(); $sda[self::COLNAME_NAME] = $name; $sda[self::COLNAME_SIZE] = $is_using_size ? '1' : '0'; tep_db_perform(self::TABLENAME, $sda); return tep_db_insert_id(); }
function addImportedOrder($download_id, $orders_id) { $o_sda = array(); $o_sda['jng_sp_download_id'] = $download_id; $o_sda['jng_sp_orders_id'] = $orders_id; $o_sda['date_added'] = date('Y-m-d H:i:s'); tep_db_perform('jng_sp_download_orders', $o_sda); }
function update($id, $sda, $updateby = null) { if (!is_null($updateby)) { $sda['last_update_by'] = $updateby; } $sda['last_update_time'] = date('Y-m-d H:i:s'); $result = tep_db_perform('minierp_todos', $sda, 'update', "minierp_todos_id={$id}"); return $result; }
function setAsFree($ean_no) { //BEFORE USING THIS FUNCTION //PLEASE MAKE SURE PRODUCT IS NEVER ACTIVATED TO ANY SALES PARTNER //DO NOT SET FREE THE EAN IF PRODUCT IS ALREADY ACTIVATED $r = tep_db_perform('products', array('products_ean' => ''), 'update', "products_ean='{$ean_no}'"); $r = tep_db_perform('products_articles', array('products_ean' => ''), 'update', "products_ean='{$ean_no}'"); $result = tep_db_query("UPDATE products_ean SET status='0'" . " WHERE ean_no='{$ean_no}'"); return $result; }
function generateKeywords($product_id) { use_class('styles'); use_class('Product'); use_class('ProductAttribute'); $class_s = new styles(); $keywords = array(); $product = new Product($product_id); $language_id = 2; //Step 1 (Brand) if ($product->brand_id == 24) { $keywords = array(strtolower($product->brand_name), 'eli', 'silberschmuck', '925', 'junger', 'modischer', 'trendy', 'fashion'); } elseif ($product->brand_id == 3) { $keywords = array(strtolower($product->brand_name), 'vergoldet', 'golden', 'gold', 'vermeil'); } elseif ($product->brand_id == 7) { $keywords = array(strtolower($product->brand_name), 'perlenschmuck', 'brautschmuck', 'hochzeit'); } //Step 2 (Symbol) $symbol = $class_s->getProductStyle($product_id); if ($symbol['Symbol'] > 0) { $style = new ProductAttribute($symbol['Symbol']); if ($symbol['Symbol'] != '') { array_push($keywords, strtolower($style->displayAttributeName($product_id, ProductAttribute::GROUP_ID_SYMBOL, $language_id))); } } //Step 3 (Basic) array_push($keywords, 'günstiger', 'frau', 'freundin', 'geschenk', 'juwelier'); //Step 4 (Material) $materials = array(); $q = "SELECT ptpm.products_materials_id AS id" . " , material_name AS name" . " FROM products_to_products_materials ptpm" . " INNER JOIN products_materials pm" . " ON pm.products_materials_id = ptpm.products_materials_id" . " WHERE ptpm.products_id = {$product_id}"; $r = tep_db_query($q); while ($row = tep_db_fetch_array($r)) { $materials[$row['id']] = $row['name']; } foreach ($materials as $key => $value) { if ($key == 4 || $key == 2) { list($material_name2, $material_name1, $material_name3) = split(",", $value); array_push($keywords, strtolower($material_name2), 'glamourös', 'funkelnd', 'glitzernd', 'strass', 'festlich', 'elegant'); } else { list($material_name2, $material_name1, $material_name3) = split(",", $value); array_push($keywords, strtolower($material_name2)); } } //Step 5 (Color) $color = $product->getColors($language_id); array_push($keywords, strtolower($color)); //Step 6 (Rest of the products) array_push($keywords, 'basic', 'klassik', 'klassisch', 'schlicht', 'elegant', 'zeitlos', 'sportlich', 'dezent', 'filigran', 'zart', 'schlicht'); $final_k = implode(',', $keywords); //echo $pid." = ".$final_k; $sda = array(); $sda['products_head_keywords_tag'] = $final_k; tep_db_perform('products_description', $sda, 'update', "products_id={$product_id} AND language_id={$language_id}"); }
/** * Add new data to Report COGS table. Existing data will be removed and * replaced with new data. * @global Array $bgst * @param Int $jng_sp_id * @param String $base_date * @param String $ean * @param Int $products_id * @param Int $articles_id * @param String $complexity * @param Int $qty_sold * @param Int $qty_return * @param Float $price_total * @param Float $matexp_total * @param Float $cogs_total * @param Float $vat * @param Float $cash_discount_pct * @param Float $price_total_before_return */ public static function add($jng_sp_id, $base_date, $ean, $products_id, $articles_id, $complexity, $qty_sold, $qty_return, $price_total, $matexp_total, $cogs_total, $vat, $cash_discount_pct, $price_total_before_return) { global $bgst; if (!isset($bgst)) { die('GLOBAL BEST GOOD SETTINGS ($bgst) NEEDEED FOR ReportCOGS::add'); } self::remove($jng_sp_id, $base_date, $ean); $qty = $qty_sold - $qty_return; $qty_before_return = $qty_sold; $price_average = $qty == 0 ? 0 : $price_total / $qty; $price_average_before_return = $qty_sold == 0 ? 0 : $price_total_before_return / $qty_before_return; $matexp_average = $qty == 0 ? 0 : $matexp_total / $qty; $cogs_average = $qty == 0 ? 0 : $cogs_total / $qty; $cogs = new ProductCOGS($matexp_average, $complexity); $cash_discount_total = $cash_discount_pct * $price_total; $cash_discount_total_before_return = $cash_discount_pct * $price_total_before_return; $net_sales_total = $price_total / (1 + $vat) - $cash_discount_total; $net_sales_total_before_return = $price_total_before_return / (1 + $vat) - $cash_discount_total_before_return; $gross_profit_total = $net_sales_total - $qty * $cogs->value; $gross_profit_total_pct = $net_sales_total == 0 ? 0 : $gross_profit_total / $net_sales_total; $sda = array(); $sda['jng_sp_id'] = $jng_sp_id; $sda['base_date'] = date('Y-m-d', strtotime($base_date)); $sda['products_ean'] = $ean; $sda['products_id'] = $products_id; $sda['articles_id'] = $articles_id; $sda['quantity_sold'] = $qty_sold; $sda['quantity_return'] = $qty_return; $sda['quantity'] = $qty; $sda['price_total'] = $price_total; //equal gross sales $sda['price_total_before_return'] = $price_total_before_return; $sda['matexp_total'] = $matexp_total; $sda['price'] = $price_average; $sda['price_before_return'] = $price_average_before_return; $sda['matexp'] = $matexp_average; $sda['matexp_indirect'] = $cogs->indirect_material_expense; $sda['cost_complexity'] = $cogs->cost_based_on_complexity; $sda['cost_variable'] = $cogs->cost_variable; $sda['cost_fixed'] = $cogs->cost_fixed; $sda['cost_handling'] = $cogs->cost_handling; $sda['cogs'] = $cogs->value; $sda['cogs_average'] = $cogs_average; $sda['cogs_total'] = $cogs_total; $sda['vat'] = $vat; $sda['cash_discount_percent'] = $cash_discount_pct; $sda['cash_discount_total'] = $cash_discount_total; $sda['cash_discount_total_before_return'] = $cash_discount_total_before_return; $sda['net_sales_total'] = $net_sales_total; $sda['net_sales_total_before_return'] = $net_sales_total_before_return; $sda['gross_profit_total'] = $gross_profit_total; $sda['gross_profit_total_percent'] = $gross_profit_total_pct; tep_db_perform('report_cogs', $sda); }
/** * Update Measurements Description * @param int $measurements_id * @param int $languages_id * @param array $measurements_data */ public function updateDescription($measurements_id, $languages_id, $measurements_data) { $q_check = "SELECT * FROM measurements_description" . " WHERE measurements_id = {$measurements_id} AND languages_id = {$languages_id}"; $check_query = tep_db_query($q_check); if (tep_db_num_rows($check_query) == 0) { $measurements_data['measurements_id'] = $measurements_id; $measurements_data['languages_id'] = $languages_id; tep_db_perform('measurements_description', $measurements_data); } else { $filter_update = "measurements_id = {$measurements_id} AND languages_id = {$languages_id}"; tep_db_perform('measurements_description', $measurements_data, 'update', $filter_update); } }
function addNewDescription($design_id, $design_description, $updateby, $reminder) { $sdo = array(); $sdo['reminder'] = $reminder; $result = tep_db_perform('projectplan_newdesign', $sdo, 'update', "project_id={$design_id}"); $sda = array(); $sda['project_id'] = $design_id; $sda['project_description'] = $design_description; $sda['last_update_by'] = $updateby; $sda['last_update_time'] = date('Y-m-d H:i:s'); tep_db_perform('projectplan_description', $sda); $newid = tep_db_insert_id(); return $newid; }
function removeLike($user_id) { $deleted = false; $fk = array_search($user_id, $this->list); if ($fk !== false) { unset($this->list[$fk]); $this->list_raw = implode(',', $this->list); $sda = array(); $sda[$this->column_name] = $this->list_raw; tep_db_perform($this->table_name, $sda, 'update', "{$this->column_id_name}={$this->column_id_value}"); $deleted = true; } return $deleted; }
function log($module, $action, $result, $request, $response, $server, $is_ipn = false) { global $customer_id; $do_log = false; if (in_array(OSCOM_APP_PAYPAL_LOG_TRANSACTIONS, array('1', '0'))) { $do_log = true; if (OSCOM_APP_PAYPAL_LOG_TRANSACTIONS == '0' && $result === 1) { $do_log = false; } } if ($do_log !== true) { return false; } $filter = array('ACCT', 'CVV2', 'ISSUENUMBER'); $request_string = ''; if (is_array($request)) { foreach ($request as $key => $value) { if (strpos($key, '_nh-dns') !== false || in_array($key, $filter)) { $value = '**********'; } $request_string .= $key . ': ' . $value . "\n"; } } else { $request_string = $request; } $response_string = ''; if (is_array($response)) { foreach ($response as $key => $value) { if (is_array($value)) { if (function_exists('http_build_query')) { $value = http_build_query($value); } } elseif (strpos($key, '_nh-dns') !== false || in_array($key, $filter)) { $value = '**********'; } $response_string .= $key . ': ' . $value . "\n"; } } else { $response_string = $response; } $data = array('customers_id' => tep_session_is_registered('customer_id') ? $customer_id : 0, 'module' => $module, 'action' => $action . ($is_ipn === true ? ' [IPN]' : ''), 'result' => $result, 'server' => $server == 'live' ? 1 : -1, 'request' => trim($request_string), 'response' => trim($response_string), 'ip_address' => sprintf('%u', ip2long($this->getIpAddress())), 'date_added' => 'now()'); tep_db_perform('oscom_app_paypal_log', $data); }
function tep_update_information_languages($language_id = 0) { global $languages, $languages_id, $gID; if ($language_id == 0) { $language_id = $languages_id; } // Count all items $information_query = tep_db_query("select count(*) as information_count from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "'"); $information = tep_db_fetch_array($information_query); $information_count_all = $information['information_count']; // Count items for main language $information_query = tep_db_query("select count(*) as information_count from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' and language_id = '" . (int) $language_id . "'"); $information = tep_db_fetch_array($information_query); $information_count_single = $information['information_count']; if ($information_count_all != $information_count_single * sizeof($languages)) { // Create array of language id's in information table $information_query = tep_db_query("select language_id from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' group by language_id"); while ($information_language = tep_db_fetch_array($information_query)) { $information_languages[] = $information_language['language_id']; } // Create array of language id's in languages foreach ($languages as $language) { $languages_ids[] = $language['id']; } // Remove entries with languages no longer being used foreach ($information_languages as $_language_id) { if (!in_array($_language_id, $languages_ids)) { tep_db_query("delete from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' and language_id = '" . (int) $_language_id . "'"); } } $information_query = tep_db_query("select * from " . TABLE_INFORMATION . " where information_group_id = '" . (int) $gID . "' and language_id = '" . (int) $language_id . "'"); while ($information = tep_db_fetch_array($information_query)) { foreach ($languages_ids as $_language_id) { if (!in_array($_language_id, $information_languages)) { $sql_data_array = array('language_id' => $_language_id, 'visible' => tep_db_prepare_input($information['visible']), 'show_in_infobox' => tep_db_prepare_input($information['show_in_infobox']), 'sort_order' => tep_db_prepare_input($information['sort_order']), 'information_id' => tep_db_prepare_input($information['information_id']), 'information_group_id' => tep_db_prepare_input($information['information_group_id']), 'information_title' => tep_db_prepare_input($information['information_title']), 'information_description' => tep_db_prepare_input($information['information_description']), 'information_url' => tep_db_prepare_input($information['information_url']), 'information_target' => tep_db_prepare_input($information['information_target']), 'info_cg_hide' => tep_db_prepare_input($information['info_cg_hide'])); tep_db_perform(TABLE_INFORMATION, $sql_data_array); } } } } }
function setParams($products_id, $param_code) { use_class('products_minierp'); $class_pm = new products_minierp(); if ($param_code == 'M') { $param_id_arrays = $class_pm->loadProductMaterials($products_id); $field_name = 'material'; } elseif ($param_code == 'C') { $param_id_arrays = $class_pm->loadColorPattern($products_id); $field_name = 'color'; } else { $param_id_arrays = array(); $field_name = ''; } if ($field_name != '') { if (count($param_id_arrays) == 0) { $sda = array($field_name => ''); tep_db_perform('jng_sp_catalog', $sda, 'update', "products_id = {$products_id}"); } else { use_class('jng_sp_catalog'); $class_jc = new jng_sp_catalog(); $q = tep_db_query("SELECT jng_sp_catalog_id, jng_sp_id FROM jng_sp_catalog WHERE products_id = {$products_id}"); $sp_list = array(); while ($row = tep_db_fetch_array($q)) { $sp_list[$row['jng_sp_catalog_id']] = $row['jng_sp_id']; } foreach ($sp_list as $catalog_id => $jng_sp_id) { $sp_params_raw = $this->load($jng_sp_id, $param_code); $sp_params = array(); foreach ($sp_params_raw as $spr) { if (in_array($spr['param_id'], $param_id_arrays)) { $sp_params[] = $spr['param_value']; } } $sda = array($field_name => implode(', ', $sp_params)); $class_jc->updateField($catalog_id, $sda); } } } }
function setReceiveDate($package_id, $date = null) { if (is_null($date)) { $date = date('Y-m-d H:i:s'); } $psda = array('received_date' => $date); tep_db_perform('minierp_packages', $psda, 'update', "packages_id={$package_id}"); }
$error = MIN_WIDTH_NOT_MET; } else { if (number_format(trim($_POST['height']), 2, '.', '') <= 0) { $error = MIN_HEIGHT_NOT_MET; } else { if (number_format(trim($_POST['empty_weight']), 2, '.', '') < 0) { $error = MIN_EMPTY_WEIGHT_NOT_MET; } else { if (number_format(trim($_POST['max_weight']), 2, '.', '') < 0) { $error = MIN_MAX_WEIGHT_NOT_MET; } else { $sql_data_array = array('package_name' => $_POST['name'], 'package_description' => $_POST['description'], 'package_length' => $_POST['length'], 'package_width' => $_POST['width'], 'package_height' => $_POST['height'], 'package_empty_weight' => $_POST['empty_weight'], 'package_max_weight' => $_POST['max_weight'], 'package_cost' => $_POST['cost']); if ($_POST["Action"] == "newpackage") { tep_db_perform(TABLE_PACKAGING, $sql_data_array); } else { tep_db_perform(TABLE_PACKAGING, $sql_data_array, "update", "package_id = '" . $_POST['id'] . "'"); } } } } } } } //********** Delete Package if ($_POST['id'] != "" && $_POST["Action"] == "deletepackage") { tep_db_query("delete from " . TABLE_PACKAGING . " where package_id = '" . $_POST['id'] . "'"); } // ********* Display Packages DisplayPackages($activeid, $error); switch ($_GET['Action']) { case "shownewpackageform":
$comment = 'ungültiges Benachrichtigung Passwort' . "\n"; } // check if order exists $order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "' and customers_id = '" . (int) $customer_id . "'"); if (tep_db_num_rows($order_query) > 0) { $order = tep_db_fetch_array($order_query); if ($order['orders_status'] == MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID) { $total_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' and class = 'ot_total' limit 1"); $total = tep_db_fetch_array($total_query); $order_total_integer = number_format($total['value'] * $currencies->get_value('EUR'), 2, '.', '') * 100; if ($order_total_integer < 1) { $order_total_integer = '000'; } elseif ($order_total_integer < 10) { $order_total_integer = '00' . $order_total_integer; } elseif ($order_total_integer < 100) { $order_total_integer = '0' . $order_total_integer; } if ((int) $betrag_integer == (int) $order_total_integer) { $comment = 'Zahlung durch Sofortüberweisung Benachrichtigung bestätigt!'; } else { $comment = "Sofortüberweisungs Transaktionscheck fehlgeschlagen. Bitte manuell überprüfen\n" . $betrag_integer / 100 . '!=' . $order_total_integer / 100; } if (MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STORE_TRANSACTION_DETAILS == 'True') { $comment .= "\n" . serialize($_GET) . "\n" . serialize($_POST); } $order_status = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID; $sql_data_array = array('orders_id' => (int) $order_id, 'orders_status_id' => $order_status, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => $comment); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status . "', last_modified = now() where orders_id = '" . (int) $order_id . "'"); } }
private function install() { //Check if translations are available parent::checkTranslations(dirname(__FILE__), $this->getTranslations()); $install_array = array('status' => array('type' => 'config', 'value' => 'true', 'options' => array('true', 'false')), 'login' => array('type' => 'config', 'value' => 'true', 'options' => array('true', 'false')), 'create_account' => array('type' => 'config', 'value' => 'true', 'options' => array('true', 'false')), 'change_billing_address' => array('type' => 'config', 'value' => 'true', 'options' => array('true', 'false')), 'billing_name' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Naam + Familienaam', 'dbvalue' => 'entry_firstname', 'expression' => "/^[\\D]+[\\s][\\D]+\$/", 'error' => 'Vul a.u.b. een volledige naam in.', 'sort_order' => 1), 'billing_company' => array('type' => 'field', 'input' => 'text', 'value' => 'false', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Bedrijf', 'dbvalue' => 'entry_company', 'condition' => "!tep_session_is_registered('customer_id')", 'sort_order' => 2), 'billing_tva_intracom' => array('type' => 'field', 'input' => 'text', 'value' => 'false', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'BTW nr.', 'dbvalue' => 'billing_tva_intracom', 'condition' => "!tep_session_is_registered('customer_id')", 'sort_order' => 3), 'billing_street_address' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Straat + nr.', 'dbvalue' => 'entry_street_address', 'expression' => "/^[\\D]+[\\s][\\d]+[\\D]{0,3}+\$/", 'error' => 'Vul a.u.b. een straat + nummer in.', 'sort_order' => 4), 'billing_city' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Gemeente', 'dbvalue' => 'entry_city', 'expression' => "/^[\\D]+[\\s]?[\\D]*\$/", 'error' => 'Vul a.u.b. een gemeente in.', 'sort_order' => 5), 'billing_postcode' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Postcode', 'dbvalue' => 'entry_postcode', 'expression' => "/^[a-zA-Z0-9]+\$/", 'error' => 'Vul a.u.b. een postcode in.', 'sort_order' => 6), 'billing_country' => array('type' => 'dropdown', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Land', 'dbvalue' => 'entry_country_id', 'expression' => "/^[1-9][0-9]*\$/", 'error' => 'Kies a.u.b. een land.', 'sort_order' => 7), 'customers_telephone' => array('type' => 'field', 'input' => 'tel', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'Tel.', 'dbvalue' => 'customers_telephone', 'function' => "validate_phone", 'error' => 'Vul a.u.b. een telefoon nummer in.', 'sort_order' => 8), 'customers_email_address' => array('type' => 'field', 'input' => 'email', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'billing', 'label' => 'E-mailadres', 'dbvalue' => 'customers_email_address', 'function' => "validate_email", 'error' => 'Vul a.u.b. een geldig e-mail adres in.', 'sort_order' => 9), 'delivery_name' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'Naam + Familienaam', 'dbvalue' => 'entry_firstname', 'expression' => "/^[\\D]+[\\s][\\D]+\$/", 'error' => 'Vul a.u.b. een volledige naam in.', 'sort_order' => 1), 'delivery_company' => array('type' => 'field', 'input' => 'text', 'value' => 'false', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'Bedrijf', 'dbvalue' => 'entry_company', 'condition' => "!tep_session_is_registered('customer_id')", 'sort_order' => 2), 'delivery_tva_intracom' => array('type' => 'field', 'input' => 'text', 'value' => 'false', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'BTW nr.', 'dbvalue' => '', 'condition' => "!tep_session_is_registered('customer_id')", 'sort_order' => 3), 'delivery_street_address' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'Straat + nr.', 'dbvalue' => 'entry_street_address', 'expression' => "/^[\\D]+[\\s][\\d]+[\\D]{0,3}+\$/", 'error' => 'Vul a.u.b. een straat + nummer in.', 'sort_order' => 4), 'delivery_city' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'Gemeente', 'dbvalue' => 'entry_city', 'expression' => "/^[\\D]+[\\s]?[\\D]*\$/", 'error' => 'Vul a.u.b. een gemeente in.', 'sort_order' => 5), 'delivery_postcode' => array('type' => 'field', 'input' => 'text', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'Postcode', 'dbvalue' => 'entry_postcode', 'expression' => "/^[a-zA-Z0-9]+\$/", 'error' => 'Vul a.u.b. een postcode in.', 'sort_order' => 6), 'delivery_country' => array('type' => 'dropdown', 'value' => 'true', 'options' => array('true', 'false'), 'block' => 'delivery', 'label' => 'Land', 'dbvalue' => 'entry_country_id', 'expression' => "/^[1-9][0-9]*\$/", 'error' => 'Kies a.u.b. een land.', 'sort_order' => 7)); tep_db_query('CREATE TABLE checkout_' . get_class($this) . '( `id` INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), `name` VARCHAR(255), `type` VARCHAR(255), `input` VARCHAR(255), `value` VARCHAR(255), `options` VARCHAR(255), `block` VARCHAR(255), `label` VARCHAR(255), `dbvalue` VARCHAR(255), `expression` VARCHAR(255), `function` VARCHAR(255), `condition` VARCHAR(255), `error` VARCHAR(255), `sort_order` INT(11))'); tep_db_query('CREATE INDEX name ON checkout_' . get_class($this) . ' (name)'); tep_db_query('CREATE INDEX type ON checkout_' . get_class($this) . ' (type)'); foreach ($install_array as $key => $value) { $db_array = array(); $db_array['name'] = $key; foreach ($value as $name => $data) { if (is_array($data)) { $data = serialize($data); } $db_array[$name] = $data; } tep_db_perform('checkout_' . get_class($this), $db_array, 'insert'); } }
$manufacturers_image = new upload('manufacturers_image'); $manufacturers_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($manufacturers_image->parse() && $manufacturers_image->save()) { tep_db_query("update " . TABLE_MANUFACTURERS . " set manufacturers_image = '" . tep_db_input($manufacturers_image->filename) . "' where manufacturers_id = '" . (int) $manufacturers_id . "'"); } $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { $manufacturers_url_array = $HTTP_POST_VARS['manufacturers_url']; $language_id = $languages[$i]['id']; $sql_data_array = array('manufacturers_url' => tep_db_prepare_input($manufacturers_url_array[$language_id])); if ($action == 'insert') { $insert_sql_data = array('manufacturers_id' => $manufacturers_id, 'languages_id' => $language_id); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array); } elseif ($action == 'save') { tep_db_perform(TABLE_MANUFACTURERS_INFO, $sql_data_array, 'update', "manufacturers_id = '" . (int) $manufacturers_id . "' and languages_id = '" . (int) $language_id . "'"); } } if (USE_CACHE == 'true') { tep_reset_cache_block('manufacturers'); } tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'mID=' . $manufacturers_id)); break; case 'deleteconfirm': $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']); if (isset($HTTP_POST_VARS['delete_image']) && $HTTP_POST_VARS['delete_image'] == 'on') { $manufacturer_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int) $manufacturers_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); $image_location = DIR_FS_DOCUMENT_ROOT . DIR_WS_CATALOG_IMAGES . $manufacturer['manufacturers_image']; if (file_exists($image_location)) { @unlink($image_location);
public function saveToDB() { if ($this->fields['orders_id'] == OSCommerce_Order::NEW_RECORD) { unset($this->fields['orders_id']); tep_db_perform(TABLE_ORDERS, $this->fields); $this->fields['orders_id'] = $orderID = tep_db_insert_id(); $totalPrice = 0; $productsOrdered = ''; // Text summary of products ordered; for email. foreach ($this->products as $productID => $fields) { $orderProduct = array('orders_id' => $orderID, 'products_id' => $fields['id'], 'products_model' => $fields['model'], 'products_name' => $fields['name'], 'products_price' => $fields['price'], 'final_price' => $fields['final_price'], 'products_tax' => 0, 'products_quantity' => $fields['quantity']); tep_db_perform(TABLE_ORDERS_PRODUCTS, $orderProduct); $orderProductID = tep_db_insert_id(); $productsAttributesText = ''; if (isset($fields['attributes'])) { foreach ($fields['attributes'] as $option_id => $value_id) { $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $fields['id'] . "' and pa.options_id = '" . $option_id . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $value_id . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . DEFAULT_LANGUAGE_ID . "' and poval.language_id = '" . DEFAULT_LANGUAGE_ID . "'"); $attributes_values = tep_db_fetch_array($attributes); $sql_data_array = array('orders_id' => $orderID, 'orders_products_id' => $orderProductID, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); $productsAttributesText .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; } } $productsOrdered .= $fields['quantity'] . ' x ' . $fields['name'] . ' (' . $fields['model'] . ') = ' . sprintf('$ %.2f', $fields['quantity'] * $fields['final_price']) . $productsAttributesText . "\n"; } $orderTotals = array(); $count = 0; $orderTotals[] = array('orders_id' => $orderID, 'title' => 'Subtotal', 'text' => 'Subtotal', 'value' => $this->getSubtotal(), 'text' => sprintf('$%.2f', $this->getSubtotal()), 'class' => 'ot_subtotal', 'sort_order' => count($orderTotals)); tep_db_perform(TABLE_ORDERS_TOTAL, $orderTotals[$count++]); $orderTotals[] = array('orders_id' => $orderID, 'title' => 'Tax', 'text' => 'Tax', 'value' => $this->getTax(), 'text' => sprintf('$%.2f', $this->getTax()), 'class' => 'ot_tax', 'sort_order' => count($orderTotals)); tep_db_perform(TABLE_ORDERS_TOTAL, $orderTotals[$count++]); $orderTotals[] = array('orders_id' => $orderID, 'title' => 'Shipping', 'text' => 'Shipping', 'text' => sprintf('$%.2f', $this->getShippingTotal()), 'value' => $this->getShippingTotal(), 'class' => 'ot_shipping', 'sort_order' => count($orderTotals)); tep_db_perform(TABLE_ORDERS_TOTAL, $orderTotals[$count++]); $orderTotals[] = array('orders_id' => $orderID, 'title' => 'Total', 'text' => sprintf('$%.2f', $this->getTotal()), 'value' => $this->getTotal(), 'class' => 'ot_total', 'sort_order' => count($orderTotals)); tep_db_perform(TABLE_ORDERS_TOTAL, $orderTotals[$count++]); reset($orderTotals); $this->sendOrderEmail($productsOrdered, $orderTotals); } else { throw new Exception("not happening: order update not implemented."); } }
$products_ordered_attributes = ''; if (isset($order->products[$i]['attributes'])) { $attributes_exist = '1'; for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename \n from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa \n left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n on pa.products_attributes_id=pad.products_attributes_id\n where pa.products_id = '" . $order->products[$i]['id'] . "' \n and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' \n and pa.options_id = popt.products_options_id \n and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' \n and pa.options_values_id = poval.products_options_values_id \n and popt.language_id = '" . $languages_id . "' \n and poval.language_id = '" . $languages_id . "'"; $attributes = tep_db_query($attributes_query); } else { $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); } $attributes_values = tep_db_fetch_array($attributes); $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']); tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); if (DOWNLOAD_ENABLED == 'true' && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']); tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); } $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; } } //------insert customer choosen option eof ---- $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight']; $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; $total_cost += $total_products_price; $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; } // lets start with the email confirmation $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; }
$newsletter_error = true; } if (empty($module)) { $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error'); $newsletter_error = true; } if ($newsletter_error == false) { $sql_data_array = array('title' => $title, 'content' => $content, 'module' => $newsletter_module, 'filter' => serialize(array('orders' => $orders, 'site' => $site, 'city' => $city))); if ($action == 'insert') { $sql_data_array['date_added'] = 'now()'; $sql_data_array['status'] = '0'; $sql_data_array['locked'] = '0'; tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array); $newsletter_id = tep_db_insert_id(); } elseif ($action == 'update') { tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int) $newsletter_id . "'"); } tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $newsletter_id)); } else { $action = 'new'; } break; case 'deleteconfirm': $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']); tep_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int) $newsletter_id . "'"); tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'])); break; case 'delete': case 'new': if (!isset($HTTP_GET_VARS['nID'])) { break;
private function install() { //Check if translations are available parent::checkTranslations(dirname(__FILE__), $this->getTranslations()); $install_array = array('status' => 'true', 'title' => 'Verzending België', 'description' => '', 'zone' => '', 'quote' => '10', 'order_status_id' => '3', 'sort_order' => '10'); tep_db_query('CREATE TABLE checkout_' . get_class($this) . '( id INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), status VARCHAR(255), title VARCHAR(255), description VARCHAR(255), zone VARCHAR(255), quote FLOAT(10,2), order_status_id INT(11), sort_order INT(11))'); tep_db_query('CREATE INDEX title ON checkout_' . get_class($this) . ' (`title`)'); tep_db_query('CREATE INDEX status ON checkout_' . get_class($this) . ' (`status`)'); tep_db_query('CREATE INDEX zone ON checkout_' . get_class($this) . ' (`zone`)'); tep_db_perform('checkout_' . get_class($this), $install_array, 'insert'); }
function install($parameter = null) { $params = $this->getParams(); if (isset($parameter)) { if (isset($params[$parameter])) { $params = array($parameter => $params[$parameter]); } else { $params = array(); } } foreach ($params as $key => $data) { $sql_data_array = array('configuration_title' => $data['title'], 'configuration_key' => $key, 'configuration_value' => isset($data['value']) ? $data['value'] : '', 'configuration_description' => $data['desc'], 'configuration_group_id' => '6', 'sort_order' => '0', 'date_added' => 'now()'); if (isset($data['set_func'])) { $sql_data_array['set_function'] = $data['set_func']; } if (isset($data['use_func'])) { $sql_data_array['use_function'] = $data['use_func']; } tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); } }
function saveManualPI($products_id, $manual_pi) { $sda = array('products_instruction' => $manual_pi); $exist_query = tep_db_query("SELECT pnc.products_id FROM products_non_configurator pnc WHERE pnc.products_id={$products_id}"); if (tep_db_num_rows($exist_query) > 0) { tep_db_perform('products_non_configurator', $sda, 'update', "products_id={$products_id}"); } else { $sda['products_id'] = $pid; tep_db_perform('products_non_configurator', $sda); } }
private function install() { //Check if translations are available parent::checkTranslations(dirname(__FILE__), $this->getTranslations()); $install_array = array('status' => 'true', 'title' => 'Facturatieadres', 'description' => ''); tep_db_query('CREATE TABLE checkout_' . get_class($this) . '( id INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), status VARCHAR(255), title VARCHAR(255), description VARCHAR(255))'); tep_db_query('CREATE INDEX title ON checkout_' . get_class($this) . ' (`title`)'); tep_db_query('CREATE INDEX status ON checkout_' . get_class($this) . ' (`status`)'); tep_db_perform('checkout_' . get_class($this), $install_array, 'insert'); }
$affiliate_newsletter_error = true; } if (empty($affiliate_newsletter_module)) { $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error'); $affiliate_newsletter_error = true; } if ($affiliate_newsletter_error == false) { $sql_data_array = array('title' => $title, 'content' => $content, 'module' => $affiliate_newsletter_module); if ($action == 'insert') { $sql_data_array['date_added'] = 'now()'; $sql_data_array['status'] = '0'; $sql_data_array['locked'] = '0'; tep_db_perform(TABLE_AFFILIATE_NEWSLETTERS, $sql_data_array); $affiliate_newsletter_id = tep_db_insert_id(); } elseif ($action == 'update') { tep_db_perform(TABLE_AFFILIATE_NEWSLETTERS, $sql_data_array, 'update', "affiliate_newsletters_id = '" . (int) $affiliate_newsletter_id . "'"); } tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'nID=' . $affiliate_newsletter_id)); } else { $action = 'new'; } break; case 'deleteconfirm': $affiliate_newsletter_id = tep_db_prepare_input($_GET['nID']); tep_db_query("delete from " . TABLE_AFFILIATE_NEWSLETTERS . " where affiliate_newsletters_id = '" . (int) $affiliate_newsletter_id . "'"); tep_redirect(tep_href_link(FILENAME_AFFILIATE_NEWSLETTERS, 'page=' . $_GET['page'])); break; case 'delete': case 'new': if (!isset($_GET['nID'])) { break;
if (ACCOUNT_COMPANY == 'true') { $sql_data_array['entry_company'] = $company; } if (ACCOUNT_SUBURB == 'true') { $sql_data_array['entry_suburb'] = $suburb; } if (ACCOUNT_STATE == 'true') { if ($zone_id > 0) { $sql_data_array['entry_zone_id'] = $zone_id; $sql_data_array['entry_state'] = ''; } else { $sql_data_array['entry_zone_id'] = '0'; $sql_data_array['entry_state'] = $state; } } tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); $address_id = tep_db_insert_id(); tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int) $address_id . "' where customers_id = '" . (int) $customer_id . "'"); tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $customer_id . "', '0', now())"); if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $customer_first_name = $firstname; $customer_default_address_id = $address_id; $customer_country_id = $country; $customer_zone_id = $zone_id; tep_session_register('customer_id'); tep_session_register('customer_first_name'); tep_session_register('customer_default_address_id'); tep_session_register('customer_country_id'); tep_session_register('customer_zone_id');