Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / New Featured Products wrong price and name

New Featured Products wrong price and name

Locked

Views: 1,618

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
2 Sep 2010, 2:36 PM
#1
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

New Featured Products wrong price and name

Greetings;

The Template i brought, the Featured Products didnt look like the rest of the template, i am guessing they forgot to change this file... :)

I have modified the file however atm it is showing the right pictures and the link to the images are right, but the Products name and price is wrong.

The file was copy from "new Products" and modified, i believe it is still bringing up the products name and price from the new products listing,

Anyone see anything that is wrong in this code that might cause this problem ?

// show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
    $col_width = floor(100/$num_products_count);
  } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
  }
  while (!$featured_products->EOF) {

    $products_price = zen_get_products_display_price($featured_products->fields['products_id']);

    $list_box_contents[$row][$col] = array('params' =>'class="smalltext"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a><br />' . $products_price);

    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS - 1)) {
      $col = 0;
      $row ++;
    }
    $featured_products->MoveNextRandom();
  }

Site: https://www.theesotericemporium.com

6 Sep 2010, 9:28 AM
#2
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

Any Suggestions ?

6 Sep 2010, 2:41 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

Somewhere about that code is the SELECT statement ... perhaps you have an error/typo in it ... or are missing a field ... etc.

7 Sep 2010, 4:26 PM
#4
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

Ajeh:

Somewhere about that code is the SELECT statement ... perhaps you have an error/typo in it ... or are missing a field ... etc.

Yep, but for the life of me, i cant find out where the coding is wrong.... :(

7 Sep 2010, 10:32 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

It is hard to guess what you have changed in the code to be able to speculate what might be wrong ... :unsure:

7 Sep 2010, 11:51 PM
#6
nigelt74 avatar

nigelt74

Totally Zenned

Join Date:
Sep 2005
Location:
Waikato, New Zealand
Posts:
1,558
Plugin Contributions:
1

Re: New Featured Products wrong price and name

Have you tried querying the people you brought the template from, they may fix it free of charge if it is an oversight on their behalf regarding the featured products section, assuming it is these guys or at least thats what your template says

8 Sep 2010, 7:18 AM
#7
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

nigelt74:

Have you tried querying the people you brought the template from, they may fix it free of charge if it is an oversight on their behalf regarding the featured products section, assuming it is these guys or at least thats what your template says

It was brought from algozone.com, i have just sent an email to them asking if there is the file because this one is unmodified.

see what happens.

Thanks all for the help

8 Sep 2010, 6:10 PM
#8
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

Delights:

It was brought from algozone.com, i have just sent an email to them asking if there is the file because this one is unmodified.

see what happens.

Thanks all for the help

Thank you for your reply,

As you can see in the demo we only have new products module included http://demo.algozone.com/zencart/ZC03C00240/

We did not change Featured products listing from original layout of ZenCart.
If you interested, we can do this customization for you for $50.00. This can be completed in 1-2 business days.

That is the responce i got from them

8 Sep 2010, 6:46 PM
#9
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

Okay, got it so the price is now working, however it isnt showing the Product name, that is the only thing left to fix...

<?php
/**
 * featured_products module - prepares content for display
 *
 * @package modules
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: featured_products.php 3012 2006-02-11 16:34:02Z wilt $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
  $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
} else {
  $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id), " .
  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_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

}
$featured_products = $db->ExecuteRandomMulti($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);

$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';

$num_products_count = $featured_products->RecordCount();

// show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
    $col_width = floor(100/$num_products_count);
  } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
  }
  while (!$featured_products->EOF) {

		$product_query = "select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$featured_products->fields['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'";
		$product_info = $db->Execute($product_query);

      $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
			$products_price = str_replace('$', '<small>$</small>', $products_price);
      $featured_products->fields['products_name'] = zen_get_products_name($featured_products->fields['products_id']);

			#PR Build product information box
			$product_info_str  = '<table class="productBoxHeading_tb" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxHeadingLcorner"></td>';
			$product_info_str .= '<td class="productBoxHeading">' . '<span class="productBoxPrice floatRight">' . $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
			$product_info_str .= '<td class="productBoxHeadingRcorner"></td>';
			$product_info_str .= '</tr></table>';
	
			$product_info_str .= '<table class="productBoxOuter" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxLSide"> </td>';
			$product_info_str .= '<td class="productBoxMSide" valign="top">';
	
			$product_info_str .= '<table class="productBox" width="100%" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxImage" width="118">';
			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			$product_info_str .= '</td><td class="productBoxContent" valign="top">';
	
			$product_info_str .= '<table width="100%" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxDescription" valign="top">';
			$product_info_str .= (strlen($product->fields['products_description']) > 50) ? substr(strip_tags($product->fields['products_description']), 0, 50) . '…' : strip_tags($product->fields['products_description']);
			$product_info_str .= '</td></tr><tr><td>';
			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_more_info.gif" class="noborder" alt="" />' . '</a>';
			$product_info_str .= '</td></tr><tr><td height="4"></td></tr><tr><td>';
			$product_info_str .= '<a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_buy_now.gif" class="noborder" alt="" />' . '</a>';
			$product_info_str .= '</td></tr></table>';
	
			$product_info_str .= '</td';
			$product_info_str .= '</tr></table>'; // productBoxContent
	
			$product_info_str .= '</td>';
			$product_info_str .= '<td class="productBoxRSide"> </td>';
			$product_info_str .= '</tr></table>';
	
			$product_info_str .= '<table class="productBoxBottom_tb" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxLBottom"></td>';
			$product_info_str .= '<td class="productBoxMBottom"></td>';
			$product_info_str .= '<td class="productBoxRBottom"></td>';
			$product_info_str .= '</tr></table>';
	
			$list_box_contents[$row][$col] = array('align' => 'center',
																						 'params' => 'class="smallText" width="49%" valign="top"',
																						 'text' => $product_info_str);
	
			$col ++;
			if ($col > 1) {
				$col = 0;
				$row ++;
			}
      $featured_products->MoveNextRandom();
    }

  if ($featured_products->RecordCount() > 0) {
    if (isset($new_products_category_id) && $new_products_category_id !=0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id);
      $title = TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '');
    } else {
      $title = TABLE_HEADING_FEATURED_PRODUCTS;
    }
    $zc_show_featured = true;
  }
}
?>
8 Sep 2010, 8:50 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

I am not quite sure what you are doing with this code, but the main error is you are selecting information to:
$product_info

and then referencing it as:
$product->fields

Try using:
$product_info->fields

9 Sep 2010, 6:27 AM
#11
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

Greetings, that product_info fixed the descriptions... (Whooo) but still isnt showing the product name..

What i am trying to do is using "New Products" as a base, trying to modify "Featured Products" so that it looks like the rest of the template.

<?php
/**
 * featured_products module - prepares content for display
 *
 * @package modules
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: featured_products.php 3012 2006-02-11 16:34:02Z wilt $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
  $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
} else {
  $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id), " .
  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_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

}
$featured_products = $db->ExecuteRandomMulti($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);

$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';

$num_products_count = $featured_products->RecordCount();

// show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
    $col_width = floor(100/$num_products_count);
  } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
  }
  while (!$featured_products->EOF) {

		$product_query = "select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$featured_products->fields['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'";
		$product_info = $db->Execute($product_query);

      $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
			$products_price = str_replace('$', '<small>$</small>', $products_price);
      $featured_products->fields['products_name'] = zen_get_products_name($featured_products->fields['products_id']);

			#PR Build product information box
			$product_info_str  = '<table class="productBoxHeading_tb" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxHeadingLcorner"></td>';
			$product_info_str .= '<td class="productBoxHeading">' . '<span class="productBoxPrice floatRight">' . $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
			$product_info_str .= '<td class="productBoxHeadingRcorner"></td>';
			$product_info_str .= '</tr></table>';
	
			$product_info_str .= '<table class="productBoxOuter" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxLSide"> </td>';
			$product_info_str .= '<td class="productBoxMSide" valign="top">';
	
			$product_info_str .= '<table class="productBox" width="100%" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxImage" width="118">';
			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			$product_info_str .= '</td><td class="productBoxContent" valign="top">';
	
			$product_info_str .= '<table width="100%" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxDescription" valign="top">';
			$product_info_str .= (strlen($product_info->fields['products_description']) > 50) ? substr(strip_tags($product_info->fields['products_description']), 0, 50) . '…' : strip_tags($product_info->fields['products_description']);
			$product_info_str .= '</td></tr><tr><td>';
			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_more_info.gif" class="noborder" alt="" />' . '</a>';
			$product_info_str .= '</td></tr><tr><td height="4"></td></tr><tr><td>';
			$product_info_str .= '<a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_buy_now.gif" class="noborder" alt="" />' . '</a>';
			$product_info_str .= '</td></tr></table>';
	
			$product_info_str .= '</td';
			$product_info_str .= '</tr></table>'; // productBoxContent
	
			$product_info_str .= '</td>';
			$product_info_str .= '<td class="productBoxRSide"> </td>';
			$product_info_str .= '</tr></table>';
	
			$product_info_str .= '<table class="productBoxBottom_tb" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxLBottom"></td>';
			$product_info_str .= '<td class="productBoxMBottom"></td>';
			$product_info_str .= '<td class="productBoxRBottom"></td>';
			$product_info_str .= '</tr></table>';
	
			$list_box_contents[$row][$col] = array('align' => 'center',
																						 'params' => 'class="smallText" width="49%" valign="top"',
																						 'text' => $product_info_str);
	
			$col ++;
			if ($col > 1) {
				$col = 0;
				$row ++;
			}
      $featured_products->MoveNextRandom();
    }

  if ($featured_products->RecordCount() > 0) {
    if (isset($new_products_category_id) && $new_products_category_id !=0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id);
      $title = TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '');
    } else {
      $title = TABLE_HEADING_FEATURED_PRODUCTS;
    }
    $zc_show_featured = true;
  }
}
?>
9 Sep 2010, 4:14 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

You are not displaying the products_name ... :eek:

It looks like the only reference to the products_name is the ALT tag for the image ... :unsure:

10 Sep 2010, 6:12 AM
#13
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

Ajeh:

You are not displaying the products_name ... :eek:

It looks like the only reference to the products_name is the ALT tag for the image ... :unsure:

No ideas on what i need to add or what not to get it working ?

10 Sep 2010, 1:43 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

You need to add the product name somewhere in your code if you want it to display, example:

			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a>';
11 Sep 2010, 1:24 AM
#15
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: New Featured Products wrong price and name

One small thing and then it is complete..

They have the $ sign to be in red, how did they do that ?

here is the coding so far;

<?php
/**
 * featured_products module - prepares content for display
 *
 * @package modules
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: featured_products.php 3012 2006-02-11 16:34:02Z wilt $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
  $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
} else {
  $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id), " .
  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_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";

}
$featured_products = $db->ExecuteRandomMulti($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);

$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';

$num_products_count = $featured_products->RecordCount();

// show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS == 0) {
    $col_width = floor(100/$num_products_count);
  } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_FEATURED_PRODUCTS);
  }
  while (!$featured_products->EOF) {

		$product_query = "select products_name, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$featured_products->fields['products_id'] . "' and language_id = '" . (int)$_SESSION['languages_id'] . "'";
		$product_info = $db->Execute($product_query);

      $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
			$products_price = str_replace('$', '<small>$</small>', $products_price);
      $featured_products->fields['products_name'] = zen_get_products_name($featured_products->fields['products_id']);

			#PR Build product information box
			$product_info_str  = '<table class="productBoxHeading_tb" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxHeadingLcorner"></td>';
			$product_info_str .= '<td class="productBoxHeading">' . '<span class="productBoxPrice floatRight">' . $products_price = zen_get_products_display_price($featured_products->fields['products_id']) . '</span>' . $featured_products->fields['products_name'] . '</td>';
			$product_info_str .= '<td class="productBoxHeadingRcorner"></td>';
			$product_info_str .= '</tr></table>';
	
			$product_info_str .= '<table class="productBoxOuter" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxLSide"> </td>';
			$product_info_str .= '<td class="productBoxMSide" valign="top">';
	
			$product_info_str .= '<table class="productBox" width="100%" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxImage" width="118">';
			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			$product_info_str .= '</td><td class="productBoxContent" valign="top">';
	
			$product_info_str .= '<table width="100%" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxDescription" valign="top">';
			$product_info_str .= (strlen($product_info->fields['products_description']) > 50) ? substr(strip_tags($product_info->fields['products_description']), 0, 50) . '…' : strip_tags($product_info->fields['products_description']);
			$product_info_str .= '</td></tr><tr><td>';
			$product_info_str .= '<a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_more_info.gif" class="noborder" alt="" />' . '</a>';
			$product_info_str .= '</td></tr><tr><td height="4"></td></tr><tr><td>';
			$product_info_str .= '<a href="' . zen_href_link(basename($PHP_SELF), zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . '<img src="'. DIR_WS_TEMPLATE_IMAGES .'az_buy_now.gif" class="noborder" alt="" />' . '</a>';
			$product_info_str .= '</td></tr></table>';
	
			$product_info_str .= '</td';
			$product_info_str .= '</tr></table>'; // productBoxContent
	
			$product_info_str .= '</td>';
			$product_info_str .= '<td class="productBoxRSide"> </td>';
			$product_info_str .= '</tr></table>';
	
			$product_info_str .= '<table class="productBoxBottom_tb" width="241" cellspacing="0" cellpadding="0"><tr>';
			$product_info_str .= '<td class="productBoxLBottom"></td>';
			$product_info_str .= '<td class="productBoxMBottom"></td>';
			$product_info_str .= '<td class="productBoxRBottom"></td>';
			$product_info_str .= '</tr></table>';
	
			$list_box_contents[$row][$col] = array('align' => 'center',
																						 'params' => 'class="smallText" width="49%" valign="top"',
																						 'text' => $product_info_str);
	
			$col ++;
			if ($col > 1) {
				$col = 0;
				$row ++;
			}
      $featured_products->MoveNextRandom();
    }

  if ($featured_products->RecordCount() > 0) {
    if (isset($new_products_category_id) && $new_products_category_id !=0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id);
      $title = TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '');
    } else {
      $title = TABLE_HEADING_FEATURED_PRODUCTS;
    }
    $zc_show_featured = true;
  }
}
?>
11 Sep 2010, 4:23 AM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

Nothing in the code you just posted is red ...

Are you seeing something red on the screen somewhere? :unsure:

11 Sep 2010, 4:26 AM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: New Featured Products wrong price and name

Are you referring to the $ that is red on the price that is manage by the stylesheet for the:

.productBoxPrice small {
color:#D02100 !important;
font-size:12px !important;
}