add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
?>
>
|
|
number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (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 Price Per Customer
// global variable (session): $sppc_customers_group_id -> local variable $customer_group_id
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
}
$row = 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
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']);
}
// 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)
// } // end for ($x = 0; $x < $no_of_products_new; $x++)
if (tep_not_null($products_new[$x]['specials_new_products_price'])) {
$products_base_price = tep_get_products_display_price($products_new[$x]['products_id'], true);
$products_price = ' ' . UPTO_NOW .' ' . $currencies->display_price2($products_new[$x]['products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])) . ' ' . PRICE_NOW . $currencies->display_price($products_new[$x]['specials_new_products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])) . ' ' . $products_base_price ;
//$products_price = ' ' . UPTO_NOW .' ' . $currencies->display_price2($products_new[$x]['products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])) . ' ' . PRICE_NOW . $currencies->display_price($products_new[$x]['products_tax_class_id'])) . ' ' . '';
} else {
$products_base_price = tep_get_products_display_price($products_new[$x]['products_id'], true);
$products_price = $currencies->display_price($products_new[$x]['products_price'], tep_get_tax_rate($products_new[$x]['products_tax_class_id'])) . $products_base_price ;
}
?>
' . tep_image(DIR_WS_IMAGES . $products_new[$x]['products_image'], $products_new[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '
';
$short_query = tep_db_query("select * from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $products_new[$x]['products_id'] . "' and language_id = '" . $languages_id . "'");
$short_info = tep_db_fetch_array($short_query);
?>
0)
{
$difference = $priceold - $pricenew;
// $savings .= SAVINGS_YOU_SAVE;
// $savings .= $currencies->display_price2($difference, tep_get_tax_rate($product_info['products_tax_class_id']));
// $savings .= SAVINGS_THAT_MAKES;
$savings = round($difference/$priceold,2)*100;
}
else
{
$savings ='0';
}
$the_savings = '';
if (SHOW_PRODUCT_SAVINGS == 'true') {
$the_savings = '-'.$savings.' % ';
}
$my_from = '';
$family_query = tep_db_query("select products_family from " . TABLE_PRODUCTS . " where products_id='" . $products_new[$x]['products_id'] . "'");
$results = tep_db_fetch_array($family_query);
if ($results['products_family'] != '') {
$my_from = LISTING_TEXT_FROM;
}
?>
['.$v.'] ' . $mp3_info['products_image_xl_1'] .' ';
}
}
$mp3_2 = $mp3_info['products_image_xl_2'];
if ($mp3_2 != '')
{
$video = 'false';
if (preg_match("/youtube/i", $mp3_info['products_image_xl_2']))
{
$video = 'true';
$mp3_info['products_image_xl_2'] = 'Video';
}
$ext = pathinfo(DIR_WS_IMAGES.$mp3_2, PATHINFO_EXTENSION);
if ($ext == 'mp4')
{
$mp3_info['products_image_xl_2'] = 'Video';
}
if ($ext == 'mp3' || $video == 'true' || $ext == 'mp4' || $ext == 'mov')
{
$v = $v +1;
$mp3_play .= '['.$v.'] ' . $mp3_info['products_image_xl_2'] .' ';
}
}
$mp3_3 = $mp3_info['products_image_xl_3'];
if ($mp3_3 != '')
{
$video = 'false';
if (preg_match("/youtube/i", $mp3_info['products_image_xl_3']))
{
$video = 'true';
$mp3_info['products_image_xl_3'] = 'Video';
}
$ext = pathinfo(DIR_WS_IMAGES.$mp3_3, PATHINFO_EXTENSION);
if ($ext == 'mp4')
{
$mp3_info['products_image_xl_2'] = 'Video';
}
if ($ext == 'mp3' || $video == 'true' || $ext == 'mp4' || $ext == 'mov')
{
$v = $v +1;
$mp3_play .= '['.$v.'] ' . $mp3_info['products_image_xl_3'] .' ';
}
}
$mp3_4 = $mp3_info['products_image_xl_4'];
if ($mp3_4 != '')
{
$video = 'false';
if (preg_match("/youtube/i", $mp3_info['products_image_xl_4']))
{
$video = 'true';
$mp3_info['products_image_xl_4'] = 'Video';
}
$ext = pathinfo(DIR_WS_IMAGES.$mp3_4, PATHINFO_EXTENSION);
if ($ext == 'mp4')
{
$mp3_info['products_image_xl_2'] = 'Video';
}
if ($ext == 'mp3' || $video == 'true' || $ext == 'mp4' || $ext == 'mov')
{
$v = $v +1;
$mp3_play .= '['.$v.'] ' . $mp3_info['products_image_xl_4'] .' ';
}
}
$mp3_5 = $mp3_info['products_image_xl_5'];
if ($mp3_5 != '')
{
$video = 'false';
if (preg_match("/youtube/i", $mp3_info['products_image_xl_5']))
{
$video = 'true';
$mp3_info['products_image_xl_5'] = 'Video';
}
$ext = pathinfo(DIR_WS_IMAGES.$mp3_5, PATHINFO_EXTENSION);
if ($ext == 'mp4')
{
$mp3_info['products_image_xl_2'] = 'Video';
}
if ($ext == 'mp3' || $video == 'true' || $ext == 'mp4' || $ext == 'mov')
{
$v = $v +1;
$mp3_play .= '['.$v.'] ' . $mp3_info['products_image_xl_5'] .' ';
}
}
$mp3_6 = $mp3_info['products_image_xl_6'];
if ($mp3_5 != '')
{
$video = 'false';
if (preg_match("/youtube/i", $mp3_info['products_image_xl_6']))
{
$video = 'true';
$mp3_info['products_image_xl_6'] = 'Video';
}
$ext = pathinfo(DIR_WS_IMAGES.$mp3_6, PATHINFO_EXTENSION);
if ($ext == 'mp4')
{
$mp3_info['products_image_xl_2'] = 'Video';
}
if ($ext == 'mp3' || $video == 'true' || $ext == 'mp4' || $ext == 'mov')
{
$v = $v +1;
$mp3_play .= '['.$v.'] ' . $mp3_info['products_image_xl_6'] .' ';
}
}
$play_icon ='';
if ($mp3_play != '')
{
$header = '';
$footer = '';
$play_icon ='' . tep_image(DIR_WS_IMAGES . 'speaker.png', 'Playlist') . '';
}
$mediaplayer = '';
if (SHOW_MEDIA_PL == 'true')
{
$mediaplayer = '' . $play_icon .' ';
}
$listing[$x] = $products_new[$x];
$the_tooltip = '
' . tep_image(DIR_WS_IMAGES . $products_new[$x]['products_image'], $products_new[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'imageorig="' . DIR_WS_IMAGES . $products_new[$x]['products_image'] .' " style="position:relative;" id="' . $products_new[$x]['products_id'] .'"') . '
';
$short_query = tep_db_query("select * from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $products_new[$x]['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$short_info = tep_db_fetch_array($short_query);
if (SHOW_HOVER_BOX_NP == 'true')
{
?>
';
$lc_text .= '' . $the_tooltip . ' ';
if (tep_images_counter($listing[$x]['products_id']) > 0)
{
$lc_text .= '
';
$lc_text .= tep_image_list($listing[$x]['products_id']);
$lc_text .= ' ';
$lc_text .= ' ';
}
if (SHOW_SHORT_INFOS == 'true')
{
$lc_text .= ' ' . osc_trunc_string(strip_tags($short_info['products_description'], ''), 120) . ' ' . LISTING_MORE . '';
}
if (SHOW_STOCK_LISTS == 'true')
{
$lc_text .= ' ' . tep_get_product_list_ampel($listing[$x]['products_id'],$languages_id) . ' ';
}
if (tep_not_null($listing[$x]['specials_new_products_price'])) {
$priceold = $listing[$x]['products_price'];
$pricenew = $listing[$x]['specials_new_products_price'];
$difference = $priceold - $pricenew;
$savings = '-' . round($difference/$priceold,2)*100 . '%';
// $savings = '- round(' . $difference . '/' .$priceold . '2)*100 %';
$lc_text .= ' ' . $currencies->display_price2($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '' . $my_from . '' . $currencies->display_price2($pricenew, tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '
';
if (SHOW_PRODUCT_SAVINGS == 'true') {
$lc_text .= ' ' . $savings .' ';
}
if (SHOW_NEW_TAG == 'true')
{
if ((tep_dateDiff ($listing[$x]['products_last_modified']) <= MARK_NEW_TAG))
{
if (SHOW_PRODUCT_SAVINGS == 'true') {
$lc_text .= ' ' . LISTING_NEW .' ';
}
else
{
$lc_text .= ' ' . LISTING_NEW .' ';
}
}
}
}
else
{
if (SHOW_NEW_TAG == 'true')
{
if ((tep_dateDiff ($listing[$x]['products_last_modified']) <= MARK_NEW_TAG))
{
$lc_text .= ' ' . LISTING_NEW .' ';
}
}
$lc_text .= ' ' . $my_from . $currencies->display_price2($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' ';
}
$lc_text .= '';
echo $lc_text;
?>
|
number_of_rows; $x++)
} else {
?>
|
|
|
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'))); ?> |
|
|