Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Sort Order + SPPC : error in product_listing.php


Supertex

Recommended Posts

@@Jan Zonjee

@@geoffreywalton

 

I've had Product Sort Order for 2.3.1 installed for quite a while, and yesterday I added SPPC 4.2.2 & the listed bug fixes. I did it section-by-section with WinMerge.

 

With those files in place, when I pull up a category, my product listing is blank - no images, product names, models, weights...nothing except "$0.00" and the "Add to Cart" (or Buy Now) to the right.

 

I carefully looked over my prior version vs. the SPPC version of product_listing.php, and ensured the code snippets were added - as my ability will allow. I did this for all of the files in the contrib.

 

I then added the bug-fix files with no change evident while viewing a product list.

 

Out of curiosity, I added the previous version of product_listing.php back in, and it restored functionality. Of course it doesn't show the correct price according to customer level, but adding the product to the cart allows the customer to see "his" price. That leads me to believe the problem is in that particular file. I'm guessing my Product Sort Order snippets either need to be modified, or they're out of place in relation to the SPPC code.

 

I then went back according to the 2.3.1 instructions and looked at the "install_separate_price_422.html" file under the list of files for manual installation , and checked the code for the product_listing.php. The section for lines 93-133 are only remotely similar to my original file, and this is where my knowledge ends.

 

Perhaps someone can spot where I've gone wrong?

 

<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
?>
<div class="contentText">
<?php
if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<div>
 <span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>
 <span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
</div>
<br />
<?php
}
$prod_list_contents = '<div class="ui-widget infoBoxContainer">' .
				 ' <div class="ui-widget-header ui-corner-top infoBoxHeading">' .
				 ' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingHeader">' .
				 '	 <tr>';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
 case 'PRODUCT_LIST_MODEL':
 $lc_text = TABLE_HEADING_MODEL;
 $lc_align = 'center';
$lc_width = '135px';
 break;
 case 'PRODUCT_LIST_NAME':
 $lc_text = TABLE_HEADING_PRODUCTS;
 $lc_align = 'left';
$lc_width = '250px';
 break;
 case 'PRODUCT_LIST_MANUFACTURER':
 $lc_text = TABLE_HEADING_MANUFACTURER;
 $lc_align = '';
 break;
 case 'PRODUCT_LIST_PRICE':
 $lc_text = TABLE_HEADING_PRICE;
 $lc_align = 'center';
$lc_width = '60px';
 break;
 case 'PRODUCT_LIST_QUANTITY':
 $lc_text = TABLE_HEADING_QUANTITY;
 $lc_align = 'right';
 break;
 case 'PRODUCT_LIST_WEIGHT':
 $lc_text = TABLE_HEADING_WEIGHT;
 $lc_align = 'center';
$lc_width = '60px';
 break;
 case 'PRODUCT_LIST_IMAGE':
 $lc_text = TABLE_HEADING_IMAGE;
 $lc_align = 'left';
$lc_width = '120px';
 break;
 case 'PRODUCT_LIST_BUY_NOW':
 $lc_text = null;
 $lc_align = 'center';
$lc_width = '100px';
 break;
}
//sort order
if ($column_list[$col] == 'PRODUCT_LIST_SORT_ORDER'){break;}
if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') && ($column_list[$col] != 'PRODUCT_LIST_MULTIPLE')) {
// if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
//end sort order
 $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
}
$prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . (tep_not_null($lc_width) ? ' width="' . $lc_width . '"' : '') .'>' . $lc_text . '</td>';
}
$prod_list_contents .= '	 </tr>' .
					 ' </table>' .
					 ' </div>';
if ($listing_split->number_of_rows > 0) {
$rows = 0;
$listing_query = tep_db_query($listing_split->sql_query);
// BOF Separate Pricing per Customer
$no_of_listings = tep_db_num_rows($listing_query);
// global variable (session) $sppc_customer_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';
}
while ($_listing = tep_db_fetch_array($listing_query)) {
$listing[] = $_listing;
$list_of_prdct_ids[] = $_listing['products_id'];
}
// next part is a debug feature, when uncommented it will print the info that this module receives
/*
echo '<pre>';
print_r($listing);
echo '</pre>';
*/
// get all product prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
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 products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'");
// $no_of_pg_products = tep_db_num_rows($pg_query) ;
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' => '', 'final_price' => $pg_array['price']);
}
for ($x = 0; $x < $no_of_listings; $x++) {
// replace products prices with those from customers_group table
 if(!empty($new_prices)) {
 for ($i = 0; $i < count($new_prices); $i++) {
	 if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
	 $listing[$x]['products_price'] = $new_prices[$i]['products_price'];
	 $listing[$x]['final_price'] = $new_prices[$i]['final_price'];
 }
 }
 } // end if(!empty($new_prices)
$listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group
$listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price
} // end for ($x = 0; $x < $no_of_listings; $x++)
} // end if ($customer_group_id != '0')
// an extra query is needed for all the specials
$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and status = '1' and customers_group_id = '" . $customer_group_id . "'");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
}
// add the correct specials_new_products_price and replace final_price
for ($x = 0; $x < $no_of_listings; $x++) {
if(!empty($new_s_prices)) {
 for ($i = 0; $i < count($new_s_prices); $i++) {
 if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
 $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
 $listing[$x]['final_price'] = $new_s_prices[$i]['final_price'];
 }
 }
} // end if(!empty($new_s_prices)
} // end for ($x = 0; $x < $no_of_listings; $x++)
$prod_list_contents .= ' <div class="ui-widget-content ui-corner-bottom productListTable">' .
					 ' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingData">';
// while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
 $rows++;
 $prod_list_contents .= '	 <tr>';
 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
//sort order
 if ($column_list[$col] == 'PRODUCT_LIST_SORT_ORDER'){break;}
//end sort order
 switch ($column_list[$col]) {
	 case 'PRODUCT_LIST_MODEL':
	 $prod_list_contents .= '	 <td width="135" align="center">' . $listing['products_model'] . '</td>';
	 break;
	 case 'PRODUCT_LIST_NAME':
	 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
		 $prod_list_contents .= '	 <td width="250"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
	 } else {
		 $prod_list_contents .= '	 <td width="250"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
	 }
	 break;
	 case 'PRODUCT_LIST_MANUFACTURER':
	 $prod_list_contents .= '	 <td><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a></td>';
	 break;
	 case 'PRODUCT_LIST_PRICE':
	 if (tep_not_null($listing['specials_new_products_price'])) {
		 $prod_list_contents .= '	 <td width="60" align="center"><del>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</del>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></td>';
	 } else {
		 $prod_list_contents .= '	 <td width="60" align="center">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>';
	 }
	 break;
	 case 'PRODUCT_LIST_QUANTITY':
	 $prod_list_contents .= '	 <td align="right">' . $listing['products_quantity'] . '</td>';
	 break;
	 case 'PRODUCT_LIST_WEIGHT':
	 $prod_list_contents .= '	 <td width="60" align="center">' . $listing['products_weight'] . '</td>';
	 break;
	 case 'PRODUCT_LIST_IMAGE':
	 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
		 $prod_list_contents .= '	 <td width="105" align="left"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
	 } else {
		 $prod_list_contents .= '	 <td width="105" align="left"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
	 }
	 break;
	 case 'PRODUCT_LIST_BUY_NOW':
	 $prod_list_contents .= '	 <td width="100" align="right">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'null', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>';
	 break;
 }
 }
 $prod_list_contents .= '	 </tr>';
}
$prod_list_contents .= ' </table>' .
					 ' </div>' .
					 '</div>';
echo $prod_list_contents;
} else {
?>
<p><?php echo TEXT_NO_PRODUCTS; ?></p>
<?php
}
if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<br />
<div>
 <span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>
 <span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
</div>
<?php
}
?>
</div>

Link to comment
Share on other sites

@@Supertex

 

You can't use just $listing['products_model'], you need to change it to $listing[$x]['products_model']

 

This is just an example, same is for all other fields you want to display

 

This is because your loop is now as

 

 

for ($x = 0; $x < $no_of_listings; $x++) {

 

and $listing is like

 

 

while ($_listing = tep_db_fetch_array($listing_query)) {

$listing[] = $_listing;

$list_of_prdct_ids[] = $_listing['products_id'];

}

Link to comment
Share on other sites

Thank you for that. I added [$x] after every "$listing" I found in the "case" section, and now the product listing shows up and has accurate prices.

 

However, now the sort order is broken. Any Ideas on that?

 


<?php
/*
 $Id$

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2010 osCommerce

 Released under the GNU General Public License
*/

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
?>

 <div class="contentText">

<?php
 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>

   <div>
     <span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>

     <span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
   </div>

   <br />

<?php
 }

 $prod_list_contents = '<div class="ui-widget infoBoxContainer">' .
                       '  <div class="ui-widget-header ui-corner-top infoBoxHeading">' .
                       '    <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingHeader">' .
                       '      <tr>';

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
   $lc_align = '';

   switch ($column_list[$col]) {
     case 'PRODUCT_LIST_MODEL':
       $lc_text = TABLE_HEADING_MODEL;
       $lc_align = 'center';
$lc_width = '135px';
       break;
     case 'PRODUCT_LIST_NAME':
       $lc_text = TABLE_HEADING_PRODUCTS;
       $lc_align = 'left';
$lc_width = '250px';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $lc_text = TABLE_HEADING_MANUFACTURER;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_PRICE':
       $lc_text = TABLE_HEADING_PRICE;
       $lc_align = 'center';
$lc_width = '60px';
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $lc_text = TABLE_HEADING_QUANTITY;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $lc_text = TABLE_HEADING_WEIGHT;
       $lc_align = 'center';
$lc_width = '60px';
       break;
     case 'PRODUCT_LIST_IMAGE':
       $lc_text = TABLE_HEADING_IMAGE;
       $lc_align = 'left';
$lc_width = '120px';
       break;
     case 'PRODUCT_LIST_BUY_NOW':
       $lc_text = null;
       $lc_align = 'center';
$lc_width = '100px';
       break; 
   }

   //sort order
   if ($column_list[$col] == 'PRODUCT_LIST_SORT_ORDER'){break;}
   if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') && ($column_list[$col] != 'PRODUCT_LIST_MULTIPLE')) {
  // if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
//end sort order
     $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
   }

   $prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . (tep_not_null($lc_width) ? ' width="' . $lc_width . '"' : '') .'>' . $lc_text . '</td>';
 }

 $prod_list_contents .= '      </tr>' .
                        '    </table>' .
                        '  </div>';

 if ($listing_split->number_of_rows > 0) {
   $rows = 0;
   $listing_query = tep_db_query($listing_split->sql_query);
// BOF Separate Pricing per Customer
   $no_of_listings = tep_db_num_rows($listing_query);
// global variable (session) $sppc_customer_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';
 }

while ($_listing = tep_db_fetch_array($listing_query)) {
$listing[] = $_listing;
$list_of_prdct_ids[] = $_listing['products_id'];
}
// next part is a debug feature, when uncommented it will print the info that this module receives
/*
  echo '<pre>';
  print_r($listing);
  echo '</pre>';
*/

// get all product prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
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 products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'");
//   $no_of_pg_products = tep_db_num_rows($pg_query) ;
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' => '', 'final_price' => $pg_array['price']);
}
   for ($x = 0; $x < $no_of_listings; $x++) {
// replace products prices with those from customers_group table
     if(!empty($new_prices)) {
       for ($i = 0; $i < count($new_prices); $i++) {
      if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
      $listing[$x]['products_price'] = $new_prices[$i]['products_price'];
      $listing[$x]['final_price'] = $new_prices[$i]['final_price'];
    }
    }
  } // end if(!empty($new_prices)
$listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group
$listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price
  } // end for ($x = 0; $x < $no_of_listings; $x++)
} // end if ($customer_group_id != '0')

// an extra query is needed for all the specials

$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and status = '1' and customers_group_id = '" . $customer_group_id . "'");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
}

// add the correct specials_new_products_price and replace final_price
for ($x = 0; $x < $no_of_listings; $x++) {
   if(!empty($new_s_prices)) {
  for ($i = 0; $i < count($new_s_prices); $i++) {
  if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
  $listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
  $listing[$x]['final_price'] = $new_s_prices[$i]['final_price'];
  }
  }
} // end if(!empty($new_s_prices)
} // end for ($x = 0; $x < $no_of_listings; $x++)

   $prod_list_contents .= '  <div class="ui-widget-content ui-corner-bottom productListTable">' .
                          '    <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingData">';

//    while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
     $rows++;

     $prod_list_contents .= '      <tr>';

     for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
//sort order
       if ($column_list[$col] == 'PRODUCT_LIST_SORT_ORDER'){break;}
//end sort order
       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $prod_list_contents .= '        <td width="135" align="center">' . $listing[$x]['products_model'] . '</td>';
           break;
         case 'PRODUCT_LIST_NAME':
           if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
             $prod_list_contents .= '        <td width="250"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>';
           } else {
             $prod_list_contents .= '        <td width="250"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>';
           }
           break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $prod_list_contents .= '        <td><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a></td>';
           break;
         case 'PRODUCT_LIST_PRICE':
           if (tep_not_null($listing[$x]['specials_new_products_price'])) {
             $prod_list_contents .= '        <td width="60" align="center"><del>' .  $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</del>  <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span></td>';
           } else {
             $prod_list_contents .= '        <td width="60" align="center">' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</td>';
           }
           break;
         case 'PRODUCT_LIST_QUANTITY':
           $prod_list_contents .= '        <td align="right">' . $listing[$x]['products_quantity'] . '</td>';
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $prod_list_contents .= '        <td width="60" align="center">' . $listing[$x]['products_weight'] . '</td>';
           break;
         case 'PRODUCT_LIST_IMAGE':
           if (isset($HTTP_GET_VARS['manufacturers_id'])  && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
             $prod_list_contents .= '        <td width="105" align="left"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
           } else {
             $prod_list_contents .= '        <td width="105" align="left"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
           }
           break;
         case 'PRODUCT_LIST_BUY_NOW':
           $prod_list_contents .= '        <td width="100" align="right">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'null', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id'])) . '</td>';
           break;
       }
     }

     $prod_list_contents .= '      </tr>';
   }

   $prod_list_contents .= '    </table>' .
                          '  </div>' .
                          '</div>';

   echo $prod_list_contents;
 } else {
?>

   <p><?php echo TEXT_NO_PRODUCTS; ?></p>

<?php
 }

 if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>

   <br />

   <div>
     <span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>

     <span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
   </div>

<?php
 }
?>

 </div>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...