if (isset($HTTP_GET_VARS['products_id'])) { $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int) $HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { ?> <!-- also_purchased_products //--> <?php echo TEXT_ALSO_PURCHASED_PRODUCTS; $row = 0; $col = 0; $info_box_contents = array(); while ($orders = tep_db_fetch_array($orders_query)) { if ($col > 0) { $info_box_contents[$row][] = array('text' => tep_draw_separator('pixel_trans.gif', 20, 1)); } $orders['products_name'] = tep_get_products_info($orders['products_id'], DEFAULT_LANGUAGE_ID); $info_box_contents[$row][] = array('align' => 'center', 'params' => 'width="' . SMALL_IMAGE_WIDTH . '" class="smallText" valign="top" style="line-height: 1em; padding-bottom: 5px;"', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'vspace="2"') . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>'); $col++; if ($col > 5) { $col = 0; $row++; } } $box = new tableBox(array()); $box->table_width = ''; $box->table_border = '0'; $box->table_cellpadding = '0'; $box->tableBox($info_box_contents, true); ?> <!-- also_purchased_products_eof //--> <?php
<?php if ($session_started == true && $product_check > 0 && is_array($navigation->path)) { $navigation_path_array = array_reverse($navigation->path); $viewed_products = array(); reset($navigation_path_array); while (list($i, $navigation_path_row) = each($navigation_path_array)) { $products_id = $navigation_path_row['real_get']['products_id']; if (basename($navigation_path_row['real_page']) == FILENAME_PRODUCT_INFO && tep_not_null($products_id)) { if ($i == 0 && $products_id == $HTTP_GET_VARS['products_id'] || in_array($products_id, array_keys($viewed_products))) { } else { $product_author_info_query = tep_db_query("select authors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $products_id . "'"); $product_author_info = tep_db_fetch_array($product_author_info_query); $products_authors_name = tep_get_authors_info($product_author_info['authors_id'], DEFAULT_LANGUAGE_ID); $products_name = tep_get_products_info($products_id, DEFAULT_LANGUAGE_ID); $products_full_name = (tep_not_null($products_authors_name) ? $products_authors_name . ': ' : '') . $products_name; $viewed_products[$products_id] = array('name' => $products_name, 'full_name' => $products_full_name); } } } $navigation_path_string = ''; if (sizeof($viewed_products) > 2) { // asort($viewed_products); reset($viewed_products); $i = 0; while (list($products_id, $products_info) = each($viewed_products)) { if ($i == 0 && $products_id == $HTTP_GET_VARS['products_id']) { } else { $navigation_path_string .= '<div class="li' . ($i == 0 ? '_first' : '') . '"><div class="level_0"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_id) . '"' . ($HTTP_GET_VARS['products_id'] == $products_id ? ' class="active"' : '') . ' title="' . $products_info['full_name'] . '">' . $products_info['name'] . '</a></div></div>' . "\n"; $i++; }
// EOF MaxiDVD: Modified For Ultimate Images Pack! $product = tep_db_fetch_array($product_query); // HTC EOC $pInfo = new objectInfo($product); $products_image_name = $pInfo->products_image; $products_image_xl_name = array(1 => $pInfo->products_image_xl_1, 2 => $pInfo->products_image_xl_2, 3 => $pInfo->products_image_xl_3, 4 => $pInfo->products_image_xl_4); } $form_action = isset($HTTP_GET_VARS['pID']) ? 'update_product' : 'insert_product'; $breadcrumb->add($pInfo->products_name, isset($_GET['pID']) ? tep_href_link('gift_certs.php', 'pclass=' . $pClass . "&cPath={$cPath}&pID=" . $_GET['pID']) : ''); echo tep_draw_form($form_action, 'gift_certs.php', 'pclass=' . $pClass . '&cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"'); // HTC BOC $languages = tep_get_languages(); for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { if (isset($HTTP_GET_VARS['read']) && $HTTP_GET_VARS['read'] == 'only') { $pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']); $pInfo->products_info = tep_get_products_info($pInfo->products_id, $languages[$i]['id']); $pInfo->products_info_alt = tep_get_products_info_alt($pInfo->products_id, $languages[$i]['id']); $pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']); $pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]); $pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]); $pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]); $pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']); } else { $pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]); $pInfo->products_info = tep_db_prepare_input($products_info[$languages[$i]['id']]); $pInfo->products_info_alt = tep_db_prepare_input($products_info_alt[$languages[$i]['id']]); $pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]); $pInfo->products_head_title_tag = tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]); $pInfo->products_head_desc_tag = tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]); $pInfo->products_head_keywords_tag = tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]); $pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
$is_europe = 'e'; } } tep_order_log($insert_id, 'Creating csv file for order'); $delimiter = ','; $date_purchased = preg_replace('/\\s+/', ' ', preg_replace('/(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})/', '$3.$2.$1 $4:$5:$6', $order->info['date_purchased'])); $order_file = UPLOAD_DIR . 'temp_orders/' . SHOP_PREFIX . $insert_id . '.csv'; $fp = fopen($order_file, 'w'); $common_data = array($insert_id, $date_purchased, SHOP_ID, $is_dummy_account == true ? '0' : $customer_id, $order->customer['email_address'], $order->delivery['name'], '', '', $payment, $order_shipping_title, str_replace(',', '.', $order_shipping_sum), $order->info['currency'], str_replace(',', '.', $order->info['currency_value']), tep_html_entity_decode($order->delivery['state']), tep_html_entity_decode($order->delivery['suburb']), tep_html_entity_decode($order->delivery['city']), $order->delivery['postcode'], tep_html_entity_decode($order->delivery['street_address']), $order->delivery['telephone'], tep_html_entity_decode($order->info['comments']), $self_delivery_id, tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false), str_replace(',', '.', $order_total_sum), str_replace(',', '.', abs($order_discount_sum)), tep_not_null($order->customer['company_full']) ? tep_html_entity_decode($order->customer['company_full']) : tep_html_entity_decode($order->customer['company']), $order->customer['company_inn'], $order->customer['company_kpp'], $order->customer['company_address_corporate'], $is_europe, $order_delivery_transfer, $order->info['code'], tep_html_entity_decode($order->delivery['country']), tep_html_entity_decode($order_delivery_country_code), $order->customer['company_corporate']); fputcsvsafe($fp, $common_data, $delimiter); tep_order_log($insert_id, 'Order is saved to CSV file'); tep_db_query("update " . TABLE_ORDERS . " set " . (empty($order->info['code']) ? "orders_code = orders_id, " : "") . "payment_method_class = '" . tep_db_input($payment) . "', delivery_method = '" . tep_db_input($order_shipping_method) . "', delivery_method_class = '" . tep_db_input($order_shipping_title) . "', delivery_self_address = '" . tep_db_input($self_delivery_address) . "', delivery_self_address_id = '" . (int) $self_delivery_id . "' where orders_id = '" . (int) $insert_id . "'"); reset($order->products); while (list(, $product) = each($order->products)) { $product_code = (int) str_replace('bbk', '', $product['code']); $common_data = array($product['type'], $product_code, $product['qty'], str_replace(',', '.', $product['final_price']), $product['id'], '', $product['name'], tep_get_products_info($product['id']), $product['code'], $product['warranty']); fputcsvsafe($fp, $common_data, $delimiter); } fclose($fp); tep_order_log($insert_id, 'Order products are saved and file is closed'); copy($order_file, str_replace('temp_orders/', 'orders1/', $order_file)); unlink($order_file); tep_order_log($insert_id, 'Creating archive order'); tep_db_query("insert into " . TABLE_ARCHIVE_ORDERS . " select * from " . TABLE_ORDERS . " where orders_id = '" . (int) $insert_id . "'"); tep_db_query("insert into " . TABLE_ARCHIVE_ORDERS_TOTAL . " select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $insert_id . "'"); tep_db_query("insert into " . TABLE_ARCHIVE_ORDERS_STATUS_HISTORY . " select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int) $insert_id . "'"); tep_db_query("insert into " . TABLE_ARCHIVE_ORDERS_PRODUCTS . " select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $insert_id . "'"); tep_db_query("insert into " . TABLE_ARCHIVE_ORDERS_PRODUCTS_DOWNLOAD . " select * from " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " where orders_id = '" . (int) $insert_id . "'"); tep_order_log($insert_id, 'Archive order is created'); $cart->reset(true); // unregister session variables used during checkout
define('ADDITIONAL_DESCRIPTION', $page['pages_additional_description']); $translation_query = tep_db_query("select pages_translation_key, pages_translation_value from " . TABLE_PAGES_TRANSLATION . " where pages_filename = '" . tep_db_input(basename($content)) . "' and language_id = '" . (int) $languages_id . "'"); while ($translation = tep_db_fetch_array($translation_query)) { define($translation['pages_translation_key'], $translation['pages_translation_value']); } $product_check_query_raw = "select products_id, products_types_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'"; $product_check_query = tep_db_query($product_check_query_raw); $product_check = tep_db_num_rows($product_check_query); if ($product_check > 0) { $product_check_info = tep_db_fetch_array($product_check_query); $show_product_type = $product_check_info['products_types_id']; if ($session_started == true && $spider_flag == false) { tep_db_query("delete from " . TABLE_PRODUCTS_VIEWED . " where date_viewed <= '" . date('Y-m-d', time() - 60 * 60 * 24 * 30) . "'"); $products_viewed_check_query = tep_db_query("select 1 from " . TABLE_PRODUCTS_VIEWED . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int) $languages_id . "' and date_viewed = '" . date('Y-m-d') . "'"); if (tep_db_num_rows($products_viewed_check_query) < 1) { tep_db_query("insert into " . TABLE_PRODUCTS_VIEWED . " (products_id, language_id, date_viewed, products_viewed) values ('" . (int) $HTTP_GET_VARS['products_id'] . "', '" . (int) $languages_id . "', '" . date('Y-m-d') . "', '1')"); } else { $products_viewed_check = tep_db_fetch_array($products_viewed_check_query); tep_db_query("update " . TABLE_PRODUCTS_VIEWED . " set products_viewed = products_viewed + 1 where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int) $languages_id . "' and date_viewed = '" . date('Y-m-d') . "'"); } // [2013-01-15] Evgeniy Spashko: OPTIM Temporary disabled products_viewed value update //tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed + 1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); //tep_db_query("update " . TABLE_PRODUCTS . " set products_viewed = products_viewed + 1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); } $content_id = $HTTP_GET_VARS['products_id']; $content_type = 'product'; $breadcrumb->add('<h1>' . tep_get_products_info($HTTP_GET_VARS['products_id'], DEFAULT_LANGUAGE_ID) . '</h1>', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } else { tep_redirect(tep_href_link(FILENAME_ERROR_404)); } require DIR_WS_INCLUDES . 'application_bottom.php';
<?php if (basename(SCRIPT_FILENAME) == FILENAME_PRODUCT_INFO) { $products_id = (int) $HTTP_GET_VARS['products_id']; $other_images_query = tep_db_query("select products_images_image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int) $products_id . "' and language_id = '" . (int) $languages_id . "' order by products_images_id"); if (tep_db_num_rows($other_images_query) > 0) { $box_info_query = tep_db_query("select blocks_name from " . TABLE_BLOCKS . " where blocks_filename = '" . tep_db_input(basename(__FILE__)) . "' and language_id = '" . (int) $languages_id . "'"); $box_info = tep_db_fetch_array($box_info_query); $author_info_query = tep_db_query("select authors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $products_id . "'"); $author_info = tep_db_fetch_array($author_info_query); $block_authors_name = tep_get_authors_info($author_info['authors_id'], DEFAULT_LANGUAGE_ID); $block_product_name = (tep_not_null($block_authors_name) ? $block_authors_name . ': ' : '') . tep_get_products_info($products_id, DEFAULT_LANGUAGE_ID); $boxHeading = sprintf($box_info['blocks_name'], $block_product_name); $pieces = 0; $products_images = array(); $products_images_dir = DIR_WS_IMAGES . 'prints/' . substr(sprintf("%06d", $products_id), 0, -4) . '/' . sprintf("%06d", $products_id) . '/'; while ($other_images = tep_db_fetch_array($other_images_query)) { $pieces++; $image_title = str_replace("'", ''', '‘рагмент ' . $pieces); $products_images[] = array('image_small' => $products_images_dir . 'thumbs/' . $other_images['products_images_image'], 'image_link' => $products_images_dir . $other_images['products_images_image'], 'image_title' => $image_title); } $boxContent = tep_show_images_carousel($products_images, 'pic' . $product_info['products_id']); if (tep_not_null($boxContent)) { include DIR_WS_TEMPLATES_BOXES . 'box1.php'; } } }
//if ($i == 0) echo TEXT_PRODUCTS_INFO; ?> <?php if ($i == 0) { echo "Short Description: "; } ?> </td> <td><table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_info[' . $languages[$i]['id'] . ']', 'soft', '70', '2', isset($products_info[$languages[$i]['id']]) ? $products_info[$languages[$i]['id']] : tep_get_products_info($pInfo->products_id, $languages[$i]['id'])); ?> </td> </tr> </table></td> </tr> <?php } for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?> <tr> <td class="main" valign="top" nowrap><?php if ($i == 0) { echo "Featured Description: "; } ?>
} $breadcrumb->add($page['pages_name'], tep_href_link(FILENAME_REVIEWS)); $reviews_id = isset($HTTP_GET_VARS['reviews_id']) ? $HTTP_GET_VARS['reviews_id'] : 0; $reviews_types_id = ''; if (isset($HTTP_GET_VARS['tName'])) { $tname = $HTTP_GET_VARS['tName']; if (substr($tname, -1) == '/') { $tname = substr($tname, 0, -1); } list($type_name) = explode('/', $tname); $type_info_query = tep_db_query("select * from " . TABLE_REVIEWS_TYPES . " where reviews_types_path = '" . tep_db_input(tep_db_prepare_input($type_name)) . "' and language_id = '" . (int) $languages_id . "'"); $type_info = tep_db_fetch_array($type_info_query); $reviews_types_id = $type_info['reviews_types_id']; if ($reviews_types_id > 0) { $breadcrumb->add($type_info['reviews_types_name'], tep_href_link(FILENAME_REVIEWS, 'tPath=' . $reviews_types_id)); if ($reviews_id > 0) { $review_check_query = tep_db_query("select count(*) as total from " . TABLE_REVIEWS . " where reviews_id = '" . (int) $reviews_id . "' and reviews_types_id = '" . (int) $reviews_types_id . "'"); $review_check = tep_db_fetch_array($review_check_query); if ($review_check['total'] < 1) { tep_redirect(tep_href_link(FILENAME_ERROR_404)); } } } elseif (trim($HTTP_GET_VARS['tName']) != '') { tep_redirect(tep_href_link(FILENAME_ERROR_404)); } unset($HTTP_GET_VARS['tName']); } if (tep_not_null($HTTP_GET_VARS['products_id'])) { $breadcrumb->add(tep_get_products_info($HTTP_GET_VARS['products_id']), tep_href_link(FILENAME_REVIEWS, 'tPath=' . $reviews_types_id . '&products_id=' . $HTTP_GET_VARS['products_id'])); } require DIR_WS_INCLUDES . 'application_bottom.php';
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_REVIEWS_RESULTS, 'reviews_id'); if ($listing_split->number_of_rows > 0) { $listing_query = tep_db_query($listing_split->sql_query); while ($listing = tep_db_fetch_array($listing_query)) { $product_info_query = tep_db_query("select authors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int) $listing['products_id'] . "'"); $product_info = tep_db_fetch_array($product_info_query); if (!is_array($product_info)) { $product_info = array(); } $author_info_query = tep_db_query("select authors_name from " . TABLE_AUTHORS . " where authors_id = '" . (int) $product_info['authors_id'] . "' and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "'"); $author_info = tep_db_fetch_array($author_info_query); if (!is_array($author_info)) { $author_info = array(); } $product_info = array_merge($product_info, $author_info); $title = tep_get_products_info($listing['products_id'], DEFAULT_LANGUAGE_ID); if (tep_not_null($product_info['authors_name'])) { $title = $product_info['authors_name'] . ': ' . $title; } $show_full_description = false; $reviews_description = $listing['reviews_text']; $reviews_description = str_replace('<br />', "\n", $reviews_description); $reviews_description = str_replace('<p>', '', $reviews_description); $reviews_description = str_replace('</p>', "\n\n", $reviews_description); while (strpos($reviews_description, "\n\n") !== false) { $reviews_description = trim(str_replace("\n\n", "\n", $reviews_description)); } $reviews_short_description = tep_cut_string($reviews_description, 300); if (strlen($reviews_description) > 300) { $reviews_short_description .= '...'; $show_full_description = true;