set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } # Fine */ require_once (DIR_WS_LANGUAGES . $language . '/' . FILENAME_RECENTLY_VIEWED); $error = ''; // Check that the customer has viewed some products if (tep_session_is_registered ('recently_viewed') && strlen ($_SESSION['recently_viewed']) > 0) { $recently_viewed_string = $_SESSION['recently_viewed']; // Deal with sessions created by the previous version if (substr_count ($recently_viewed_string, ';') > 0) { $_SESSION['recently_viewed'] = ''; $recently_viewed_string = ''; } // Turn the string of product IDs into an array in the correct order $recently_viewed_string = strtr ($recently_viewed_string, ',,', ','); // Remove blank values $recently_viewed_array = explode (',', $recently_viewed_string); // Array is in order newest first if (RECENTLY_VIEWED_DISPLAY_ORDER == 'Oldest') { // Reverse the order if set in Admin $recently_viewed_array = array_reverse ($recently_viewed_array); } // Get the information to set up the products for the current page $number_of_products = count ($recently_viewed_array); // Total number of products viewed $current_page_number = 1; if (isset ($_GET['page']) && $_GET['page'] > 1) { $current_page_number = (int) $_GET['page']; } $number_of_pages = ceil ($number_of_products / MAX_DISPLAY_RECENTLY_VIEWED_PAGE_PRODUCTS); if ($current_page_number > $number_of_pages) { $current_page_number = $number_of_pages; } $product_start = ($current_page_number - 1) * MAX_DISPLAY_RECENTLY_VIEWED_PAGE_PRODUCTS; $product_limit = $current_page_number * MAX_DISPLAY_RECENTLY_VIEWED_PAGE_PRODUCTS; if ($number_of_products - $product_start < $product_limit) { $product_limit = $number_of_products - $product_start; } // Limit the recently viewed array to the products we want to show on this page $recently_viewed_array = array_slice ($recently_viewed_array, $product_start, $product_limit); // Retrieve the data on the products in the recently viewed list and load into an array in the correct order $products_data = array(); foreach ($recently_viewed_array as $products_id) { $products_query = tep_db_query ("select m.manufacturers_name, p.products_id, p.products_restriction, pd.products_name, p.products_image, p.products_tax_class_id, p.products_date_added, pd.products_description, s.status, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id = p.manufacturers_id left join " . TABLE_SPECIALS . " s on s.products_id = p.products_id where p.products_id in (" . $recently_viewed_string . ") and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and p.products_id = '" . (int) $products_id . "' "); $products = tep_db_fetch_array ($products_query); // Truncate the description and add More Information link if set in Admin $show_more = ''; $description = $products['products_description']; if (MAX_RECENTLY_VIEWED_PAGE_DESCRIPTION_LENGTH > 0) { $description_length = strlen ($description); if ($description_length > MAX_RECENTLY_VIEWED_PAGE_DESCRIPTION_LENGTH) { $description = tep_limit_text ($description, MAX_RECENTLY_VIEWED_PAGE_DESCRIPTION_LENGTH, MAX_WORD_LENGTH); if (RECENTLY_VIEWED_PAGE_SHOW_MORE == 'Shorter') { $show_more = TEXT_SHOW_MORE; } // if (RECENTLY_VIEWED_PAGE_SHOW_MORE } // if ($description_length } // if (MAX_DISPLAY_RECENTLY_VIEWED_PAGE_DESCRIPTION_LENGTH if (RECENTLY_VIEWED_PAGE_SHOW_MORE == 'All') { $show_more = TEXT_SHOW_MORE; } // if (RECENTLY_VIEWED_PAGE_SHOW_MORE $products_data[$products_id] = array ('products_id' => $products_id, 'products_restriction' => $products['products_restriction'], 'manufacturers_name' => $products['manufacturers_name'], 'products_name' => $products['products_name'], 'products_image' => $products['products_image'], 'products_tax_class_id' => $products['products_tax_class_id'], 'products_date_added' => $products['products_date_added'], 'products_description' => $description, 'show_more' => $show_more, 'specials_status' => $products['status'], 'specials_new_products_price' => $products['specials_new_products_price'], 'products_price' => $products['products_price'] ); } // foreach ($recently_viewed_array if (count ($products_data) == 0) { // Show message if we don't have any products in the array $error = ERROR_NO_PRODUCTS_VIEWED; } } else { // Show message if we don't have a session or variable is empty $error = ERROR_NO_PRODUCTS_VIEWED; } $breadcrumb->add (NAVBAR_TITLE, tep_href_link (FILENAME_RECENTLY_VIEWED)); ?> > <?php echo TITLE . ' ' . HEADING_TITLE; ?>
0) { ?> 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?>
 
"; $show = 1; if($products['products_restriction']){ if(tep_session_is_registered('customer_id')){ if($data < $_SESSION['customer_dob']){ $error_restriction = 'non hai raggiunto la maggior età'; $show = 0; } } else { $error_restriction = 'non sei loggato o non hai raggiunto la maggior età'; $show = 0; } } if($show == 1){ //EOF Product restriction $products_price = $currencies->display_price ($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); if ($products['specials_status'] == 1) { $products_price = '' . $products_price . '' . $currencies->display_price($products['specials_new_products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . ''; } // if ($products['specials_status'] // Add the Show More link to the description if set $description = $products['products_description']; if ($products['show_more'] != '') { $description = $products['products_description'] . '' . $products['show_more'] . ''; } // Add CSS row classes for highlighting $rows++; if (($rows/2) == floor($rows/2)) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?> '. tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); $lc_text .= tep_draw_hidden_field('products_id', $products['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . ' '. '
'; $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { // product has attributes $lc_text .= '' . TEXT_PRICE . ' ' . '' . $products_price . '
' .TEXT_PRODUCT_OPTIONS . '
'; $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $products['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($products['products_tax_class_id'])) .') '; } //($products_options['options_values_price'] != '0') { } //while ($products_options = tep_db_fetch_array($products_options_query)) { if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } //if (isset($cart->contents $lc_text .= ''. $products_options_name['products_options_name'] . ':' .''. '' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '
'; $lc_text .= '   '; $lc_text .= '
'; }//while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $lc_text .= ''; if ($products['manufacturers_name'] != '') { ?> '; ?> '; ?> '') { } // if ($products_attributes['total'] > 0) { ?>
' . tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ''; ?>
' . $products['products_name'] . '

' /*. $description;*/ ?>
' . $products['manufacturers_name'] . '

' . $lc_text . ' ' . ''; ?> '') { ?>
 ' . ''; ?> ' . $products['manufacturers_name'] . '

' . TEXT_PRICE . ' ' . '' . $products_price . '

' . '  ' . '' . '' . '' . '
' . tep_draw_hidden_field('products_id', $products['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '
' . $products_price . '


' . '  ' . '' . '' . '' . '
' . tep_draw_hidden_field('products_id', $products['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '
ATTENZIONE: Alcuni prodotti, destinati ad un pubblico adulto, non possono essere visualizzati in quanto