Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Specials not loading on infobox new_products.php


DrDre

Recommended Posts

hi all..

 

I have added the addon "easy advanced specials admin" .. which is great.. but i have seem to have come across a bug in it. It applies the specials on all my pages and modules .. except my new_products.php which is in /includes/modules/ ..

 

But the werid thing is... the new_products.php has a specials code in it "

 

<?php

$cat_path = false;

 

function thumbnail_new($products,$column_list,$border,$borderend) {

global $PHP_SELF,$cPath,$cat_path;

$currencies = new currencies();

$man_id = (tep_not_null($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : '');

$link = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id'] . ($man_id ? '&manufacturers_id='.$man_id : ($cPath && $cat_path ? '&cPath=' . $cPath : ''))) . '"' . ($man_id || ($cat_path && $cat_path) ? ' rel="nofollow"' : '') . '>';

$image = $products['products_image'];

$addimages = (file_exists(DIR_WS_CLASSES . 'displayimages.php')); // Additional Images Present

if ($addimages) {

$image_query = tep_db_query( "SELECT ai.medium_images, ai.images_description, ai.popup_images, p.products_image_med, p.products_image_description FROM " . TABLE_ADDITIONAL_IMAGES . " ai, " . TABLE_PRODUCTS . " p WHERE ai.products_id=p.products_id and ai.products_id = '".(int)$products['products_id']."'");

$selected_image = tep_db_fetch_array($image_query);

$image = ($selected_image['medium_images'] ? $selected_image['medium_images'] : ($selected_image['products_image_med'] ? $selected_image['products_image_med'] : ($selected_image['popup_images'] ? $selected_image['popup_images'] : $products['products_image'])));

}

$image = (!$grid && $column_list[0] == 'PRODUCT_LIST_IMAGE' ? '<br>' : '') . $link . tep_image(DIR_WS_IMAGES . $image, ($addimages ? (tep_not_null($selected_image['images_description']) ? $selected_image['images_description'] : (tep_not_null($selected_image['products_image_description']) ? $selected_image['products_image_description'] : $products['products_name'])) : $products['products_name']), PRODUCT_IMAGE_WIDTH, '') . '</a>' . '<br>';

$buypic = (LISTING_BUTTON == 'buy now' ? 'button_in_cart.gif' : 'button_buy_now.gif');

$button = (LISTING_BUTTON != 'none' && PRODUCT_LIST_BUY_NOW ? (LISTING_BUTTON == 'buy now & details' ? '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image_button($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"') . '</a> <span class="buy_now">|</span> ' . $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a><br><br>' : (strstr(LISTING_BUTTON, 'buy now') ? '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']) . '">' . tep_image_button($buypic, IMAGE_BUTTON_BUY_NOW) . '</a><br><br>' : '<br>' . $link . tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS) . '</a><br><br>' )) : ' ');

 

$name = $link . '<b>' . $products['products_name'] . '</b>' . '</a><br>'. ($products['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br>' . $products['short_desc'] . '<br>' : '');

$price = (function_exists(display_short_price)) ? $currencies->display_short_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) : $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id']));

if (tep_not_null($products['specials_new_products_price'])) {

$price = '<s>' . $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($products['specials_new_products_price'], tep_get_tax_rate($products['products_tax_class_id'])) . '</span>';

} if (function_exists(tep_get_att_price)) $price .= (tep_get_att_price($products['products_id']) > 0 ? '+' : '') ;

$show_price = '<br><font size="'.PRODUCT_PRICE_SIZE.'">' . ($products['products_price'] > 0 ? $price : 'P.O.A') . '<br></font>';

$quantity = ($products['products_quantity'] ? 'Stock = '.$products['products_quantity'] : 'Out of Stock').'<br />';

$weight = 'Weight = '.$products['products_weight'].'Kg<br />';

$model = $products['products_model'] . '<br>';

$manfact = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $products['manufacturers_id']) . '">' . $products['manufacturers_name'] . '</a><br>';

$display = $border;

for ($disp=0, $n=sizeof($column_list); $disp<$n; $disp++) {

switch ($column_list[$disp]) {

case 'PRODUCT_LIST_IMAGE':

$display .= '<table summary="" width="100%" ><tr><td style="text-align:center;" valign="top" height="'.PRODUCT_IMAGE_VSPACE.'" >'.$image.'</td></tr></table>';

break;

case 'PRODUCT_LIST_NAME':

$display .= '<table summary=""><tr><td class="thumbcontent" height="'.PRODUCT_NAME_VSPACE.'" >'.$name.'</td></tr></table>';

break;

case 'PRODUCT_LIST_MODEL':

$display .= $model;

break;

case 'PRODUCT_LIST_MANUFACTURER':

$display .= $manfact;

break;

case 'PRODUCT_LIST_PRICE':

$display .= $show_price;

break;

case 'PRODUCT_LIST_QUANTITY':

$display .= $quantity;

break;

case 'PRODUCT_LIST_WEIGHT':

$display .= $weight;

break;

}

}

$display .= $borderend . $button;

return($display);

} // function end

 

$date = strtotime("-60 days"); // set max age of displayed product

$date = strftime("%Y-%m-%d",$date);

$grid = strstr(PRODUCT_THUMBNAIL_VIEW, 'grid');

$style = (!$grid ? 'class="smallText"' : 'class="infoBoxGrid"');

$border = (!$grid ? '<table class="infoBoxProducts" cellpadding="4" width="'.PRODUCT_LIST_WIDTH.'" height="'.PRODUCT_LIST_HEIGHT.'"><tr><td>' : '<br>');

$borderend = (!$grid ? '</td></tr></table>' : '');

$column_list = array('PRODUCT_LIST_IMAGE', 'PRODUCT_LIST_NAME' , 'PRODUCT_LIST_PRICE' );

 

 

$info_box_contents = array();

$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 

new infoBoxHeading($info_box_contents, true, false);

 

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

$row = 0;

$col = 0;

$info_box_contents = array();

while ($new_products = tep_db_fetch_array($new_products_query)) {

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => $style . ' width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" valign="top"',

'text' => (strstr(PRODUCT_THUMBNAIL_VIEW, 'list') ? '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) : thumbnail_new($new_products, $column_list,$border,$borderend)));

 

$col ++;

if ($col > PRODUCTS_PER_ROW-1) {

$col = 0;

$row ++;

}

}

 

new contentBox($info_box_contents);

?>

"

 

 

So i am hoping someone can help me.. this is a link to a page on my site "http://www.sportsandgames.co.tt/catalog/index.php?cPath=17" .. take a look at the new for december .. each one of those items should have the specials price listed there... but it doesnt show there.. if u go into the product info page.. u will see the discount price and the original price.. please help..

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...