Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

adding to product listing


tept

Recommended Posts

Posted

I'm trying to change and add to the product_listing.php but I'm getting errors if i make the additions. Can someone let me know what I need to do to be able to access products_free_shipping correctly?

 

here is my current working products_listing.php

 

<?php

/*

$Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Show Product If Only Result Mod

if(basename($_SERVER['PHP_SELF']) != FILENAME_ADVANCED_SEARCH_RESULT) $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

// Show Product If Only Result Mod

 

//line below is for debugging purposes

//echo $listing_sql;

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

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table>

<?php

}

$list_box_contents = array();

 

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

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_text = TABLE_HEADING_MODEL;

$lc_align = '';

break;

case 'PRODUCT_LIST_NAME':

$lc_text = TABLE_HEADING_PRODUCTS;

$lc_align = '';

break;

case 'PRODUCT_LIST_MANUFACTURER':

$lc_text = TABLE_HEADING_MANUFACTURER;

$lc_align = '';

break;

case 'PRODUCT_LIST_PRICE':

$lc_text = TABLE_HEADING_PRICE;

$lc_align = 'right';

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 = 'right';

break;

case 'PRODUCT_LIST_IMAGE':

$lc_text = TABLE_HEADING_IMAGE;

$lc_align = 'center';

break;

case 'PRODUCT_LIST_BUY_NOW':

$lc_text = TABLE_HEADING_BUY_NOW;

$lc_align = 'center';

break;

}

 

if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

}

 

$list_box_contents[0][] = array('align' => $lc_align,

'params' => 'class="productListing-heading"',

'text' => ' ' . $lc_text . ' ');

}

 

if ($listing_split->number_of_rows > 0) {

$rows = 0;

$listing_query = tep_db_query($listing_split->sql_query);

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

$rows++;

 

if (($rows/2) == floor($rows/2)) {

$list_box_contents[] = array('params' => 'class="productListing-even"');

} else {

$list_box_contents[] = array('params' => 'class="productListing-odd"');

}

 

$cur_row = sizeof($list_box_contents) - 1;

 

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

$lc_align = '';

 

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_align = '';

$lc_text = ' ' . $listing['products_model'];

break;

case 'PRODUCT_LIST_NAME':

$lc_align = '';

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

 

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $listing['manufacturers_id'] . // 8/12/2007 Somehow this was entered as $HTTP_GET_VARS['manufacturers_id'] which is wrong

'&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

} else {

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') .

'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>  ';

}

//Feb 3, 2008 - Implementation of NewItem&Video Flag: display html for new item or video if the flags are set to true

if((int)$listing['product_new_item_flag']) $lc_text .= TEXT_PRODUCTS_NEW_ITEM_FLAG;

if((int)$listing['product_video_flag']) $lc_text .= TEXT_PRODUCTS_VIDEO_FLAG;

 

//06/27/05 free_shipping_per_product_1.1 contribution implementation

//case modified to show free shipping

$lc_align = 'left';

if ($listing['products_free_shipping']) {

$lc_text = $lc_text . '<br><br><font color=red><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT . '</b> <img border="0" src="../images/Icon_FreeShipping_Small.gif">';

 

}else if($listing['products_weight']<MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX){

//April 15, 2007 Free Shipping Over $199 contribution implementation

//$lc_text = $lc_text . '<br><br><font color=red><b>' . $listing['products_weight'] . '</b>';

$lc_text = $lc_text . '<br><br><font color=red><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT_OVER199 . '</b> <img border="0" src="../images/Icon_FreeShipping_Over199.gif">';

}

break;

case 'PRODUCT_LIST_MANUFACTURER':

$lc_align = '';

// Added by J 10/28/03 //

$manufactures_id = $listing['manufacturers_id'];

$query = "select * from manufacturers where manufacturers_id = '$manufactures_id'";

//echo "$query";

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

$row = mysql_fetch_array($result);

$manufacturesimage = "$row[manufacturers_image]";

 

//Monday, February 09, 2004 10:23:42 AM

//takes out the link, leave just the image

//Friday, April 23, 2004 11:50:42 AM

//Took out the border width and height of the manufacturer logo

//Thursday, April 29, 2004 11:41:00 AM

//commented out the code to display logo so it will always show brand name

//if ($manufacturesimage)

//$lc_text = ' <IMG SRC="images/' . $manufacturesimage . '"> '; //original code: BORDER=0 WIDTH=80 HEIGHT=46

//else

$lc_text = ' ' . $listing['manufacturers_name'] . ' ';

break;

case 'PRODUCT_LIST_PRICE':

$lc_align = 'center';

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

//Thursday, February 05, 2004 4:01:11 PM

//Extension of the EZ New Fields v2.1 Implementation

//&lc_text changed to display the list price

$lc_text = '<s><strike>'. $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .

'</strike><font color=red size=2><b><br>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .

'</b></font></s>  <span class="productSpecialPrice">' .

$currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .

'</span> ';

}

//Monday, May 3, 2004 3:31 PM

//changed Call for rice" to "Email us for price"

//added image & hyperlink to contact form so that customers can email the store for price

if ($listing['products_price'] == '0.0000') { //4/9/2006 fixed a bug where html tags cause session error, unable to handle characters other than alphanumeric

$lc_text = '<a href="contact_us.php?subject=Price inquiry on '. $listing['manufacturers_name'] . ' - ' . $listing['products_model'] . '"><font color="#ff0000" size=2><b>Email for price!</b> <img border="0" src="/images/email_icon.gif"></font></a>';

 

//Thursday, February 05, 2004 4:01:11 PM

//Extension of the EZ New Fields v2.1 Implementation

//&lc_text changed to display the list price

}else {

if($listing['products_retail_price'] > '0.0000') {

$lc_text = '<strike>' . $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</strike><font color=red size=2><b><br>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</b></font> ';

} else {

$lc_text = 'N/A<br><font color=red size=2><b><br>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</b></font> ';

}

 

}

//End of Change

 

break;

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

$lc_text = ' ' . $listing['products_quantity'] . ' ';

break;

case 'PRODUCT_LIST_WEIGHT':

$lc_align = 'right';

$lc_text = ' ' . $listing['products_weight'] . ' ';

break;

case 'PRODUCT_LIST_IMAGE':

$lc_align = 'center';

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

$lc_text = '<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>';

} else {

$lc_text = ' <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> ';

}

break;

case 'PRODUCT_LIST_BUY_NOW':

if ($listing['products_price'] == '0.0000') {

$lc_text = "";

}//July 18 2005 indicate stock status

else if($listing['products_quantity'] < '1'){

//4/9/2006 fixed a bug where html tags cause session error, unable to handle characters other than alphanumeric

$lc_text = '<font color="#ff0000"><b>OUT OF STOCK!</b><br><a href="contact_us.php?subject=Stock inquiry on '. $listing['manufacturers_name'] . ' - ' . $listing['products_model'] . '">Email us for update! <img border="0" src="/images/email_icon.gif"></font></a>';

 

}else{

$lc_align = 'center';

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

}

break;

}

 

$list_box_contents[$cur_row][] = array('align' => $lc_align,

'params' => 'class="productListing-data"',

'text' => $lc_text);

}

}

 

new productListingBox($list_box_contents);

} else {

$list_box_contents = array();

 

$list_box_contents[0] = array('params' => 'class="productListing-odd"');

$list_box_contents[0][] = array('params' => 'class="productListing-data"',

'text' => TEXT_NO_PRODUCTS);

 

new productListingBox($list_box_contents);

}

 

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

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table>

<?php

}

?>

 

 

 

 

I'm trying to change the free shipping notes around line 113.

 

I'd like it to be something like this instead of using the products_weight:

 

//case modified to show free shipping

$lc_align = 'left';

if ($listing['products_free_shipping'] == '1') {

$lc_text = $lc_text . '<br><br><font color=red><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT . '</b> <img border="0" src="../images/Icon_FreeShipping_Small.gif">';

 

}

//10/27/2009 non free shipping ever items based on ['products_free_shipping'] == '2' instead of weight

if($listing['products_free_shipping'] == '0'){

//$lc_text = $lc_text . '<br><br><font color=red><b>' . $listing['products_weight'] . '</b>';

$lc_text = $lc_text . '<br><br><font color=red><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT_OVER199 . '</b> <img border="0" src="../images/Icon_FreeShipping_Over199.gif">';

}

 

 

I have a feeling I've not added the access to p.products_free_shipping in the query, but I'm not sure where $listing is getting set.

Can someone help.

Posted

here's the code in a snippet if that makes it easier.

 

<?php
/*
 $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

   // Show Product If Only Result Mod
 if(basename($_SERVER['PHP_SELF']) != FILENAME_ADVANCED_SEARCH_RESULT) $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
 // Show Product If Only Result Mod

   //line below is for debugging purposes
   //echo $listing_sql;
 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
   <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
<?php
 }
 $list_box_contents = array();

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
   switch ($column_list[$col]) {
     case 'PRODUCT_LIST_MODEL':
       $lc_text = TABLE_HEADING_MODEL;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_NAME':
       $lc_text = TABLE_HEADING_PRODUCTS;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $lc_text = TABLE_HEADING_MANUFACTURER;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_PRICE':
       $lc_text = TABLE_HEADING_PRICE;
       $lc_align = 'right';
       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 = 'right';
       break;
     case 'PRODUCT_LIST_IMAGE':
       $lc_text = TABLE_HEADING_IMAGE;
       $lc_align = 'center';
       break;
     case 'PRODUCT_LIST_BUY_NOW':
       $lc_text = TABLE_HEADING_BUY_NOW;
       $lc_align = 'center';
       break;
   }

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

   $list_box_contents[0][] = array('align' => $lc_align,
                                   'params' => 'class="productListing-heading"',
                                   'text' => ' ' . $lc_text . ' ');
 }

 if ($listing_split->number_of_rows > 0) {
   $rows = 0;
   $listing_query = tep_db_query($listing_split->sql_query);
   while ($listing = tep_db_fetch_array($listing_query)) {
     $rows++;

     if (($rows/2) == floor($rows/2)) {
       $list_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
       $list_box_contents[] = array('params' => 'class="productListing-odd"');
     }

     $cur_row = sizeof($list_box_contents) - 1;

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

       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $lc_align = '';
           $lc_text = ' ' . $listing['products_model'];
           break;
         case 'PRODUCT_LIST_NAME':
           $lc_align = '';

           if (isset($HTTP_GET_VARS['manufacturers_id'])) {

             $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $listing['manufacturers_id'] . // 8/12/2007  Somehow this was entered as $HTTP_GET_VARS['manufacturers_id'] which is wrong
                        '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
           } else {
             $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 
                        'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>  ';
           }
           //Feb 3, 2008 - Implementation of NewItem&Video Flag: display html for new item or video if the flags are set to true
           if((int)$listing['product_new_item_flag'])   $lc_text .= TEXT_PRODUCTS_NEW_ITEM_FLAG;
           if((int)$listing['product_video_flag'])      $lc_text .= TEXT_PRODUCTS_VIDEO_FLAG;

           //06/27/05 free_shipping_per_product_1.1 contribution implementation
           //case modified to show free shipping
           $lc_align = 'left';
		if ($listing['products_free_shipping']) {
		  $lc_text = $lc_text . '<br><br><font color=red><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT . '</b> <img border="0" src="../images/Icon_FreeShipping_Small.gif">';

		}else if($listing['products_weight']<MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX){
               //April 15, 2007 Free Shipping Over $199 contribution implementation
               //$lc_text = $lc_text . '<br><br><font color=red><b>' . $listing['products_weight'] . '</b>';
               $lc_text = $lc_text . '<br><br><font color=red><b>' . FREE_SHIPPING_FOR_THIS_PRODUCT_OVER199 . '</b> <img border="0" src="../images/Icon_FreeShipping_Over199.gif">';
            }
           break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $lc_align = '';
           //  Added by J 10/28/03 //
           $manufactures_id = $listing['manufacturers_id'];
			$query = "select * from manufacturers where manufacturers_id  = '$manufactures_id'";
			//echo "$query";
			$result = mysql_query($query);
			$num_results = mysql_num_rows($result);
			$row = mysql_fetch_array($result);
			$manufacturesimage = "$row[manufacturers_image]";            	

           //Monday, February 09, 2004 10:23:42 AM
           //takes out the link, leave just the image
           //Friday, April 23, 2004 11:50:42 AM
           //Took out the border width and height of the manufacturer logo
           //Thursday, April 29, 2004 11:41:00 AM
           //commented out the code to display logo so it will always show brand name
           //if ($manufacturesimage)
           //$lc_text = ' <IMG SRC="images/' . $manufacturesimage . '"> '; //original code: BORDER=0 WIDTH=80 HEIGHT=46
		//else
		$lc_text = ' ' . $listing['manufacturers_name'] . ' ';
           break;
         case 'PRODUCT_LIST_PRICE':
           $lc_align = 'center';
           if (tep_not_null($listing['specials_new_products_price'])) {
           //Thursday, February 05, 2004 4:01:11 PM 
           //Extension of the EZ New Fields v2.1 Implementation
           //&lc_text changed to display the list price
             $lc_text = '<s><strike>'. $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . 
                 '</strike><font color=red size=2><b><br>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . 
                 '</b></font></s>  <span class="productSpecialPrice">' . 
                 $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . 
                 '</span> ';
           }
           //Monday, May 3, 2004 3:31 PM
           //changed Call for rice" to "Email us for price"
           //added image & hyperlink to contact form so that customers can email the store for price
		if ($listing['products_price'] == '0.0000') { //4/9/2006 fixed a bug where html tags cause session error, unable to handle characters other than alphanumeric
		$lc_text = '<a href="contact_us.php?subject=Price inquiry on '. $listing['manufacturers_name'] . ' - ' . $listing['products_model'] . '"><font color="#ff0000" size=2><b>Email for price!</b> <img border="0" src="/images/email_icon.gif"></font></a>';

           //Thursday, February 05, 2004 4:01:11 PM 
           //Extension of the EZ New Fields v2.1 Implementation
           //&lc_text changed to display the list price			 
           }else {
             if($listing['products_retail_price'] > '0.0000') { 
                 $lc_text = '<strike>' . $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</strike><font color=red size=2><b><br>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</b></font> '; 
             } else { 
                 $lc_text = 'N/A<br><font color=red size=2><b><br>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</b></font> ';
             }

           }
           //End of Change

           break;
         case 'PRODUCT_LIST_QUANTITY':
           $lc_align = 'right';
           $lc_text = ' ' . $listing['products_quantity'] . ' ';
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $lc_align = 'right';
           $lc_text = ' ' . $listing['products_weight'] . ' ';
           break;
         case 'PRODUCT_LIST_IMAGE':
           $lc_align = 'center';
           if (isset($HTTP_GET_VARS['manufacturers_id'])) {
             $lc_text = '<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>';
           } else {
             $lc_text = ' <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> ';
           }
           break;
         case 'PRODUCT_LIST_BUY_NOW':                                                                                                                                                                                                                                            
            if ($listing['products_price'] == '0.0000') {
                $lc_text = "";
            }//July 18 2005 indicate stock status
            else if($listing['products_quantity'] < '1'){
                //4/9/2006 fixed a bug where html tags cause session error, unable to handle characters other than alphanumeric            
                $lc_text = '<font color="#ff0000"><b>OUT OF STOCK!</b><br><a href="contact_us.php?subject=Stock inquiry on '. $listing['manufacturers_name'] . ' - ' . $listing['products_model'] . '">Email us for update! <img border="0" src="/images/email_icon.gif"></font></a>'; 

            }else{
                $lc_align = 'center';
                $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
            }
           break;
       }

       $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
     }
   }

   new productListingBox($list_box_contents);
 } else {
   $list_box_contents = array();

   $list_box_contents[0] = array('params' => 'class="productListing-odd"');
   $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                  'text' => TEXT_NO_PRODUCTS);

   new productListingBox($list_box_contents);
 }

 if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
   <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
<?php
 }
?>

Archived

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

×
×
  • Create New...