Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

I think you found a bug in Hide Products;

 

...

 

Caveat: I haven't actually tested that, so make sure you do properly. If you do need the hide categories processing, you'll have to wait until I've figured out how to add 'distinct' to the query without breaking the page split functionality.

 

OK, here's a tested proper fix. There's a change to the query itself (adding distinct after select) and an additional parameter to the call to the page split function immediately following. The vanilla Hide Products stuff should be:

  $products_new_query_raw = "select distinct p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by p.products_date_added DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW, 'p.products_id');
// EOF Separate Pricing Per Customer, hide products and categories from groups

and your modified query and following call should be

  $products_new_query_raw = "select distinct p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = pd.products_id and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) < '" . NEW_PRODUCT_DAYS . "' and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by p.products_date_added DESC, pd.products_name";
 $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW, 'p.products_id');
// EOF Separate Pricing Per Customer, hide products and categories from groups

 

You'll probably need to change reviews.php as well. The products_listing module won't be affected as it lists products in a specific category.

 

The front page module for new products already has distinct in the queries.

Edited by JohnAtYM

For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

You need to change reviews.php as well, replace

  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by r.reviews_id DESC";
// EOF Separate Pricing Per Customer, Hide products and categories from groups
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

with

 $reviews_query_raw = "select distinct r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by r.reviews_id DESC";
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS, 'p.products_id');
// EOF Separate Pricing Per Customer, Hide products and categories from groups

 

NB I have moved the // EOF comment one line down after the splitPageResults instantiation, so make sure you don't end up with two of these lines.

 

The front page modules don't need changing; products_listing module lists products in a specific category, new_products already has distinct in the queries.

 

However, includes/modules/also_purchased_products.php needs

    $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
// EOF Separate Pricing Per Customer, Hide products and categories from groups

changing to

    $orders_query = tep_db_query("select distinct p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
// EOF Separate Pricing Per Customer, Hide products and categories from groups

I don't have the data on hand to test either of these, so let me know if/when you've checked them out.

Edited by JohnAtYM

For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

I have SPPC 4.4.2 & Hide Categories & Products V204 Installed on my oscommerce 2.3.1, I have this installed just so I can hide slave products when using Master Products, I did this because I don't want the individual slave product_info pages to be accessible. This works ok but I see my google sitemap is still picking up these slave product pages, is there anyway I can make the hidden pages inaccessible to both the customers and the search engines? Thanks.

Share this post


Link to post
Share on other sites

I have SPPC 4.4.2 & Hide Categories & Products V204 Installed on my oscommerce 2.3.1, I have this installed just so I can hide slave products when using Master Products, I did this because I don't want the individual slave product_info pages to be accessible. This works ok but I see my google sitemap is still picking up these slave product pages, is there anyway I can make the hidden pages inaccessible to both the customers and the search engines? Thanks.

 

Whichever google sitemap addon you're using, there will be a query which lists all the active products to put into the products site map. You will need to make changes to this query, so that you are able to add the "find in set" qualifications for hidden products (and if necessary hidden categories, but if you're just hiding slave products you won't need that).

 

If you can find the query and post it here, I can suggest how to change it... if you're using "Google XML Sitemap SEO" it's in the file catalog/googlesitemap/sitemap.class.php in the function GenerateProductSitemap but there are lots of different add-ons and versions of them for sitemaps.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Dear all

After a problem that i had with my passwords i fix it now when i have gone at last into the admin panel i figure out that the customers group can create new groups as the half of this specific menu has been invisible or lost FROM THE PAGE.Do you know aqnything please?

 

osck.png

Edited by apolyshow

One amateur made the Arc, 5.000 pro made the Titanic...

Share this post


Link to post
Share on other sites

Dear all

After a problem that i had with my passwords i fix it now when i have gone at last into the admin panel i figure out that the customers group can create new groups as the half of this specific menu has been invisible or lost FROM THE PAGE.Do you know aqnything please?

 

osck.png

 

Assuming that other things that access installed payment modules work ok, I think you should compare your catalog/admin/customers_groups.php file with the one delivered with the package.

If the problem is here, one possibility is that you've lost a } somewhere, perhaps around line 290.

 

If the customers_groups.php file is ok, maybe the installation of your payment modules is corrupted. Have you got any payment modules installed?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Assuming that other things that access installed payment modules work ok, I think you should compare your catalog/admin/customers_groups.php file with the one delivered with the package.

If the problem is here, one possibility is that you've lost a } somewhere, perhaps around line 290.

 

If the customers_groups.php file is ok, maybe the installation of your payment modules is corrupted. Have you got any payment modules installed?

 

 

You are right my friend. There is a module in payments that makes this mess but it took me 10 times of installation to figure it out and find out which one was.Thanks


One amateur made the Arc, 5.000 pro made the Titanic...

Share this post


Link to post
Share on other sites

You need to change reviews.php as well, replace

  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by r.reviews_id DESC";
// EOF Separate Pricing Per Customer, Hide products and categories from groups
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);

with

 $reviews_query_raw = "select distinct r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by r.reviews_id DESC";
 $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS, 'p.products_id');
// EOF Separate Pricing Per Customer, Hide products and categories from groups

 

NB I have moved the // EOF comment one line down after the splitPageResults instantiation, so make sure you don't end up with two of these lines.

 

The front page modules don't need changing; products_listing module lists products in a specific category, new_products already has distinct in the queries.

 

However, includes/modules/also_purchased_products.php needs

    $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
// EOF Separate Pricing Per Customer, Hide products and categories from groups

changing to

    $orders_query = tep_db_query("select distinct p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
// EOF Separate Pricing Per Customer, Hide products and categories from groups

I don't have the data on hand to test either of these, so let me know if/when you've checked them out.

 

 

Hi!

 

Thank you and sorry for my little delayed response. Everything seems to be working fine now as I can see...:)

 

In addition, also specials.php had to be changed similar way so query is:

 

$specials_query_raw = "select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_SPECIALS . " s, " . TABLE_CATEGORIES . " c where p2c.categories_id = c.categories_id and p.products_status = '1' and p.products_quantity > 0 and p.products_id = p2c.products_id and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '" . (int)$customer_group_id . "'";

 

and(the line which originally caused difficulties for me)

 

from

 

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);

 

to

 

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');

 

Yes, I kow there isn't Hide products changes there but still it needs this fix...

Share this post


Link to post
Share on other sites

Hi!

 

Thank you and sorry for my little delayed response. Everything seems to be working fine now as I can see...:)

 

In addition, also specials.php had to be changed similar way so query is:

 

$specials_query_raw = "select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_SPECIALS . " s, " . TABLE_CATEGORIES . " c where p2c.categories_id = c.categories_id and p.products_status = '1' and p.products_quantity > 0 and p.products_id = p2c.products_id and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '" . (int)$customer_group_id . "'";

 

and(the line which originally caused difficulties for me)

 

from

 

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);

 

to

 

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');

 

Yes, I kow there isn't Hide products changes there but still it needs this fix...

 

Actually, SPPC changes to specials.php should have given you this query:

  $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '" . (int)$customer_group_id . "' order by s.specials_date_added DESC";

which doesn't refer to categories and wouldn't have given you a problem. Either you have installed another add-on that modified specials.php or you applied changes from the wrong file. Either way, as long as it works now it doesn't really matter!


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Actually, SPPC changes to specials.php should have given you this query:

  $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '" . (int)$customer_group_id . "' order by s.specials_date_added DESC";

which doesn't refer to categories and wouldn't have given you a problem. Either you have installed another add-on that modified specials.php or you applied changes from the wrong file. Either way, as long as it works now it doesn't really matter!

 

Yes indeed I have other contributions installed such as SPPC_Price_Break. I really carefully double checked this change was necessary. But everything is now ok ant that is the main thing. Thanks again for help...:)

Share this post


Link to post
Share on other sites

Hello

 

I have QPBPP for SPPC v2.0 installed on an OSC RC2a. I can not figure out how to get quantity price on product listing page, I have no overviw of this in the moment. I have 2 price categories, now showing only the highest price. I want to show both the lowest and the highest price.

 

Hope you understand what I mean, I've spent days reading the posts in the forum but can not find anything that can help.

 

Thanks in advance.

 

Havkrog / Denmark

 

Code from includes/modules/product_listing.php

<?php
/*
 $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $
 adapted for Separate Pricing Per Customer v4.2 2007/08/23, adapted for QPBPP for SPPC v2.0 2008/11/11

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// BOF QPBPP for SPPC
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_LISTING);
// EOF QPBPP for SPPC
?>
<form name="cart_multi" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_multi', 'NONSSL'); ?>">
<?php

?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 </tr>
</table>

<?php
 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
 //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
 }
 $data_ok = ($listing_split->number_of_rows > 0);
if ((PRODUCT_LIST_DESCRIPTION ) && $data_ok) {
	$listing_query = tep_db_query($listing_split->sql_query);
	while ($products = tep_db_fetch_array($listing_query)) $id_array[] = $products['products_id'];  
	$pid_string = implode(',', array_unique($id_array));
   $product_query = tep_db_query("select products_id, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $pid_string . ") and language_id = '" . (int)$languages_id . "'");
	while ($products = tep_db_fetch_array($product_query)) {    
			$t_desc[$products['products_id']] = substr(strip_tags($products['products_description']), 0, PRODUCT_LIST_DESCRIPTION_MAX_LENGTH);  
  }
}
function product_description($product_id,$link,$thumb=false) {
   global $t_desc;
	if (PRODUCT_LIST_DESCRIPTION) {
   	return '<br /><span class="productDesc">' . $t_desc[$product_id] . $link . '<font color="#800000"><b> ...' . MORE . '</b></a></span>';
	} else {
	return false; 
	}
 }
 $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;
   }

  //sort order & quantity change
   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 & quantity change
     $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);
// 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)) {
// BOF QPBPP for SPPC
    $_listing['discount_categories_id'] = NULL;
    $listing[] = $_listing;
    $list_of_prdct_ids[] = $_listing['products_id'];
   }
   $list_of_prdct_ids = array_unique($list_of_prdct_ids);
// EOF QPBPP for SPPC
// 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') {
// BOF QPBPP for SPPC
 $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 . "' and customers_group_price != null");
// EOF QPBPP for SPPC

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++)

// BOF QPBPP for SPPC
   $price_breaks_query = tep_db_query("select products_id, products_price, products_qty from  " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and customers_group_id = '" . $customer_group_id . "' order by products_id, products_qty");
   while ($price_break = tep_db_fetch_array($price_breaks_query)) {
//          $price_breaks_array[$price_break['products_id']][] = array('products_price' => $price_break['products_price'], 'products_qty' => $price_break['products_qty']);
   }
// get discount category plus quantity blocks and minimum order quantity for retail
   $discount_category_query = tep_db_query("select p.products_id, p.products_qty_blocks as qtyBlocks, p.products_min_order_qty, p.products_quantity, p.manufacturers_id, p.products_weight, discount_categories_id from " . TABLE_PRODUCTS ." p left join (select products_id, discount_categories_id from " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and customers_group_id = '" . $customer_group_id . "') as ptdc on p.products_id = ptdc.products_id where p.products_id in (" . implode(',', $list_of_prdct_ids) . ")");
  while ($dc_array = tep_db_fetch_array($discount_category_query)) {
    $discount_categories[] = array ('products_id' => $dc_array['products_id'], 'qtyBlocks' => ($customer_group_id == '0' ? $dc_array['qtyBlocks']: '1'), 'products_min_order_qty' => ($customer_group_id == '0' ? $dc_array['products_min_order_qty']: '1'), 'products_quantity' => $dc_array['products_quantity'], 'products_weight' => $dc_array['products_weight'], 'discount_categories_id' => $dc_array['discount_categories_id']);
  }
  if(!empty($discount_categories)) {
    $no_of_discount_cats = count($discount_categories);
     for ($x = 0; $x < $no_of_listings; $x++) {
// add discount categories to the listing array 
       for ($i = 0; $i < $no_of_discount_cats; $i++) {
        if ($listing[$x]['products_id'] == $discount_categories[$i]['products_id'] ) {
	        $listing[$x]['discount_categories_id'] = $discount_categories[$i]['discount_categories_id'];
	        $listing[$x]['qtyBlocks'] = $discount_categories[$i]['qtyBlocks'];
	        $listing[$x]['products_min_order_qty'] = $discount_categories[$i]['products_min_order_qty'];
	        $listing[$x]['products_quantity'] = $discount_categories[$i]['products_quantity'];
	        $listing[$x]['products_weight'] = $discount_categories[$i]['products_weight'];
	      }
      } // end for ($i = 0; $i < $no_of_discount_cats; $i++) {
    }
   } // end if(!empty($discount_categories)

// if customer group id is not retail we will have to do another query to get the 
// quantity blocks and minimum order quantity
 if ($customer_group_id != '0') {
   $pg_qb_moq_query = tep_db_query("select pg.products_id, pg.products_qty_blocks as qtyBlocks, pg.products_min_order_qty from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'");

  while ($pg_qb_moq_array = tep_db_fetch_array($pg_qb_moq_query)) {
   $new_qb_moq[] = array ('products_id' => $pg_qb_moq_array['products_id'], 'qtyBlocks' => $pg_qb_moq_array['qtyBlocks'], 'products_min_order_qty' => $pg_qb_moq_array['products_min_order_qty']);
  }
  if (!empty($new_qb_moq)) {
    $no_of_pg_qb_moq = count($new_qb_moq);
     for ($x = 0; $x < $no_of_listings; $x++) {
       for  ($i = 0; $i < $no_of_pg_qb_moq; $i++) {
         if ($listing[$x]['products_id'] == $new_qb_moq[$i]['products_id'] ) {
	        $listing[$x]['qtyBlocks'] = $new_qb_moq[$i]['qtyBlocks'];
	        $listing[$x]['products_min_order_qty'] = $new_qb_moq[$i]['products_min_order_qty'];
         }
       }
     }
   } // end if (!empty($new_qb_moq))
 } // end if ($customer_group_id != '0') 
// EOF QPBPP for SPPC

//    while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
     $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 = '';
//sort order & quantity change
       if ($column_list[$col] == 'PRODUCT_LIST_SORT_ORDER'){break;}
//end sort order & quantity change
       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $lc_align = '';
           $lc_text = ' ' . $listing[$x]['products_model'] . ' ';
           break;
         case 'PRODUCT_LIST_NAME':
           $lc_align = '';
        /*denne erstattes af Product Description 1.3 
	    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[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
           } else {
             $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a> ';
           }
		*/
// BOF Product Description 1.3
            	$man_id = (tep_not_null($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : '');
	$link = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing[$x]['products_id'] . ($man_id ? '&manufacturers_id='.$man_id : ($cPath && $cat_path ? '&cPath=' . $cPath : '')) ) . '"' . ($man_id || ($cat_path && $cat_path) ? ' rel="nofollow"' : '') . '>';
	$lc_text = ' ' . $link . '<span class="productListing-name">' . $listing[$x]['products_name'] . '</span></a>' . product_description($listing[$x]['products_id'],$link);
// EOF Product Description 1.3

           break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $lc_align = '';
           $lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> ';
           break;
         case 'PRODUCT_LIST_PRICE':
           $lc_align = 'right';
// BOF QPBPP for SPPC
           $price_breaks_from_listing = array();
           if (isset($price_breaks_array[$listing[$x]['products_id']])) {
             $price_breaks_from_listing = $price_breaks_array[$listing[$x]['products_id']];
           }
           $pf->loadProduct($listing[$x]['products_id'], $languages_id, $listing[$x], $price_breaks_from_listing);
           $lc_text = $pf->getPriceString();
// EOF QPBPP for SPPC
           break;

         case 'PRODUCT_LIST_QUANTITY':
           $lc_align = 'right';
           $lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $lc_align = 'right';
           $lc_text = ' ' . $listing[$x]['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[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['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[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
           }
           break;
         case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text  = '<input type="text" name="add_id['.$number_of_products.']" value="" size="4">';
           $lc_text .= '<input type="hidden" name="products_id['.$number_of_products.']" value="'.$listing[$x]['products_id'].'">';

 if ($listing[$x]['products_quantity'] > 0) {
           $lc_text .= ' ' . tep_image(DIR_WS_IMAGES . 'stock_on.gif','' . IMAGE_TEXT_STOCK_ON);
           } elseif ($listing[$x]['products_on_order'] != 0) {
           $lc_text .= ' ' . tep_image(DIR_WS_IMAGES . 'stock_on_order.gif','' . IMAGE_TEXT_STOCK_ON_ORDER .  $listing[$x]['products_on_order']);
           } else {
           $lc_text .= ' ' . tep_image(DIR_WS_IMAGES . 'stock_out.gif','' . IMAGE_TEXT_STOCK_OUT);// . ' ' . TEXT_INFO_STOCK_OUT;
           }
           break;
       }
// EOF Separate Pricing per Customer
       $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
 }
?>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
   <td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 </tr>
</table>
</form>

Share this post


Link to post
Share on other sites

Hello

 

I have QPBPP for SPPC v2.0 installed on an OSC RC2a. I can not figure out how to get quantity price on product listing page, I have no overviw of this in the moment. I have 2 price categories, now showing only the highest price. I want to show both the lowest and the highest price.

 

Hope you understand what I mean, I've spent days reading the posts in the forum but can not find anything that can help.

 

Thanks in advance.

 

Havkrog / Denmark

 

If I remember right, QPBPP lets you offer a discount for buying multiple items, so e.g. £10 each for 1, £8 each if you buy ten, and the price is displayed by product_listing.php as "from £8". If you want to change this to display from £8 - £10, you might find a solution in the QPBPP thread: forums.oscommerce.com/topic/220794-quantity-price-breaks/

 

You would then have to adapt it to fit with the SPPC changes to product_listing.php


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

I have Product Listing Enhancements, Thumbnails & Manufacturer Headings

 

but I have not gotten to merge with sppc... does any body do it already.

 

original from Product Listing Enhancements catalog/modules/product_listing.php

<?php
/*
 $Id: product_listing.php, v 2.2 2009/11/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
$no_drop = true; // set to true to remove resuls/page & sort order drop downs
$set_width = true; // set to false to allow columns to find their own widths in list mode
$sale = false; // set to true to show sale prices if you have SaleMaker installed.
$show_ratings = false; // set to true to show the products average review rating
$checkbox =  true; // set to true to show a checkbox field in place of other quantity boxes, will only show for multi add to cart.

$max_rows = intval($specials ? MAX_DISPLAY_SPECIAL_PRODUCTS : ($new_page ? MAX_DISPLAY_PRODUCTS_NEW : ($new_mode ? MAX_DISPLAY_NEW_PRODUCTS : MAX_DISPLAY_SEARCH_RESULTS)));
if (tep_not_null($HTTP_GET_VARS['sort'])) $_GET['sort'] = $HTTP_GET_VARS['sort'];
$max_results = (tep_not_null($_GET['max']) ? $_GET['max'] : $max_rows);
if (PRODUCTS_PER_ROW == 'PRODUCTS_PER_ROW' || PRODUCTS_PER_ROW == 0 || LISTING_SWITCH == 'LISTING_SWITCH') { $to = 'Setup Error!\nPlease ensure you have run the\nInstall SQL 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);
			$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 . 'a', 'text' => TABLE_HEADING_PRODUCTS . APHA_ORDER);
				$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 . 'a', 'text' => TABLE_HEADING_MANUFACTURER . APHA_ORDER);
				$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 . 'a', 'text' => TABLE_HEADING_QUANTITY . NUM_ORDER);
				$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 . 'a', 'text' => TABLE_HEADING_WEIGHT . NUM_ORDER);
				$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 . 'a', 'text' => TABLE_HEADING_PRICE . NUM_ORDER);
				$sort_array[] = array('id' => $i+1 . 'd', 'text' => TABLE_HEADING_PRICE . REVERSE_NUM_ORDER);
         break;	
     }
   }

// Max Results Array		
for ($i=1; $i<10; $i++) {		
	$max_display[] = array('id' => $max_rows * $i, 'text' => $max_rows * $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');
$data_ok = ($listing_split->number_of_rows > 0);
$list_mode = isset($_GET['list']) ? $_GET['list'] : PRODUCT_THUMBNAIL_VIEW;
$thumbnail_view = strstr($list_mode, 'thumbnails');
$global_add = PRODUCT_LIST_MULTI_BUY;
$multi_add = ($global_add != 'false' && !$new_mode);
if ($new_mode) $no_drop = true;

if (LISTING_SWITCH != 'false' && $data_ok && !$new_mode) $switch = '<br /><span class="smallText"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('list')). 'list='.($thumbnail_view ? 'manufacturer' : 'thumbnails')) . '">' . ($thumbnail_view ? LIST_VIEW : THUMB_VIEW).'</a></span><br />';
if (LISTING_SWITCH != 'bottom') echo $switch; 
$gbutton = ($data_ok ? tep_image_submit('button_multi_in_cart.gif', MULTI_ADD_ALT) : '') . '</div>';
$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 = $no_drop ? '' : '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="drop"><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 && $data_ok) echo '<div id="drop1">' . $drop . '</div>';
if ($multi_add) { echo tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_multi')); if ($global_add != 'bottom') echo '<div class="multi_buy_now" id="gbutton1">' . $gbutton;	}
if (($show_ratings || PRODUCT_LIST_DESCRIPTION ) && $data_ok) {
	$listing_query = tep_db_query($listing_split->sql_query);
	while ($products = tep_db_fetch_array($listing_query)) $id_array[] = $products['products_id'];  
	$pid_string = implode(',', array_unique($id_array));
	}
if (PRODUCT_LIST_DESCRIPTION && $data_ok) {
   $product_query = tep_db_query("select products_id, products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $pid_string . ") and language_id = '" . (int)$languages_id . "'");
	while ($products = tep_db_fetch_array($product_query)) {    
			$t_desc[$products['products_id']] = substr(strip_tags($products['products_description']), 0, PRODUCT_LIST_DESCRIPTION_MAX_LENGTH);  
  }
}
if ($show_ratings && $data_ok) {
   $rating_query = tep_db_query("select count(*) as count, products_id, sum(reviews_rating) as total from " . TABLE_REVIEWS . " where products_id in (" . $pid_string . ") group by products_id");
	while ($rating = tep_db_fetch_array($rating_query)) {    
			$review[$rating['products_id']] = ceil($rating['total'] / $rating['count']);  
  }
}

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 extra_fields($products_id) {
	global $languages_id;
   $extra_fields_text = '';
		if (tep_not_null(TABLE_PRODUCTS_EXTRA_FIELDS) && LISTING_EXTRA_FIELDS == 'true') {
     $extra_fields_query = tep_db_query("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_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");
		while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
		$extra_fields_text .= '<tr><td class="smallText"><span class="xtra-field-name">' . $extra_fields['name'] . ': </span><span class="xtra-field-value">' . $extra_fields['value'] . '</span></td></tr>';
		}		
	}	
	return $extra_fields_text;	
}	

function product_description($product_id,$link,$thumb=false) {
   global $head_title, $t_desc, $review;
	if ($review[$product_id]) $rating = '<span class="smallText"><br />' . sprintf(TEXT_AVERAGE_REVIEW, tep_image(DIR_WS_IMAGES . 'stars_' . $review[$product_id] . '.gif',sprintf(TEXT_AVERAGE_REVIEW,$review[$product_id]))) . '</span>';
		if (PRODUCT_LIST_DESCRIPTION) {
   	return ($head_title || $thumb ? '' : '<br />') . '<span class="productListing-short">' . $t_desc[$product_id] . $link . '<b>...' . MORE . '</b></a></span>' . $rating;
	} else {
	return $rating; 
	}
 }	

function product_price ($listing,$last=false) {
   global $sale;
	$currencies = new currencies();
	$p_price = $listing['products_price'];
	$price = (function_exists(display_short_price)) ? $currencies->display_short_price($p_price, tep_get_tax_rate($listing['products_tax_class_id'])) : $currencies->display_price($p_price, tep_get_tax_rate($listing['products_tax_class_id'])); 
        if ($sale && $new_price = tep_get_products_special_price($listing['products_id'])) { 
									$price = '<s>' .  $price . '</s>' . ($last ? '<br />' : '  ') . '<span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
				} elseif (tep_not_null($listing['specials_new_products_price'])) {
             $price = '<s>' .  $price . '</s>' . ($last ? '<br />' : '  ') . '<span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
         } 
	$price = ($p_price > 0 ? '' . $price . '' : '' . TEXT_POA); 
	if (function_exists(tep_get_att_price)) $price .= (tep_get_att_price($listing['products_id']) > 0 ? '+' : '') ; 

	return '<span class="productListing-list-price">' . $price . '</span>';		
 }			


function list_row ($listing, $column_list) {
		global $rows, $gborders, $list_box_contents, $cPath, $cat_path, $head_title, $man_id;
     $list_box_contents[][] = array('text' =>  '<br />');
		if (!$rows && $gborders) $list_box_contents = array();			
		$rows++;
		$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"' : '') . '>';
     		if ($head_title) { 
				    	if (in_array('PRODUCT_LIST_PRICE',$column_list)) $price = '<p style="float: right">' . product_price ($listing) . '</p>';
							$list_box_contents[][] = array('align' => 'left',
                                          'params' => 'colspan="'.sizeof($column_list).'" class="productListing-title"',
                                          'text' =>  '<div style="clear: both; width:100%;"><p style="float: left">' . $link . '<b>' . $listing['products_name'] . '</b></a></p>' . $price . '</div>');
				}
		$list_box_contents[] =	list_box_data($listing, $column_list, $link); 
		$list_box_contents[][] = array('align' => 'center',
                                          'params' => 'class="separator" colspan="'.sizeof($column_list).'"',
                                          'text' =>  '<br />');	
		return true;																		 
		}		
?>			
<script type="text/javascript" language="javascript">
<!--
function changeValue(inObject,delta)
{  var myVal = parseInt(inObject.value);
	isNaN(myVal) ? myVal = delta : myVal = myVal + delta;
	inObject.value = Math.max(myVal,0); 
	return; } 

// -->
</script>
<?php
function quantity ($products_id,$p_price) {
global $multi_add, $checkbox, $thumbnail_view, $bx;

		if (PRODUCT_LIST_QUANTITY_BOX != 'false' && strstr(LISTING_BUTTON, 'buy now')) { 
				if (tep_has_product_attributes($products_id) && PRODUCT_LIST_OPTIONS != 'true' && $multi_add) return '<br />'; 
				$pstock = min(tep_get_products_stock($products_id),MAX_QTY_IN_CART); $qbox = ($pstock && $p_price != 0);
				if ($checkbox && $multi_add) { 
							if ($qbox) { $bx++; return 'Select ' . tep_draw_checkbox_field('cart_quantity['.$bx.']',1) . tep_draw_hidden_field('products_id['.$bx.']', $products_id);  
							} else { return '<br />'; }								
				} 
				if (PRODUCT_LIST_QUANTITY_BOX == 'true')
				return ($qbox ? '<table  cellspacing="0" cellpadding="2"><tr><td class="quantity" >' . QUANTITY . tep_draw_input_field('cart_quantity' . ($multi_add ? '[]' : '') , ($multi_add ? '0' : '1') , 'maxlength="5" size="2" id="qid'.$products_id.'"') . ($multi_add ? tep_draw_hidden_field('products_id[]', $products_id) : '') . '</td><td><a href="javascript:changeValue(document.getElementById(\'qid'.$products_id.'\'),1);">' . tep_image_button('btn_up.gif',MORE) . '</a><br><a href="javascript:changeValue(document.getElementById(\'qid'.$products_id.'\'),-1);">' . tep_image_button('btn_down.gif',LESS) . '</a></td></tr></table>' : '<br /><br />');
				else
			$qty_array = array(); 
			for ($i=0; $i<=$pstock; $i++) {	$qty_array[]=array('id' => $i, 'text' => $i); }
			return ($qbox ? '<div class="quantity" align="' . ($thumbnail_view ? 'center' : 'right' ) .'">' . QUANTITY . tep_draw_pull_down_menu('cart_quantity'.($multi_add ? '[]' : ''),$qty_array,($multi_add ? 0 : 1)) . '<br />' . ($multi_add ? tep_draw_hidden_field('products_id[]', $products_id) : '') . '</div>' : '<br />');
				} else { return false; }
		}																			 		

function list_box_head($column_list) {
 global $set_width, $head_title;
 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
if ($head_title && $column_list[$col] == 'PRODUCT_LIST_PRICE') continue;
   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" ' . ($set_width ? 'width="'.(int)(100/sizeof($column_list)) . '%"' : ''),'text' => ' ' . $lc_text . ' ');
 }
 return ($list_box_contents);
}
// function list_head end	

function list_box_data($listing, $column_list, $link) {
       global $PHP_SELF, $ttip, $head_title, $rows, $set_width, $multi_add;
			$alt_text = $listing['products_name'];	
			$image = (file_exists(DIR_WS_IMAGES . $listing['products_image']) ? $listing['products_image'] : 'no-image.jpg');								
   		$image = '<span class="ttip">' . $link . tep_image(DIR_WS_IMAGES . $image, $alt_text, PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT) . ($ttip ? tep_image(DIR_WS_IMAGES . $image, $alt_text, IMAGE_TTIP_WIDTH, '', 'class="large"') : '' ) . '</a></span>';
			$name = (!$head_title ? $link . '<span class="productListing-name">' . $listing['products_name'] . '</span></a>' : ''); 
			if (LISTING_BUTTON != 'none' && PRODUCT_LIST_BUY_NOW) {
       $buypic = (LISTING_BUTTON == 'buy now' ? 'button_in_cart.gif' : 'button_buy_now.gif');
			$p_price = $listing['products_price']; 
			$quantity_box = quantity ($listing['products_id'], $p_price);
			$form = ($multi_add ? '' : tep_draw_form('cart_quantity_' . $rows, tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_product')));
			$buytable = '<table class="buytable" border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td valign="bottom" class="productListing-data">';
			$buytableend = '</td></tr></table>'. ($multi_add ? '' : '</form>');
			$detail = $link . tep_image_button((strstr(LISTING_BUTTON, '&') || (strstr(LISTING_BUTTON, 'small')) ? 'button_details_small.gif' : 'button_details.gif'), IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a> ';
			$add_cart = ($multi_add ? ($quantity_box ? '' : $detail) : tep_draw_hidden_field('products_id', $listing['products_id']) . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"'));
			$button = (LISTING_BUTTON == 'buy now & details' ? ($add_cart == $detail ? $add_cart : $add_cart . ' <span class="buy_now">|</span> ' . $detail ) : (strstr(LISTING_BUTTON, 'buy now') ? $add_cart : $detail ));	
			if ($p_price == 0 || (isset($listing['products_quantity']) && !$listing['products_quantity'])) { $button = $detail; $quantity_box = '';}//'<span class="buy_now"> </span>'. 
			}
			$list_box_temp =  array('params' => 'class="list-block"');
			if (!strstr(PRODUCT_THUMBNAIL_VIEW, 'block'))	{		
			for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
			if ($head_title && $column_list[$col] == 'PRODUCT_LIST_PRICE') continue;
       $lc_align = '';
			$params = 'class="productListing-data" ' . ($set_width ? 'width="'.(int)(100/sizeof($column_list)) . '%"' : '') . ' valign="top" ';		
       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 = $name . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br /><span class="short">' . $listing['short_desc'] . '</span>' : '') . product_description($listing['products_id'],$link);
					$extra_fields_text = extra_fields($listing['products_id']);
					if ($extra_fields_text) $lc_text .= '<br /><table>' . $extra_fields_text . '</table>';
          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':
				  if(!$head_title) {
           	$lc_align = 'right';
						$lc_text = product_price ($listing);
					}	
           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 = $image;
           break;
         case 'PRODUCT_LIST_BUY_NOW':
				  if (PRODUCT_LIST_OPTIONS == 'true' ) $params = 'class="productListing-data" width="'.(int)((100/sizeof($column_list))*2).'%" colspan="2"'; 
				  $lc_align = 'center';
					$button = $quantity_box . $button;
           $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 {  
	if (PRODUCT_LIST_IMAGE) { $list_box_temp[] = array('align' => 'center',
                               							'params' => 'class="productListing-data" ',
                               							'text'  => $image);   }
	     $display ='';$text = '';
	for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
	if ($head_title && $column_list[$col] == 'PRODUCT_LIST_PRICE') continue;
	    $last = (($col + BLOCK_LAST_SIZE + 1) > $n);
			$text .= ($text ? '<br />' : '');  
			switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
				  $text .= $listing['products_model'];
					if (!$last) {$display .= $text . '<br />'; $text = '';}
           break;
         case 'PRODUCT_LIST_NAME':
           $text .= $name . ($listing['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '<br /><span class="short">' . $listing['short_desc'] . '</span>' : '') . product_description($listing['products_id'],$link);
					$extra_fields_text = extra_fields($listing['products_id']);
					if ($extra_fields_text) $text .= '<br /><table>' . $extra_fields_text . '</table>';
					if (!$last) {$display .= $text . '<br />'; $text = '';}
          break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $text .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a>';
					if (!$last) {$display .= $text . '<br />'; $text = '';}
           break;
         case 'PRODUCT_LIST_PRICE':
				  $text .= ($last ? '' : '<br />Price: ') . product_price ($listing, $last) . ($last ? '' : '<br />'); 
					if (!$last) {$display .= $text . '<br />'; $text = '';}
           break;
         case 'PRODUCT_LIST_QUANTITY':
           $text .= ($listing['products_quantity'] ? 'Stock = ' . $listing['products_quantity'] : 'Out of Stock');
					if (!$last) {$display .= $text . '<br />'; $text = '';}
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $text .= 'Weight = ' . $listing['products_weight'].WEIGHT_ABRV . ($last ? '' : '<br />');
					if (!$last) {$display .= $text . '<br />'; $text = '';}
           break;
				case 'PRODUCT_LIST_BUY_NOW':
				  $button = '<div align="right" width="100%">' . $quantity_box . '</div>' . ($last ? '' : '  ') . $button;
           $text .= $form . $buytable . (PRODUCT_LIST_OPTIONS == 'true' ? '<div ' . ($last ? 'align="right"' : 'align="left"' ) . ' width="100%">' . attribute_drop($listing['products_id'],$listing['products_tax_class_id']) . '</div>' . $button : $button) . $buytableend; //'<br />' . 

					if (!$last) {$display .= $text . '<br />'; $text = '';}
           break;	
			}
		}	
		  $display .= '';

$list_box_temp[] = array('align' => 'left',
                            'params' => 'class="main" valign="top" ',
                            'text'  => $display);
$list_box_temp[] = array('align' => 'right',
                            'params' => 'class="productListing-data" valign="top" ',
                            'text'  => $text);
	}
	return 	($list_box_temp);	
   }
// function list_box_data end	

function attribute_drop($products_id,$tax_class_id) {
global $languages_id, $multi_add;
$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" class="attributes">';

	$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 class="attributes" >' . $products_options_name['products_options_name'] . ':' . '</td><td align="left">' . tep_draw_pull_down_menu('id' . ($multi_add ? '['. $products_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	

$empty_list=false;//$man_id = (tep_not_null($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : '');
if ($man_id = (tep_not_null($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : '')) {
$title_name = tep_get_manufacturer_name($_GET['manufacturers_id']);
} else {
$title_name =  ($specials ? $specials : ($new_page ? '' : ($new_mode ? $new_mode : (!$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);//$gborders = false;
$Tborder = (!$gborders ? '<div class="infoBoxList" style="width:100%;">' : mws_boxHeader('<big>'.$title_name.'</big>'));
$Tborderend = (!$gborders ? '</div>' : mws_boxFooter ());
$border2 = (!$gborders ? '<div class="infoBoxList" style="width:100%;">' : ($graphic_bord == 'yes' ? mws_boxHeader('<big>'.$title_name.'</big>') : ''));  
$border2end = (!$gborders ? '</div>' : ($graphic_bord == 'yes' ? mws_boxFooter() : ''));
$list_box_empty[] = array(array('params' => 'class="productListing-data"','text' => TEXT_NO_PRODUCTS));
$ttip = (IMAGE_TTIP == 'true');
$head_title = (PRODUCT_LIST_HEAD_TITLE == 'true');	
$man_desc = (MANU_DESCRIPTION == 'true');

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

// output selected display
if ($thumbnail_view) {  //thumbnail
 $row = 0;
 $col = 0;
$border = (!$grid ? '<div class="infoBoxProducts" style=" width:'.PRODUCT_LIST_WIDTH.'px; height:'.PRODUCT_LIST_HEIGHT.'px;" >' : '<br />');
$borderend = (!$grid ? '</div>' : '');
$style = (!$grid ? 'class="smallText"' : 'class="infoBoxGrid"');
$info_box_contents = array();
if ($data_ok) {   $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 ? (int)(100/PRODUCTS_PER_ROW) : '').'%" valign="top"',
                                          'text' =>  ' ');  
			echo $Tborder;$row ++;
			if (!$gborders && $grid && $title_name) {
					$info_box_heading[0] = array('text' => '<big>'.$title_name.'</big>');
					new infoBoxHeading($info_box_heading, false, false);	
			}																			 
	 }

		// build thumb
	$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"' : '') . '>';
	$p_price = $products['products_price']; 
	$quantity_box = quantity ($products['products_id'],$p_price);
	$image = (file_exists(DIR_WS_IMAGES . $products['products_image']) ? $products['products_image'] : 'no-image.jpg'); 
	$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']))); 
							    } 
	$alt_text = ($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']);									
   $image = (!$grid && $column_list[0] == 'PRODUCT_LIST_IMAGE' ? '<br />' : '') . ' <span class="ttip">' . $link . tep_image(DIR_WS_IMAGES . $image, $alt_text, PRODUCT_IMAGE_WIDTH, PRODUCT_IMAGE_HEIGHT)  . ($ttip ? tep_image(DIR_WS_IMAGES . $image, $alt_text, IMAGE_TTIP_WIDTH, '', 'class="large"') : '' ) . '</a></span>' . '<br />';
	if (LISTING_BUTTON != 'none' && PRODUCT_LIST_BUY_NOW) {
	$buypic = (LISTING_BUTTON == 'buy now' ? 'button_in_cart.gif' : 'button_buy_now.gif');
	$detail = $link . tep_image_button((strstr(LISTING_BUTTON, '&') || (strstr(LISTING_BUTTON, 'small')) ? 'button_details_small.gif' : 'button_details.gif'), IMAGE_BUTTON_DETAILS, 'class="thm_buy_now"') . '</a>';
	$add_cart = ($multi_add ? ($quantity_box ? '' : $detail) : tep_draw_hidden_field('products_id', $products['products_id']) . tep_image_submit($buypic, IMAGE_BUTTON_BUY_NOW, 'class="thm_buy_now"'));
	$button = (LISTING_BUTTON == 'buy now & details' ? '<br />' . $quantity_box . ($add_cart == $detail ? $add_cart : $add_cart . ' <span class="buy_now">|</span> ' . $detail . '<br /><br />') : (strstr(LISTING_BUTTON, 'buy now') ? '<br />' . $quantity_box . $add_cart . '<br /><br />' : '<br />'. $detail . '<br /><br />' ));	
	if ($p_price == 0  || (isset($products['products_quantity']) && !$products['products_quantity'])) { $button = $quantity_box . '<br /><span class="buy_now"> </span>'. $detail . '<br />';$quantity_box = ''; }
	}
	$name =	'<div class="productListing-name">' . $link . $products['products_name'] . '</a></div>'. ($products['short_desc'] && (PRODUCT_SHORT_DESC == 'true') ? '' . $products['short_desc'] . '<br />' : '') . product_description($products['products_id'],$link, true);	 
	$show_price = '<br />' . product_price($products) . '<br />';
	$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>' . extra_fields($products['products_id']) . '</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;	
				}
	}
	$form = ($multi_add ? '' : tep_draw_form('cart_quantity_' . $col . $row, tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','products_id')) . 'action=add_product')));
	$display .= $borderend . $form . '' . (PRODUCT_LIST_OPTIONS == 'true' ? attribute_drop($products['products_id'],$products['products_tax_class_id']) . $button : $button) . ($multi_add ? '' : '</form>');
			// thumb built			 


	 $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => $style . ' width="'.(PRODUCTS_PER_ROW ? (int)(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 ? (int)(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 ($gborders ? '' : '') . $Tborderend;
 							  } else {$empty_list=true; }
} elseif (strstr($list_mode, 'manufacturer') && !$new_mode) {  //manufacturer

$row = 0;$col = 0;

if ($man_id) {
$filterlist_sql= tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name" . ($man_desc ? ", 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)$man_id . "' and mi.languages_id = '" . (int)$languages_id . "'");
 }else{
$filterlist_sql= tep_db_query("select distinct m.manufacturers_id, m.manufacturers_name" . ($man_desc ? ", 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 />'.($man_desc ? $manufacturer['manufacturers_description'].'<br />' : ''));
	new infoBoxHeading($info_box_heading, false, false);	
  $list_box_contents = array();
   $list_box_contents[0] = (LISTING_HEADINGS == 'true' && !strstr(PRODUCT_THUMBNAIL_VIEW, 'block') ? list_box_head($column_list) : '');
   if ($data_ok) { $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;
	list_row ($listing, $column_list);
  }
	$list_box_contents[sizeof($list_box_contents)-1] = array(array('text' =>  '<br />'));
  if (!$rows && $man_id) {
   $rows++;  $list_box_contents = $list_box_empty; $empty_list=true;}
  if ($rows) new productListingBox($list_box_contents); 
   echo $border2end; 
	//echo '<div class="multi_buy_now" id="gbutton2">' . $gbutton;
}   // man loop;
} else {$empty_list=true; }  // no manufacturers!!
}
if ((!$thumbnail_view && !strstr($list_mode, 'manufacturer')) || $empty_list  || ($new_mode && !$thumbnail_view)) {   //default listing

 if ($man_desc && $man_id) { 
$manufacturer_query = tep_db_query("select manufacturers_description from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)($man_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)) {
	list_row ($listing, $column_list);
   }
	$list_box_contents[sizeof($list_box_contents)-1] = array(array('text' =>  '<br />'));
  $empty_list = false;
	echo $border2; 
	if ($title_name) new infoBoxHeading($info_box_heading, false, false);	
   new productListingBox($list_box_contents);
	echo $border2end; 
 } else {
   new productListingBox($list_box_empty); $empty_list=true;
 }

 }
if ($multi_add) { if ($global_add != 'top') echo '<div class="multi_buy_now" id="gbutton2">' . $gbutton;	echo '</form>'; }
if ($base_nav && !$empty_list) echo $drop;
if (($listing_split->number_of_rows > (int)$max_results) && $base_nav) echo $page_nav;
if (LISTING_SWITCH != 'top') echo $switch . '<br />';
  //echo '<hr>' . $listing_sql . '<hr>' . $listing_split->number_of_rows . ' records.'; 

?>

 

original from Product Listing Enhancements catalog/modules/new_products.php

 

<?php
/*
 $Id: new_products.php v2.8 2009-12-31 22:48:15Z hpdl $
 modified for thumbnail view 2007-07-24
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2008 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- new_products //-->
<?php
$max_age = tep_not_null( MAX_DISPLAY_PRODUCTS_NEW_AGE ) ?  MAX_DISPLAY_PRODUCTS_NEW_AGE : 60; // set max age of displayed product
$date = strtotime("-" . $max_age . " days"); 
$date = strftime("%Y-%m-%d",$date); 

$new_mode = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'));

   $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_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_NAME':
         $select_column_list .= 'pd.products_name, ';
         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_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }
$order = ' order by p.products_date_added desc';
// $order = ' order by rand()'; // uncomment if you want products in a random order


 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
   $new_products_query = "select " . $select_column_list . "p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_quantity from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'" . $order;
 } else {
   $new_products_query = "select distinct " . $select_column_list . "p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_quantity from " . TABLE_PRODUCTS . " p  left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'" . $order;
 }

$listing_sql = $new_products_query;
include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); 
?>
<!-- new_products_eof //-->

 

original from Product Listing Enhancements catalog/products_new.php

 

<?php
/*
 $Id: products_new.php v2.8 2009-12-31 00:52:16Z hpdl $
 modified for thumbnail view 2007-07-24
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
require('includes/application_top.php');
unset($_GET['manufacturers_id']);
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));

?>
<!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">
<?php include (DIR_WS_INCLUDES . 'page-header-inc.htc'); ?>
</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_products_new.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>
<?php
 $products_new_array = array();
$max_age = tep_not_null( MAX_DISPLAY_PRODUCTS_NEW_AGE ) ?  MAX_DISPLAY_PRODUCTS_NEW_AGE : 60; // set max age of displayed product
$date = strtotime("-" . $max_age . " days"); 
$date = strftime("%Y-%m-%d",$date); 
	$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_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_NAME':
         $select_column_list .= 'pd.products_name, ';
         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_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }
	 $sort_sql='';
   if ( (!isset($_GET['sort'])) || (!ereg('^[1-8][ad]$', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) {

         $_GET['sort'] = 0 . 'd';
         $sort_sql = " order by p.products_date_added DESC, pd.products_name";

   } else {
     $sort_col = substr($_GET['sort'], 0 , 1);
     $sort_order = substr($_GET['sort'], 1);

     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $sort_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $sort_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $sort_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $sort_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $sort_sql .= " order by pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $sort_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $sort_sql .= " order by p.products_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;	
     }
}


 $products_new_query_raw = "select " . $select_column_list . "p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_date_added > '".$date."' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'" . $sort_sql; 

		$listing_sql = $products_new_query_raw;
		$new_page = true;
 ?>
		<tr>
       <td><?php include(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'); ?>

 

original from Product Listing Enhancements catalog/specials.php

 

<?php
/*
 $Id: specials.php,v 2.8 2009/12/31 22:35:33 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

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

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SPECIALS));
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<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">
<?php include (DIR_WS_INCLUDES . 'page-header-inc.htc'); ?>
</head>
<body>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" summary="" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" summary="" 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" summary="" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" summary="" 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_specials.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>
<?php

	$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_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_NAME':
         $select_column_list .= 'pd.products_name, ';
         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_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }
	 $sort_sql='';
   if ( (!isset($_GET['sort'])) || (!ereg('^[1-8][ad]$', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) {

         $_GET['sort'] = 0 . 'd';
         $sort_sql = " order by p.products_date_added DESC, pd.products_name";

   } else {
     $sort_col = substr($_GET['sort'], 0 , 1);
     $sort_order = substr($_GET['sort'], 1);

     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $sort_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $sort_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $sort_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $sort_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $sort_sql .= " order by pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $sort_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $sort_sql .= " order by s.specials_new_products_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;	
     }
}


 $specials_query_raw = "select " . $select_column_list . " p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price  from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' " . $sort_sql;
$listing_sql = $specials_query_raw;
$specials = NAVBAR_TITLE;
 ?>
		<tr>
       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
     </tr>

   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" summary="" 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'); ?>


 

 

those are the files that should be merged...

 

any help

Edited by rabon33

Share this post


Link to post
Share on other sites

Excellent work on the 2.3.1 SPPC code JohnAtYM - thanks - saved me quite a bit of time!..

 

It all seems to work fine for me as well..

 

Cheers,

Pete

Share this post


Link to post
Share on other sites

I have installed 2.3.1

It all seemed to work as planned except for one thing.

 

When I create a group for customer to not display tax.

The following happens:

 

When a customer places an order.

The prices are displayed without tax.

At the end of the order, it shows the amount of tax, but somehow it does not add it to the total.

 

Anyone has any idea, where I need to look?

Share this post


Link to post
Share on other sites

So i looked at all the downloads and I'm kind of lost as to which one to download and install if someone could send me a link to the correct version I would appreciate it. I am using osCommerce Online Merchant v2.3.1

Share this post


Link to post
Share on other sites

If I install Separate Pricing Per Customer will the customer any ware be able to see the name of the group they are in? or is it only in ADMIN it is visible?

Ok I have installed it.

I haven’t seen any places the customer can see the group name, are there any places?

Share this post


Link to post
Share on other sites

So i looked at all the downloads and I'm kind of lost as to which one to download and install if someone could send me a link to the correct version I would appreciate it. I am using osCommerce Online Merchant v2.3.1

Download the one from 8 mars 2011

From; new_installations_2.3.1 – catalog use a compare tool to merge all the files.

From new_installations_2.2 – install_separate_price_422 follow this

Manual Installation
Before beginning the manual install you need to:
Upload five included image files to your site. They are (and located in):
•catalog/admin/images/icon_down.gif
•catalog/admin/images/icon_up.gif
•catalog/admin/includes/languages/english/images/buttons/button_group_prices.gif
•catalog/admin/images/icons/tick_black.gif
•catalog/admin/images/icons/icon_tick.gif
The first two are used in admin/customers.php (you may already have those if you use for example Quick Price Updates) and the other three are used in admin/attributes.php and admin/attributes_groups.php.
Upload four new .php files:
catalog/admin/includes/languages/english/customers_groups.php, catalog/admin/includes/languages/english/attributes_groups.php, catalog/admin/customers_groups.php, and catalog/admin/attributes_groups.php.
Run the spcc_v421_install.sql database installation file on your MySQL database.
Modify the catalog/includes/languages/english/login.php file to include the Site Administrator's email address. This email address is used for wholesale account notifications. You can find the appropriate section of that file by doing a search for the keyword root.

Share this post


Link to post
Share on other sites

ok so i've installed SPPC and now i am wondering if there is a way i can make wholesale price 10% off the retail price? it seems that there is only a field for an actual price and not a mark down

Share this post


Link to post
Share on other sites

After adding Add Multi with Plus Minus Button the product_listing.php changed to product_listing_multi.php

so I try to get the price group to work with it

But now getting the following

Parse error: syntax error, unexpected T_ELSE in C:\Program Files\EasyPHP-5.3.8.0\www\includes\modules\product_listing_multi.php on line 229

What is wrong?

case 'PRODUCT_LIST_BUY_NOW':			
$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[$x]['products_id']) . '">'  . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) .  '</a> ';
$lc_text = '<input type=button value="  -1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),-1);return  false;"><input type="text" name="add_id['.$number_of_products.']"  id="add_id_'.$listing[$x]['products_id'].'" value="0" size="4"><input  type=button value="+1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),1);return  false;">';
$lc_text .= '<input type="hidden"  name="products_id['.$number_of_products.']"  value="'.$listing[$x]['products_id'].'">';			
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>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 </tr>
</table>
</form>
<?php

This is the whole file

<form name="cart_multi" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, tep_get_all_get_params(array('action')) . 'action=add_multi', 'NONSSL'); ?>">
<script language=javascript> function changeValue(textObject,delta){  var myVal = parseInt(textObject.value);  if (myVal == NaN) {   myVal = 0;   } else {  myVal = myVal + delta;  }  /* check that it is not negetive */  if (myVal < 0) {  myVal = 0;  }  textObject.value = myVal;  return; } </script>
<?php
/*
 $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $
 adapted for Separate Pricing Per Customer v4.2 2007/08/23
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/
 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
 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="0">
 <tr>
<td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 </tr>
</table>
<br>
<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;
  // START: display min. order. qty. mod
  case 'PRODUCT_LIST_MIN_ORDER_QTY':
	$lc_align = 'center';
	$lc_text = ' ' . TABLE_HEADING_MIN_ORDER_QTY . ' ';
	break;
  // END: display min. order. qty. mod
  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);
// 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)
//	while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
  $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[$x]['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=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
		} else {
		  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a> ';
		}
		break;
	  case 'PRODUCT_LIST_MANUFACTURER':
		$lc_align = '';
		$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> ';
		break;
	  case 'PRODUCT_LIST_PRICE':
		$lc_align = 'right';
		if (tep_not_null($listing[$x]['specials_new_products_price'])) {
		  $lc_text = ' <s>' .  $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> ';
		} else {
		  $lc_text = ' ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' ';
		}
		break;
	  case 'PRODUCT_LIST_QUANTITY':
		$lc_align = 'right';
		$lc_text = ' ' . $listing[$x]['products_quantity'] . ' ';
		break;
	  // START: display min. order. qty. mod
	  case 'PRODUCT_LIST_MIN_ORDER_QTY':
		$lc_align = '';
		$lc_text = ' ' . $listing[$x]['products_min_order_qty'] . ' ';
		break;
	  // END: display min. order. qty. mod
	  case 'PRODUCT_LIST_WEIGHT':
		$lc_align = 'right';
		$lc_text = ' ' . $listing[$x]['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[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['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[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';
		}
		break;
	  case 'PRODUCT_LIST_BUY_NOW':			
$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[$x]['products_id']) . '">'  . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) .  '</a> ';
$lc_text = '<input type=button value="  -1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),-1);return  false;"><input type="text" name="add_id['.$number_of_products.']"  id="add_id_'.$listing[$x]['products_id'].'" value="0" size="4"><input  type=button value="+1" onclick="javascript:changeValue(document.getElementById(\'add_id_'.$listing[$x]['products_id'].'\'),1);return  false;">';
$lc_text .= '<input type="hidden"  name="products_id['.$number_of_products.']"  value="'.$listing[$x]['products_id'].'">';			
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>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td align="right" class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 </tr>
</table>
</form>
<?php
 }
?>

Share this post


Link to post
Share on other sites

With Separate Pricing Per Customer will the customer any ware be able to see the name of the group they are in? Or is it only in ADMIN it is visible?

Come on, many have Separate Pricing Per Customer so many must know if the customer can see the group name? On any page, mails, invoice or other places?

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

×