Jump to content
Sign in to follow this  
spooks

Product Listing Enhancements, Thumbnails & Manufacturer Headings

Recommended Posts

Check you updated all the language files given in the instructions, and uploaded the changed files.

 

I've checked both contributions and both are installed as per the instructions. There is a Shop_by_price.php which I presume calls the Product_listing file at somepoint, but I can't figure out why the contents of the sort by dropdown presents incomplete wording. Is there any specific code I should be looking for which sets the viewable text in the dropdown>

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I just spotted its not using languages in the correct way, that could cause problems.

 

So u may need:

 

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
     FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef, ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf WHERE ptf.products_extra_fields_id=pef.products_extra_fields_id 
     and ptf.products_id=". (int) $products['products_id'] ." and (pef.languages_id = '0' or pef.languages_id = '".(int)$languages_id."') and ptf.products_extra_fields_value<>'' and 
     pef.products_extra_fields_status ORDER BY pef.products_extra_fields_order");

 

Spooks! You did it! You are my hero!!! I AM YELLING RIGHT NOW!!!

 

I just need to tweak the css to fine tune the styling, but it's there! I think you should add this as an optional mod or step in your install instructions, a lot of people have installed the Product Extra Fields contrib but want a nice product listing.

 

I actualy bet you would make it a nicer contrib, using the correct methods of calling the database and everything, maybe make your own, similar contrib that works well with yours.

 

But anyways, thank you for all the help to get me back to a working product listing!!!!

 

-Justin

Share this post


Link to post
Share on other sites

Spooks! You did it! You are my hero!!! I AM YELLING RIGHT NOW!!!

 

I just need to tweak the css to fine tune the styling, but it's there! I think you should add this as an optional mod or step in your install instructions, a lot of people have installed the Product Extra Fields contrib but want a nice product listing.

 

I actualy bet you would make it a nicer contrib, using the correct methods of calling the database and everything, maybe make your own, similar contrib that works well with yours.

 

But anyways, thank you for all the help to get me back to a working product listing!!!!

 

-Justin

 

 

Your welcome, I would point out that if you now used the included products_new.php file from the package, that would give you same display with those fields, make your sites look more consistant, as that file calls the same listing module. Note if u use that file though it does include a date limiting function (its commented).


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Your welcome, I would point out that if you now used the included products_new.php file from the package, that would give you same display with those fields, make your sites look more consistant, as that file calls the same listing module. Note if u use that file though it does include a date limiting function (its commented).

Spooks, I actualy did that already, I just basically copied your new_products.php file and added that line of sql we worked on.

 

I love it now, it's perfect.

 

Justin

Share this post


Link to post
Share on other sites

This is a fantastic contribution - thanks!

 

My only query is that the category/sub-category headings have disappeared when viewing the product listings. At the top there is still the category image to the right hand side, and the manufacturer's drop-down box in the middle, but no category heading. Is this easily fixed?


hor-i-zon

Share this post


Link to post
Share on other sites

This is a fantastic contribution - thanks!

 

My only query is that the category/sub-category headings have disappeared when viewing the product listings. At the top there is still the category image to the right hand side, and the manufacturer's drop-down box in the middle, but no category heading. Is this easily fixed?

 

Edit, re-read your post, if your talking of the listing headings of the module itself, they vary depending on mode you use, so if thats the case please be more precise with your question.

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hello Sam,

I have one problem with the plugin. I just want to install only the manufacturer heading and I did the following:

 

1. I imported the 2 sql files (1.9 sql & sql (in case of trouble with setup routine)). I don't know if I have done a mistake by adding extra code.

2. admin/manufacturers.php -> I changed the code as you have written

3. admin/includes/languages/greek/manufacturers.php -> I changed the code as you have written

4. admin/includes/functions/general.php -> I changed the code as you have written

 

but when I'm trying to add a manufacturer description, I have the following error:

1054 - Unknown column 'manufacturers_description' in 'field list'

 

select manufacturers_description from manufacturers_info where manufacturers_id = '10' and languages_id = '4'

 

I even installed the product_listing_setup.php and changed the Product Listing Manufacturers Description to True but still nothing.

Share this post


Link to post
Share on other sites

The manufacturers entry is missing from the sql, but it is there in the setup file, but most likely u confused things by applying that sql first (the setup could'nt tell what had or had'nt been set up)

 

applying this should get it sorted for you.

 

ALTER TABLE `manufacturers_info` ADD `manufacturers_description` varchar(64) NULL; 

 

 


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Yes, it worked but the description doesn't come up in the manufacturer's page. So sorry to bother you again. You are one of the best contributors of OSC and we cannot resist to request for a help.

Share this post


Link to post
Share on other sites

Yes, it worked but the description doesn't come up in the manufacturer's page. So sorry to bother you again. You are one of the best contributors of OSC and we cannot resist to request for a help.

 

 

Are you saying when you select a manufacturer from the drop down on index.php and you get a product list for that manufacturer, you are not seeing the description in the headers?

 

You have to enable that in admin -> product listing to display

 

 

PS, I noted you r only doing a limited install, obviously you must use the included product listing module for this to work. wink.gif

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

I have already installed product listing.

Here is a pic of my index:

http://img405.imageshack.us/img405/82/indexta.jpg

 

next, is the manufacturer page

http://img408.imageshack.us/img408/1913/manufacturer.jpg

 

the admin manufacturer description

http://img27.imageshack.us/img27/9198/adminmanufacturer.jpg

 

and lastly, the admin product listing

http://img202.imageshack.us/img202/8889/adminproductlisting.jpg

 

In case you want to test it for yourself, the store is www.bioearth.gr/index2.php

 

I even uploaded the original index.php of osc and the original files \includes\boxes\manufacturers.php & manufacturer_info.php but still no improvement.

 

 

I don't know. Maybe some function / procedure is missing from the index.php....

Share this post


Link to post
Share on other sites

 

 

For the manufacturer description to appear in the product listing you must make the changes detailed for index.php

 

 

manufacturer_info.php is not a standard osc file, where did u get it from ? Clearly this cant support non standard files that are un-known.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

For the manufacturer description to appear in the product listing you must make the changes detailed for index.php

 

manufacturer_info.php is not a standard osc file, where did u get it from ? Clearly this cant support non standard files that are un-known.

 

I made all the changes again to index.php as I did it yesterday but still nothing.

I have found manufacturer_info.php from oscommerce-2.2rc2a.

I uploaded your files straight to the site but no luck here either. I think I will give up. I just wanted to add a simple description. Do you know any other solution / contribution for adding only a manufacturer description?

 

If you don't know, it's ok. You have already spent too much time for me. Thanks.

Share this post


Link to post
Share on other sites

Is it possible to add a department landing page before this? At the moment you click on a department e.g. movies, and it takes you straight to the products. Is it possible to first take you to a page that says Blueray, DVD, VHS and then from one of those you will be taken to the product?

 

Thanks!

 

Chris

Share this post


Link to post
Share on other sites

I made all the changes again to index.php as I did it yesterday but still nothing.

I have found manufacturer_info.php from oscommerce-2.2rc2a.

I uploaded your files straight to the site but no luck here either. I think I will give up. I just wanted to add a simple description. Do you know any other solution / contribution for adding only a manufacturer description?

 

If you don't know, it's ok. You have already spent too much time for me. Thanks.

 

Oh, I just realised you must be refering to the manufacturer_info.php file within boxes, I thought you were talking of a main file!! blush.gif

 

Its probably something silly thats still causing your block, like failing to have manufacturer name enabled in admin, or failing to have any products attached to a manufacturer.

 

People have asked for this b4 as seperate contrib as there appears to be no other, perhaps I will release it as a stand alone, when I`ve time. biggrin.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Spooks, I'm back with another question.

 

I'm loving the new_products.php that came with your contrib, but is there a way to make it either randomized between all products (sort of like a random featured page) or randomize a small selection of the recently modified products?

 

We tend to add products in groups, with time between additions, and we don't want the same exact order of products to show up for a week or two between product additions...

 

Is there a quick fix for this? I saw on page 46 the post about adapting your code to featured_products.php... Is this what I want to do? Do I need to install any additional contrib asides from the two pages listed on page 46 by one of your users?

 

Thanks again for your help, you do a lot!

 

Justin

Share this post


Link to post
Share on other sites

hi there spooks

 

how can we have products in listing mode with ODD $ EVEN background colors which are set in Stylesheet.CSS???

 

 

i meant in "list in blocks" style

 

Good speed ya!

Share this post


Link to post
Share on other sites

Is it possible to add a department landing page before this? At the moment you click on a department e.g. movies, and it takes you straight to the products. Is it possible to first take you to a page that says Blueray, DVD, VHS and then from one of those you will be taken to the product?

 

Thanks!

 

Chris

 

 

Thats called sub-categories, you do that in admin. wink.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

 

 

 

Just a few mods around the sql would do it, look at boxes/specials.php for ideas.


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

 

 

Not in the current version, a may add the option in a future release. smile.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

i had configure the product listing to be thumbnail in girds.

 

It look small thumbnail picture, how i change which value to make thumbnail to be bigger?

 

I had tried various value, it does not change anything. weird.

 

Can someone point me the right direction?

Share this post


Link to post
Share on other sites

i had configure the product listing to be thumbnail in girds.

 

It look small thumbnail picture, how i change which value to make thumbnail to be bigger?

 

I had tried various value, it does not change anything. weird.

 

Can someone point me the right direction?

 

 

There is a file in the package called 'Settings' read that, it has your answer! smile.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

I've checked both contributions and both are installed as per the instructions. There is a Shop_by_price.php which I presume calls the Product_listing file at somepoint, but I can't figure out why the contents of the sort by dropdown presents incomplete wording. Is there any specific code I should be looking for which sets the viewable text in the dropdown>

 

Thanks in advance.

 

 

Hi Spooks, sorry I'm really in a jam with this as I simply can't figure out why the shop_by_price file is affecting the sort field installed through your contribution. I'm sure it's something simple, I just can't see it, if you could point me in the right direct it would be appreciated...

 

I have a sort_by_price file in the root dorectory which includes:

 

<?php
/*
 $Id: shop_by_price.php,v 2.5 2008/03/07 $

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

 Contribution by Meltus  http://www.highbarn-consulting.com
 Adapted for OsCommerce MS2 by Sylvio Ruiz suporte@leilodata.com
 Modified by Hugues Deriau on 09/23/2006 - display the price ranges in the selected currency
 Modified by Glassraven for dropdown list 24/10/2006 www.glassraven.com
 Modified by -GuiGui- (http://www.gpuzin.com) - 07/03/2008 - to work as advanced_search_result.php which should fix special prices and "display prices with tax"

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 // I suppose next line is to work with STS, no need for the others, you can leave it or remove it.
 $sbprice = true;

 // Initialize the varaible '$range' from param here because it's used in FILENAME_SHOP_BY_PRICE
 $range = 0;
 if (isset($HTTP_GET_VARS['range'])) {
   $range = $HTTP_GET_VARS['range'];
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);

 $pfrom = isset($price_min[$range]) ? $price_min[$range] : 0;
 $pto   = isset($price_max[$range]) ? $price_max[$range] : 0;

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOP_BY_PRICE, tep_get_all_get_params(), 'NONSSL', true, false));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><//?php echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
// create column list
 $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                      'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                      'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                      'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                      'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                      'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                      'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                      // Product Listing in Columns - Start  (You can remove those 4 lines if you are not using it).

                      // Product Listing in Columns - End
                      'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 asort($define_list);

 $column_list = array();
 reset($define_list);
 while (list($key, $value) = each($define_list)) {
   if ($value > 0) $column_list[] = $key;
 }

 $select_column_list = '';

 for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
   switch ($column_list[$i]) {
     case 'PRODUCT_LIST_MODEL':
       $select_column_list .= 'p.products_model, ';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $select_column_list .= 'm.manufacturers_name, ';
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $select_column_list .= 'p.products_quantity, ';
       break;
     case 'PRODUCT_LIST_IMAGE':
       $select_column_list .= 'p.products_image, ';
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $select_column_list .= 'p.products_weight, ';
       break;
   }
 }

 $select_str = "select distinct " . $select_column_list . "  p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $select_str .= ", SUM(tr.tax_rate) as tax_rate ";
 }

 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   if (!tep_session_is_registered('customer_country_id')) {
     $customer_country_id = STORE_COUNTRY;
     $customer_zone_id = STORE_ZONE;
   }
   $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
 }

 $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd";

 $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'";

 if (DISPLAY_PRICE_WITH_TAX == 'true') {
   if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
   if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
 } else {
   if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";
   if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")";
 }

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $where_str .= " group by p.products_id, tr.tax_priority";
 }

 if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {
       $HTTP_GET_VARS['sort'] = $i+1 . 'a';
       $order_str = ' order by final_price, pd.products_name';
       break;
     }
   }
 } else {
   $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
   $sort_order = substr($HTTP_GET_VARS['sort'], 1);
   $order_str = ' order by ';
   switch ($column_list[$sort_col-1]) {
     case 'PRODUCT_LIST_MODEL':
       $order_str .= "p.products_model " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_NAME':
       $order_str .= "pd.products_name " . ($sort_order == 'd' ? "desc" : "");
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $order_str .= "m.manufacturers_name " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $order_str .= "p.products_quantity " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_IMAGE':
       $order_str .= "pd.products_name";
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $order_str .= "p.products_weight " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_PRICE':
       $order_str .= "final_price " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
   }
 }

 $listing_sql = $select_str . $from_str . $where_str . $order_str;

 require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
       </td>
     </tr>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

and the product_listing file reads as follows:

 

<?php
/*
 $Id: product_listing.php, v 1.9 2009/08/25 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
*/
$graphic_bord = 'no'; //  set to 'yes' if you have older 'graphic borders' and not 'easy graphic borders'.

$cat_path = false; // set to true to include category paths in urls

if (tep_not_null($HTTP_GET_VARS['sort'])) $_GET['sort'] = $HTTP_GET_VARS['sort'];
$max_results = (tep_not_null($_GET['max']) ? $_GET['max'] : MAX_DISPLAY_SEARCH_RESULTS);
if (PRODUCTS_PER_ROW == 'PRODUCTS_PER_ROW' || PRODUCTS_PER_ROW == 0 || LISTING_SWITCH == 'LISTING_SWITCH') { $to = 'Setup Error!\nPlease ensure you have run the\nProduct Listing Setup File.' ; print "<script>alert('$to');</script>"; }

// sort order array
if ($_GET['sort'] == '0d') $sort_array[] = array('id' => 0 . 'd', 'text' => DATE_ORDER);
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
			$sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_MODEL . APHA_ORDER);
         break;
       case 'PRODUCT_LIST_NAME':
         $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_PRODUCTS . APHA_ORDER);
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_MANUFACTURER . APHA_ORDER);
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_QUANTITY . NUM_ORDER);
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_WEIGHT . NUM_ORDER);
         break;
			case 'PRODUCT_LIST_PRICE':
			  $sort_array[] = array('id' => $i+1 . 'a', 'text' => TABLE_HEADING_PRICE . NUM_ORDER);
         break;	
     }
   }
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
			$sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_MODEL . REVERSE_ALPHA_ORDER);
         break;
       case 'PRODUCT_LIST_NAME':
         $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRODUCTS . REVERSE_ALPHA_ORDER);
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_MANUFACTURER . REVERSE_ALPHA_ORDER);
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_QUANTITY . REVERSE_NUM_ORDER);
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_WEIGHT . REVERSE_NUM_ORDER);
         break;
			case 'PRODUCT_LIST_PRICE':
			  $sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRICE . REVERSE_NUM_ORDER);
         break;	
     }
   }	
// Max Results Array		
for ($i=1, $n=10; $i<$n; $i++) {		
	$max_display[] = array('id' => MAX_DISPLAY_SEARCH_RESULTS * $i, 'text' => MAX_DISPLAY_SEARCH_RESULTS * $i); 
	}	
	$max_display[] = array('id' => 1000000, 'text' => 'Show All');
// store GET vars		
$get_vars = '';
   reset($_GET);
   while (list($key, $value) = each($_GET)) {
     if ( ($key != 'sort') && ($key != 'max') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
       $get_vars .= tep_draw_hidden_field($key, $value);
     }
   }
$top_nav = ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'));
$base_nav = ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'));		
$listing_split = new splitPageResults($listing_sql, $max_results, 'p.products_id');

$page_nav = '<table border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td class="smallText">' .  $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS) . '</td><td class="smallText" align="right">' . TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))) . '</td></tr></table>';
$drop = '<table border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td class="smallText">Results/Page: '. tep_draw_form('maxdisplay', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . $get_vars . (isset($_GET['sort']) ? tep_draw_hidden_field('sort', $_GET['sort']) : '') .  tep_draw_pull_down_menu('max', $max_display, $_GET['max'], 'onChange="this.form.submit();"') . tep_hide_session_id().'</form></td><td class="smallText" align="right">Sort Order: ' . tep_draw_form('sorting', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get') . $get_vars . (isset($_GET['max']) ? tep_draw_hidden_field('max', $_GET['max']) : '') . tep_draw_pull_down_menu('sort', $sort_array, $_GET['sort'], 'onChange="this.form.submit();"') . tep_hide_session_id().'</form></td></tr></table>';
if ( ($listing_split->number_of_rows > (int)$max_results) && $top_nav ) echo $page_nav;
if ($top_nav && ($listing_split->number_of_rows > 0)) echo $drop;

function tep_get_category_name($category_id, $language_id) {
      $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'");
    $category = tep_db_fetch_array($category_query);

     return $category['categories_name'];
    }
function tep_get_manufacturer_name($manufacturer_id) {
      $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturer_id . "'");
    $manufacturer = tep_db_fetch_array($manufacturers_query);

     return $manufacturer['manufacturers_name'];
    }

function list_box_head($column_list) {
 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 = 'center';
       break;
     case 'PRODUCT_LIST_NAME':
       $lc_text = TABLE_HEADING_PRODUCTS;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $lc_text = TABLE_HEADING_MANUFACTURER;
       $lc_align = 'center';
       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 = (PRODUCT_LIST_OPTIONS == 'true'  ? 'Product Options</td><td align="center" class="productListing-heading">' : '') . (strstr(LISTING_BUTTON, 'buy now')? TABLE_HEADING_BUY_NOW : TABLE_HEADING_DETAIL);
       $lc_align = 'center';
       break;
   }
   if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
     $lc_text = tep_create_sort_heading($_GET['sort'], $col+1, $lc_text);
   }
  $list_box_contents[] = array('align' => $lc_align,'params' => 'class="productListing-heading"','text' => ' ' . $lc_text . ' ');
 }
 return ($list_box_contents);
}
// function list_head end	

function list_box_data($listing, $column_list) {
       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=' . $listing['products_id'] . ($man_id ? '&manufacturers_id='.$man_id : ($cPath && $cat_path ? '&cPath=' . $cPath : '')) ) . '"' . ($man_id || ($cat_path && $cat_path) ? ' rel="nofollow"' : '') . '>';
       $buypic = (LISTING_BUTTON == 'buy now' ? 'button_in_cart.gif' : 'button_buy_now.gif');
			$quantity = (PRODUCT_LIST_QUANTITY_BOX == 'true' ? 'Quantity: ' . tep_draw_input_field('cart_quantity','1','maxlength="5" size="5"') . '<br />' : '');
			$form = tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_product'));
			$buytable = '<table border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td  align="center" class="productListing-data">';
			$buytableend = '</td></tr></table></form>';
			$button = (LISTING_BUTTON == 'buy now & details' ? '<br />' . tep_draw_hidden_field('products_id', $listing['products_id']) . $quantity . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"') . ' <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 />' . tep_draw_hidden_field('products_id', $listing['products_id']) . $quantity . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW) . '<br /><br />' : '<br />'. $link . tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS) . '</a><br /><br />' )) ;
			if ($listing['products_price'] == 0) $button = (strstr(LISTING_BUTTON, 'details') ? '<br /><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS) . '</a> <br /><br />' : '');
       if (isset($listing['products_quantity']) && !$listing['products_quantity']) $button = '<br /><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS) . '</a> <br /><br />';
			if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'block'))	{			
			for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
       $lc_align = '';
			$params = 'class="productListing-data" width="'.(100/sizeof($column_list)).'%" ';				
       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $lc_align = 'center';
           $lc_text = ' ' . $listing['products_model'] . ' ';
           break;
         case 'PRODUCT_LIST_NAME':
           $lc_align = '';
           $lc_text = $link.'<b>' . $listing['products_name'] . '</b></a>' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br /><span class="short">' . $listing['short_desc'] . '</span>' : '');
          break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $lc_align = 'center';
           $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';
           break;
         case 'PRODUCT_LIST_PRICE':
           $lc_align = 'right';
					$price = (function_exists(display_short_price)) ? $currencies->display_short_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])); 
           if (tep_not_null($listing['specials_new_products_price'])) {
             $lc_text = '<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>  ';
           } else {
					   $lc_text = ($listing['products_price'] > 0 ? '' . $price . '  ' : ' ' . TEXT_POA); 
if (function_exists(tep_get_att_price)) $lc_text .= (tep_get_att_price($listing['products_id']) > 0 ? '+' : ' ') ; 
           }
           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';
           $lc_text = $link . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . '</a>';
           break;
         case 'PRODUCT_LIST_BUY_NOW':
				  if (PRODUCT_LIST_OPTIONS == 'true' ) $params = 'class="productListing-data" width="'.((100/sizeof($column_list))*2).'%" colspan="2"'; 
				  $lc_align = 'center';
           $lc_text = $form . $buytable . (PRODUCT_LIST_OPTIONS == 'true'  ? attribute_drop($listing['products_id'],$listing['products_tax_class_id']) . '</td><td align="center" class="productListing-data">' . $button : $button) . $buytableend;
          break;
       }
			$list_box_temp[] = array('align' => $lc_align,
                                'params' => $params,
                                'text'  => $lc_text);
     }
	} else {  // block listing 
	$list_box_temp = array();
	if (PRODUCT_LIST_IMAGE) { $list_box_temp[] = array('align' => 'center',
                                 										 'params' => 'class="productListing-data" ',
                                											 'text'  => $link . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], PRODUCT_IMAGE_WIDTH, ($height ? SMALL_IMAGE_HEIGHT : '')) . '</a>');   }
	     $display ='';
	for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $display .= $listing['products_model'] . '<br />';
           break;
         case 'PRODUCT_LIST_NAME':
           $display .= $link.'<b><u>' . $listing['products_name'] . '</u></b></a><br />' . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<span class="short">' . $listing['short_desc'] . '</span><br />' : '');
          break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $display .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a><br />';
           break;
         case 'PRODUCT_LIST_PRICE':
				  $display .= '<br />Price: ';
           $price = (function_exists(display_short_price)) ? $currencies->display_short_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])); 
           if (tep_not_null($listing['specials_new_products_price'])) {
             $display .= '<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span><br />';
           } else {
					   $display .= ($listing['products_price'] > 0 ? '' . $price : '' . TEXT_POA); 
if (function_exists(tep_get_att_price)) $display .= (tep_get_att_price($listing['products_id']) > 0 ? '+' : ' ') ; 
						 $display .= '<br />'; 
           }
           break;
         case 'PRODUCT_LIST_QUANTITY':
           $display .=  ($listing['products_quantity'] ? 'Stock = ' . $listing['products_quantity'] : 'Out of Stock') . '<br />';
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $display .= 'Weight = ' . $listing['products_weight'].WEIGHT_ABRV.'<br />';
           break;
			}
		}	
$list_box_temp[] = array('align' => 'left',
                            'params' => 'class="main" valign="top"',
                            'text'  => $display);
	if (PRODUCT_LIST_BUY_NOW) {
		$list_box_temp[] = array('align' => 'left',
                            'params' => 'class="productListing-data" width="'.(100/4).'%" ',
                            'text'  => $form . $buytable . (PRODUCT_LIST_OPTIONS == 'true' ? attribute_drop($listing['products_id'],$listing['products_tax_class_id']) . '</td><td  align="center" class="productListing-data">' . $button : $button) . $buytableend);
			}
	}
	return 	($list_box_temp);	
   }
// function list_box_data end	

function attribute_drop($products_id,$tax_class_id) {
global $languages_id;
$currencies = new currencies();
$atrib_drop = '';			
	$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$products_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {

	$atrib_drop = '<table border="0" cellspacing="0" cellpadding="2">';

	$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$products_id . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($tax_class_id)) .') ';
         }
       }
$atrib_drop .= '<tr><td align="left" class="productListing-data" >' . $products_options_name['products_options_name'] . ':' . '</td><td align="left">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array) . '</td></tr>';

     }
					$atrib_drop .= '</table>';
   }
	return $atrib_drop;
}
// function attribute_drop end

// set initial values	
$thumbnail_view = (isset($_GET['list']) ? $_GET['list'] : PRODUCT_THUMBNAIL_VIEW); 
$empty_list=false;
if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {
$title_name = tep_get_manufacturer_name($_GET['manufacturers_id']);
} else {
$title_name = (!$category['categories_name'] && tep_not_null($_GET['cPath']) ? tep_get_category_name(substr($_GET['cPath'], strpos($_GET['cPath'],'_')+1),$languages_id) : '');
}
$grid = strstr(PRODUCT_THUMBNAIL_VIEW, 'grid');
$gborders = function_exists(mws_boxHeader);
$Tborder = (!$gborders ? '<table class="infoBoxList" width="100%"><tr><td>' : mws_boxHeader('<big>'.$title_name.'</big>'));
$Tborderend = (!$gborders ? '</td></tr></table>' : mws_boxFooter ());
$border2 = (!$gborders ? '<table class="infoBoxList" width="100%"><tr><td>' : ($graphic_bord == 'yes' ? mws_boxHeader('<big>'.$title_name.'</big>') : ''));  
$border2end = (!$gborders ? '</td></tr></table>' : ($graphic_bord == 'yes' ? mws_boxFooter() : ''));
$form = tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_product'));

if (tep_not_null($_GET['categories_id']) && $current_category_id == 0) $current_category_id = $_GET['categories_id'];

// output selected display
if (strstr($thumbnail_view, 'thumbnails')) {  //thumbnail
 $row = 0;
 $col = 0;
 $border = (!$grid ? '<table class="infoBoxProducts" cellpadding="2" width="'.PRODUCT_LIST_WIDTH.'" height="'.PRODUCT_LIST_HEIGHT.'" ><tr><td valign="top">' : '<br />');
$borderend = (!$grid ? '</td></tr></table>' : '');
$style = (!$grid ? 'class="smallText"' : 'class="infoBoxGrid"');
$info_box_contents = array();
if ($listing_split->number_of_rows > 0) {   $listing_query = tep_db_query($listing_split->sql_query);} else {
       $listing_query = tep_db_query($listing_sql); }
if (tep_db_num_rows($listing_query)) { 			
while ($products = tep_db_fetch_array($listing_query)) {
 	if ($row == 0) { 
	  if (!$gborders && !$grid) $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" valign="top"',
                                          'text' =>  ' ');  
																				 echo $Tborder;$row ++;
	               }

		// build thumb
	$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"' : '') . '>';
	$quantity = (PRODUCT_LIST_QUANTITY_BOX == 'true' ? 'Quantity: ' . tep_draw_input_field('cart_quantity','1','maxlength="5" size="5"') . '<br />' : '');
	$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, PRODUCT_IMAGE_HEIGHT) . '</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 />' . tep_draw_hidden_field('products_id', $products['products_id']) . $quantity . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"') . ' <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 />' . tep_draw_hidden_field('products_id', $products['products_id']) . $quantity . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW) . '<br /><br />' : '<br />'. $link . tep_image_button('button_details.gif', IMAGE_BUTTON_DETAILS) . '</a><br /><br />' )) : ' ');	
	if ($products['products_price'] == 0) $button = (strstr(LISTING_BUTTON, 'details') ? '<br /><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a> <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 ? '+' : '') ; 
	if (isset($products['products_quantity']) && !$products['products_quantity']) $button = (strstr(LISTING_BUTTON, 'details') ? '<br /><span class="buy_now"> </span>'. $link . tep_image_button('button_details_small.gif', IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a> <br />' : '');
	$show_price = '<br /><font size="'.PRODUCT_PRICE_SIZE.'">' . ($products['products_price'] > 0 ? $price : TEXT_POA) . '<br /></font>';
	$quantity = ($products['products_quantity'] ? 'Stock = '.$products['products_quantity'] : 'Out of Stock').'<br />';
	$weight = 'Weight = '.$products['products_weight'].WEIGHT_ABRV.'<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="" width="100%" ><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 . $form . '<br />' . (PRODUCT_LIST_OPTIONS == 'true' ? attribute_drop($products['products_id'],$products['products_tax_class_id']) . $button : $button) . '</form>';
			// thumb built			 


	 $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => $style . ' width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" valign="top"',
                                          'text' => $display );
	$col ++;
   if ($col > PRODUCTS_PER_ROW-1) {
     $col = 0;
     $row ++;
   }
}  // prod loop
} else {$empty_list=true; }// no products!!
// got display
if ($row) { 
$i = 0 ; $nbx = class_exists(noborderBox); if ($col > 0 && $row > 1 && $nbx && !$grid) { for ($i=0, $n=$col; $i < $n; $i++) { $last_row[0][$i] =  $info_box_contents[$row][$i]; unset($info_box_contents[$row][$i]); } }
if (!$i) {$col = 0;$row ++;$info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="'.(PRODUCTS_PER_ROW ? (100/PRODUCTS_PER_ROW) : '').'%" ',
                                          'text' =>  ' '); }
if ($nbx) new noborderBox($info_box_contents); else new contentBox($info_box_contents);
if($i) new noborderBox($last_row); 
echo $Tborderend;
 							  } else {$empty_list=true; }
} elseif (strstr($thumbnail_view, 'manufacturer')) {  //manufacturer

$row = 0;$col = 0;

if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {
$filterlist_sql= tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, mi.manufacturers_description from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "'");
 }else{
$filterlist_sql= tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name, mi.manufacturers_description  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on m.manufacturers_id = mi.manufacturers_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' and mi.languages_id = '" . (int)$languages_id . "' order by m.manufacturers_name");
}
if (tep_db_num_rows($filterlist_sql)) { $rows = 0;
	while ($manufacturer = tep_db_fetch_array($filterlist_sql)) { 
	$info_box_heading = array(); if ($rows) echo tep_draw_separator('pixel_trans.gif', '100%', '4');	
	echo $border2; 
	$info_box_heading[0] = array('text' => '<big>'.$manufacturer['manufacturers_name'].'</big><br />'.(MANU_DESCRIPTION == 'true' ? $manufacturer['manufacturers_description'].'<br />' : ''));
	new infoBoxHeading($info_box_heading, false, false);	
	//echo tep_draw_separator('pixel_trans.gif', '100%', '2');		 
  $list_box_contents = array();
   $list_box_contents[0] = (LISTING_HEADINGS == 'true' && !strstr(PRODUCT_THUMBNAIL_VIEW, 'block') ? list_box_head($column_list) : '');
   if ($listing_split->number_of_rows > 0) { $rows = 0;  $listing_query = tep_db_query($listing_split->sql_query);} else {
     $rows = 0;  $listing_query = tep_db_query($listing_sql); }
   while ($listing = tep_db_fetch_array($listing_query)) {
	if ($listing['manufacturers_id'] != $manufacturer['manufacturers_id']) continue;
     $rows++;

     $list_box_contents[] = (($rows/2) == floor($rows/2) ? array('params' => 'class="productListing-even"') : array('params' => 'class="productListing-odd"'));
     $cur_row = sizeof($list_box_contents) - 1;
		$list_box_contents[$cur_row] =	list_box_data($listing, $column_list);  
  }
  if (!$rows && isset($_GET['manufacturers_id'])) {
  $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); $rows++; }
  if ($rows) new productListingBox($list_box_contents); 
   echo $border2end; 
}   // man loop;
	$col = 0;$row ++;$info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="33%" valign="top"',
                                          'text' =>  ' ');
} else {$empty_list=true; }  // no manufacturers!!
}
if ((!strstr($thumbnail_view, 'thumbnails') && !strstr($thumbnail_view, 'manufacturer')) || $empty_list) {   //default listing

 if (MANU_DESCRIPTION == 'true' && tep_not_null($_GET['manufacturers_id'])) { 
$manufacturer_query = tep_db_query("select manufacturers_description from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)($_GET['manufacturers_id']) . "' and languages_id = '" . (int)$languages_id . "'");
   $manufacturer = tep_db_fetch_array($manufacturer_query); }

  $info_box_heading[0] = array('text' => '<big>'.$title_name.'</big>'.($manufacturer['manufacturers_description'] ? '<br />' . $manufacturer['manufacturers_description'] : ''));
 $list_box_contents = array();
  $list_box_contents[0] = (LISTING_HEADINGS == 'true' && !strstr(PRODUCT_THUMBNAIL_VIEW, 'block') ? list_box_head($column_list) : '');
  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++;

    $list_box_contents[] = (($rows/2) == floor($rows/2) ? array('params' => 'class="productListing-even"') : array('params' => 'class="productListing-odd"'));
    $cur_row = sizeof($list_box_contents) - 1;

		$list_box_contents[$cur_row] =	list_box_data($listing, $column_list);  
   }
	$empty_list = false;
	echo $border2; 
	if ($title_name) new infoBoxHeading($info_box_heading, false, false);	
   new productListingBox($list_box_contents);
	echo $border2end; //tep_draw_separator('pixel_trans.gif', '100%', '4');
 } 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 ($base_nav && !$empty_list) echo $drop;
if (($listing_split->number_of_rows > (int)$max_results) && $base_nav) echo $page_nav;

if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'list') && LISTING_SWITCH != 'false' && !$empty_list) echo '<br /><span class="smalltext"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('list')). 'list='.(strstr($thumbnail_view, 'thumbnails') ? 'manufacturer' : 'thumbnails')) . '">' . (strstr($thumbnail_view, 'thumbnails') ? LIST_VIEW : THUMB_VIEW).'</a></span><br /><br />';
// echo '<hr>' . $listing_sql . '<hr>'; 

?>

 

 

If you could point me in the right direction it would be appreciated as I'd love to be able to get these two contributions working together.

Share this post


Link to post
Share on other sites

CREATED NEW PAGE!!!!!

 

 

 

 

When u add a new page u must edit its language file as per changes to others using same module, ie make the same changes as for includes/languages/english/advanced_search.php


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Someone asked elsewhere about an issue with the add to cart button, that if the product has atributes, but atributes are not included in the listing the add to cart will put the product strait into the cart (without atributes) instead of going to product_info.php

 

This issue is due to an oversight on my part when adding the atribute option, sorry. blush.gif

 

To Fix, in application_top.php find:

 

  	// customer adds a product from the products page
 	case 'add_product' :	if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {

 

add after:

 

 if (tep_has_product_attributes($_POST['products_id']) && PRODUCT_LIST_OPTIONS != 'true') tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_POST['products_id']));


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×