set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } # Fine */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW)); ?> > <?php echo TITLE; ?>
number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?>
display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?> display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?>
number_of_rows > 0) { // BOF Separate Pricing Per Customer // global variable (session): $sppc_customers_group_id -> local variable $customer_group_id if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } $products_new_query = tep_db_query($products_new_split->sql_query); $no_of_products_new = tep_db_num_rows($products_new_query); while ($_products_new = tep_db_fetch_array($products_new_query)) { $products_new[] = $_products_new; $list_of_prdct_ids[] = $_products_new['products_id']; } $select_list_of_prdct_ids = "products_id = '" . $list_of_prdct_ids[0] . "' "; if ($no_of_products_new > 1) { for ($n = 1 ; $n < count($list_of_prdct_ids) ; $n++) { $select_list_of_prdct_ids .= "or products_id = '" . $list_of_prdct_ids[$n] . "' "; } } // get all customers_group_prices for products with the particular customer_group_id // however not necessary for customer_group_id zero if ($customer_group_id != '0') { $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where (" . $select_list_of_prdct_ids . ") and pg.customers_group_id = '" . $customer_group_id . "'"); while ($pg_array = tep_db_fetch_array($pg_query)) { $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => ''); } for ($x = 0; $x < $no_of_products_new; $x++) { // replace products prices with those from customers_group table // originally they would be obtained with an extra query for every new product: // if ($new_price = tep_get_products_special_price($products_new['products_id'])) { if (!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if ($products_new[$x]['products_id'] == $new_prices[$i]['products_id'] ) { $products_new[$x]['products_price'] = $new_prices[$i]['products_price']; } } } // end if (!empty($new_prices) } // end for ($x = 0; $x < $no_of_products_new; $x++) } // end if ($customer_group_id != '0') // an extra query is needed for all the specials $specials_query = tep_db_query("select s.products_id, specials_new_products_price from " . TABLE_SPECIALS . " s where (".$select_list_of_prdct_ids.") and status = '1' and s.customers_group_id = '" .$customer_group_id. "'"); while ($specials_array = tep_db_fetch_array($specials_query)) { $new_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price']); } //BOF Product restriction $restricted = 0; $data = mktime(0,0,0,date("m"),date("d"),date("Y")-18)."
"; //EOF Product restriction // replace specials_new_products_price with those those for the customers_group_id for ($x = 0; $x < $no_of_products_new; $x++) { if (!empty($new_prices)) { for ($i = 0; $i < count($new_prices); $i++) { if ( $products_new[$x]['products_id'] == $new_prices[$i]['products_id'] ) { $products_new[$x]['specials_new_products_price'] = $new_prices[$i]['specials_new_products_price']; } } } // end if (!empty($new_prices) if (tep_not_null($products_new[$x]['specials_new_products_price'])) { $products_price = '' . $currencies->display_price($products_new[$x]['products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])) . '' . $currencies->display_price($products_new[$x]['specials_new_products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])) . ''; } else { $products_price = $currencies->display_price($products_new[$x]['products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])); } //BOF Product restriction $show = 1; if($products_new[$x]['products_restriction']){ if(tep_session_is_registered('customer_id')){ if($data < $_SESSION['customer_dob']){ $show = 0; $error_restriction = 'non hai raggiunto la maggior età'; } } else { $show = 0; $error_restriction = 'non sei loggato o non hai raggiunto la maggior età'; } } if($show == 1){ //EOF Product restriction ?> 0){ ?>
' . tep_image(DIR_WS_IMAGES . $products_new[$x]['products_image'], $products_new[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ''; ?> ' . $products_new[$x]['products_name'] . '
' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new[$x]['products_date_added']) . '
' . TEXT_MANUFACTURER . ' ' . $products_new[$x]['manufacturers_name'] . '

' . TEXT_PRICE . ' ' . $products_price; ?>
' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . ''; ?>
ATTENZIONE: Alcuni prodotti, destinati ad un pubblico adulto, non possono essere visualizzati in quanto
display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?> display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?>