Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Hi Everyone,

Just got this message after trying to run sppc_v421_install.sql on a very modified 2.2rc2.

 

 

Error

 

SQL query:

INSERT INTO `specials_retail_prices`

SELECT s.products_id, s.specials_new_products_price, s.status, s.customers_group_id

FROM `specials` s

WHERE s.customers_group_id = '0';

MySQL said:

#1062 - Duplicate entry '404' for key 1

 

Please help I am not a programmer and dont really know how to solve this. Thanks in advance.

Edited by pitpower
Link to comment
Share on other sites

Hi, sorry for bad english.

 

I'm still having a problem with the customer groups. If have created two customer groups and gave both different payment and order total values, because i do not want to edit the values for single customers all the time. But if i put a customer in one of the groups in checkout it allways takes "the settings from configuration" and never "from the group", so that i have to edit the values for each customer again.

 

Maybe i missed something while reading this 292 site post... ;)

 

Thanks in advance for help!

 

Greets

Link to comment
Share on other sites

Hi, sorry for bad english.

 

I'm still having a problem with the customer groups. If have created two customer groups and gave both different payment and order total values, because i do not want to edit the values for single customers all the time. But if i put a customer in one of the groups in checkout it allways takes "the settings from configuration" and never "from the group", so that i have to edit the values for each customer again.

 

Maybe i missed something while reading this 292 site post... wink.png

 

Thanks in advance for help!

 

Greets

ok, think i found it. In login.php

// BOF Separate Pricing per Customer
   $check_customer_query = tep_db_query("select customers_id, customers_group_id, customers_firstname, customers_password, customers_email_address, customers_validation, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
// EOF Separate Pricing Per Customer

customers_group_id was missing. mellow.png

Link to comment
Share on other sites

Hello,

I tried installing SPPC on a modified MS2.2 Rc2 with no luck. Contributions installed are as follows:

Attributes Copier, Discount coupon codes, PayPal, Ultra pics - MS2 Image Addon Pack and Ultimate SEO

I am no programmer and could really use major assistance. Would like someone capable to do the install.

Do you have any suggestions? Thanks

Link to comment
Share on other sites

Link to comment
Share on other sites

Link to comment
Share on other sites

I have been prepping this (4.2.2 for osc 2.3.1) to install into osc 2.3.1. I am nearing the end of the install / modification, and I have an issue with catalog/products_new.php.

 

The instructions are for 2.2ms2, so it states to replace:

**REPLACE**
$products_new_query = tep_db_query($products_new_split->sql_query);
   while ($products_new = tep_db_fetch_array($products_new_query)) {
  if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
    $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
  } else {
    $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
  }
?>
	  <tr>
	    <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
	    <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
	    <td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	  </tr>
	  <tr>
	    <td colspüan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
   }
 } else {

 

...but in osc 2.3.1, the stock version of that file is:

 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);
 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
 require(DIR_WS_INCLUDES . 'template_top.php');
?>
<h1><?php echo HEADING_TITLE; ?></h1>
<div class="contentContainer">
 <div class="contentText">
<?php
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, ##### */
 $listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_msrp, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) left join " . TABLE_SPECIALS . " s ON (s.products_id = p.products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
 include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
 </div>
</div>
<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

... and I just can not find where this has been moved to (if it has) since the osc 2.2ms2 version. The instructions for osc 2.3.x would be really helpful!! I think it says that there are files with the osc 2.3.1 code in it, but I haven't found them for this file yet.

Link to comment
Share on other sites

I have been prepping this (4.2.2 for osc 2.3.1) to install into osc 2.3.1. I am nearing the end of the install / modification, and I have an issue with catalog/products_new.php.

 

The instructions are for 2.2ms2, so it states to replace:

**REPLACE**
$products_new_query = tep_db_query($products_new_split->sql_query);
while ($products_new = tep_db_fetch_array($products_new_query)) {
  if ($new_price = tep_get_products_special_price($products_new['products_id'])) {
	$products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>';
  } else {
	$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
  }
?>
	  <tr>
		<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>
		<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
		<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	  </tr>
	  <tr>
		<td colspüan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
}
 } else {

 

...but in osc 2.3.1, the stock version of that file is:

 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);
 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));
 require(DIR_WS_INCLUDES . 'template_top.php');
?>
<h1><?php echo HEADING_TITLE; ?></h1>
<div class="contentContainer">
 <div class="contentText">
<?php
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, ##### */
 $listing_sql = "select p.products_id, pd.products_name, p.products_image, p.products_msrp, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, s.specials_new_products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) left join " . TABLE_SPECIALS . " s ON (s.products_id = p.products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd  where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
 include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
 </div>
</div>
<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

... and I just can not find where this has been moved to (if it has) since the osc 2.2ms2 version. The instructions for osc 2.3.x would be really helpful!! I think it says that there are files with the osc 2.3.1 code in it, but I haven't found them for this file yet.

hope this help you

Link to comment
Share on other sites

I installed the one from 8-mar-2011. My site is heavily modified, but there are a couple of files like catalog/products_new.php and catalog/specials.php that are completely different from osc 2.2 to 2.3.1, and do not include anything resembling each other. And portions of catalog/product_info.php had been moved to catalog/includes/classes/pad_base.php because of the QT Pro contribution, and such, but those changes are due to other contributions.

 

I'm not getting the whole 2.3.1 installation when the installation files are actually from 2.2, not 2.3.1. I'm still having to modify from 2.2 to 2.3.1, so I'm a little confused on this contribution "4.2.2 for osc 2.3.1". Am I missing something here?

Link to comment
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?

Instead of asking the same question over and over, have you thought of creating an account yourself and looking to see if you can see what group you are in. I do not use the contribution so cant really tell you. But looking could be your only answer.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Instead of asking the same question over and over, have you thought of creating an account yourself and looking to see if you can see what group you are in. I do not use the contribution so cant really tell you. But looking could be your only answer.

How do I know I've seen all sorts of places where the group name could appear? osCommerce has many options where the group name could be visible.

with a Contribution has been used by so many uses and has been discussed in so many pages that I think there will be many who have knowledge about this.

Link to comment
Share on other sites

I'm still testing this out on osc 2.3.1. I'm having issues with includes/modules/product_listing.php.

 

If I comment everything out (essentially leaving a blank file - except that mine uses a module for my template that I leave in as a require, from which it echos three things), the products do list in index, but they don't display properly, and there's no Sort By, Page #, or Display x items per page.

 

On a main category, it displays the subcategories on top, like normal. Below that it's suppose to list products within that main category with extra pages when necessary. It only lists products from one category, but at least with the correct customer price.

When I go to a subcategory, it lists up to nine products with the correct customer pricing. The display of products is incomplete and there's no Sort By, Page #, or Display x items per page.

When I go to the next subcategory (the final subcategory), it displays products the way they SHOULD be displayed and this is correct, but the prices are not the customer's pricing. They are the specials prices, but not the correct customer's pricing.

 

The product_info.php does display the correct pricing, although I had to make my own edit to make it work with the MSRP Listing module.

 

I'm really needing to get the products to display correctly, then to make sure the pricing is the same on every page. I'm guessing it's either in the index.php or the product_listing.php. If I'm wrong, please let me know what direction to go in...

Link to comment
Share on other sites

I've compared files with the new_installations_2.3.1 files, and copy/pasted the entire file over (includes/modules/product_listing.php), but that doesn't work for mine.

 

I'm not finding anything in new_products.php, but I'm obviously missing something somewhere. Am I at least in the right files?

 

includes/modules/product_listing.php:

<?php
 //$listing_query = tep_db_query($listing_sql . " LIMIT " . MAX_DISPLAY_SEARCH_RESULTS);

 require(TMPL_DIR_MODULES . 'az_pl_custom.php');
 echo $az_pl_js;
 echo $az_pl_content;
 echo $az_pl_toolbar;
?>

 

new_products.php:

<?php
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 37b) ### */
 //$listing_query = tep_db_query($listing_sql . " LIMIT " . MAX_DISPLAY_NEW_PRODUCTS);

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, (PART OF Separate Pricing Per Customer Step 37b (10.17.11)) ##### */
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_msrp, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, (PART OF Separate Pricing Per Customer Step 37b (10.17.11)) ##### */
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_msrp, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on pd.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c using(categories_id) where c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

// 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';
 }

 if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0) {
  while ($_new_products = tep_db_fetch_array($new_products_query)) {
		$new_products[] = $_new_products;
		$list_of_prdct_ids[] = $_new_products['products_id'];
	}

	$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
	if ($no_of_new_products > 1) {
	 for ($n = 1 ; $n < count($list_of_prdct_ids) ; $n++) {
		 $select_list_of_prdct_ids .= "or products_id = '".$list_of_prdct_ids[$n]."' ";
	 }
	}
// get all customers_group_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 (".$select_list_of_prdct_ids.") and pg.customers_group_id = '".$customer_group_id."'");
		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' => '');
		}

		for ($x = 0; $x < $no_of_new_products; $x++) {
// replace products prices with those from customers_group table
			 if(!empty($new_prices)) {
				 for ($i = 0; $i < count($new_prices); $i++) {
					 if( $new_products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
						 $new_products[$x]['products_price'] = $new_prices[$i]['products_price'];
					 }
				 }
			 } // end if(!empty($new_prices)
		} // end for ($x = 0; $x < $no_of_products_new; $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 (".$select_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'], 'specials_new_products_price' => $specials_array['specials_new_products_price']);
	}

// replace products_price with the correct specials_new_products_price
	if(!empty($new_s_prices)) {
		for ($x = 0; $x < $no_of_new_products; $x++) {
			for ($i = 0; $i < count($new_s_prices); $i++) {
				if( $new_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
					$new_products[$x]['products_price'] = $new_s_prices[$i]['specials_new_products_price'];
				}
			}
		}
	} // // end if(!empty($new_s_prices)

//  $num_new_products = tep_db_num_rows($new_products_query);

//if ($no_of_new_products > 0) {
//  $counter = 0;  
$col = 0;

$new_prods_content = '<table border="0" width="100%" cellspacing="0" cellpadding="2">';
//  while ($new_products = tep_db_fetch_array($new_products_query)) {
//	$counter++;
	for ($counter = 0; $counter < $no_of_new_products; $counter++) {

  if ($col === 0) {
	$new_prods_content .= '<tr>';
  }

  $new_prods_content .= '<td width="33%" align="center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products[$counter]['products_image'], $new_products[$counter]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$counter]['products_id']) . '">' . $new_products[$counter]['products_name'] . '</a><br />' . $currencies->display_price($new_products[$counter]['products_price'], tep_get_tax_rate($new_products[$counter]['products_tax_class_id'])) . '</td>';

  $col ++;

  if (($col > 2) || ($counter == $no_of_new_products)) {
	$new_prods_content .= '</tr>';

	$col = 0;
  }
}

$new_prods_content .= '</table>';
?>

 <h2><?php echo sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')); ?></h2>

 <div class="contentText">
<?php echo $new_prods_content; ?>
 </div>

<?php
 }
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 37b) ### */
?>
<!-- new_products_eof //-->

 

index.php:

 require('includes/application_top.php');
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43b) ### */
 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';
 }
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43b) ### */
// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
   $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
   $categories_products = tep_db_fetch_array($categories_products_query);
   if ($categories_products['total'] > 0) {
  $category_depth = 'products'; // display products
   } else {
  $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
  $category_parent = tep_db_fetch_array($category_parent_query);
  if ($category_parent['total'] > 0) {
    $category_depth = 'nested'; // navigate through the categories
  } else {
    $category_depth = 'products'; // category has no products, but display the 'no products' message
  }
   }
 }
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
 require(DIR_WS_INCLUDES . 'template_top.php');
 if ($category_depth == 'nested') {
   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
<h1><?php echo $category['categories_name']; ?></h1>
<div class="contentContainer">
 <div class="contentText">
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
<?php
   if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
  $category_links = array_reverse($cPath_array);
  for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
    $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
    $categories = tep_db_fetch_array($categories_query);
    if ($categories['total'] < 1) {
	  // do nothing, go through the loop
    } else {
/* +++++ BOF: HIDE CATEGORIES AND PRODUCTS V1.1 +++++ */
/* REPLACED THE FOLLOWING LINE */
//  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
/* ...WITH... */
	 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
/* +++++ EOF: HIDE CATEGORIES AND PRODUCTS V1.1 +++++ */
 break; // we've found the deepest category the customer is in
    }
  }
   } else {
/* +++++ BOF: HIDE CATEGORIES AND PRODUCTS V1.1 +++++ */
/* REPLACED THE FOLLOWING LINE */
// $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
/* ...WITH... */
 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
/* +++++ EOF: HIDE CATEGORIES AND PRODUCTS V1.1 +++++ */
 }
   $number_of_categories = tep_db_num_rows($categories_query);
   $rows = 0;
   while ($categories = tep_db_fetch_array($categories_query)) {
  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '	    <td align="center" class="smallText1" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories['categories_name'] . '</a></td>' . "\n";
  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
    echo '	  </tr>' . "\n";
    echo '	  <tr>' . "\n";
  }
   }
// needed for the new products module shown below
   $new_products_category_id = $current_category_id;
?>
  </tr>
   </table>
   <br />
<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>
 </div>
</div>
<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
					 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
					 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
					 'PRODUCT_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;
   }
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43c) ### */
// this will build the table with specials prices for the retail group or update it if needed
// this function should have been added to includes/functions/database.php
  if ($customer_group_id == '0') {
  tep_db_check_age_specials_retail_table();
  }
  $status_product_prices_table = false;
  $status_need_to_get_prices = false;
  // find out if sorting by price has been requested
  if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
   $_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
   if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
  $status_need_to_get_prices = true;
  }
  }
  if ($status_need_to_get_prices == true && $customer_group_id != '0') {
  $product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;
  // the table with product prices for a particular customer group is re-built only a number of times per hour
  // (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)
  // to trigger the update the next function is called (new function that should have been
  // added to includes/functions/database.php)
  tep_db_check_age_products_group_prices_cg_table($customer_group_id);
  $status_product_prices_table = true;
  }
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43c) ### */
   $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_IMAGE':
	  $select_column_list .= 'p.products_image, ';
	  break;
    case 'PRODUCT_LIST_WEIGHT':
	  $select_column_list .= 'p.products_weight, ';
	  break;
  }
   }
// show the products of a specified manufacturer
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dA) ### */
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, ##### */
//	    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
if ($status_product_prices_table == true) { // ok in mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd , " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' order by s.specials_new_products_price as r group by products_id"; 
} else { // either retail or no need to get correct special prices -- changed for mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' order by s.specials_new_products_price as r group by products_id";
}
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dA) ### */
  } else {
// We show them all
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dB) ### */
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, ##### */
//	    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
    if ($status_product_prices_table == true) { // ok in mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by s.specials_new_products_price as r group by products_id";
} else { // either retail or no need to get correct special prices -- changed for mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by s.specials_new_products_price as r group by products_id";
}
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dB) ### */
  }
   } else {
// show the products in a given category
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dC) ### */
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, ##### */
//	    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
    if ($status_product_prices_table == true) { // ok for mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' order by s.specials_new_products_price as r group by products_id";
    } else { // either retail or no need to get correct special prices -- ok in mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' order by s.specials_new_products_price as r group by products_id";
    }
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dC) ### */
  } else {
// We show them all
/* ### BOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dD) ### */
/* ##### LINE EDIT: MSRP Listing (9.9.11) - INCLUDE p.products_msrp, ##### */
//	    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
    if ($status_product_prices_table == true) {
// original, no need to change for mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' order by s.specials_new_products_price as r group by products_id";
    } else { // either retail or no need to get correct special prices -- changed for mysql 5
/* ##### LINE EDIT: Multiple Sales Per Product (8.30.11) ADD: order by s.specials_new_products_price as r group by products_id (10.22.11) (Step 13a) ##### */
    $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_msrp, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' order by s.specials_new_products_price as r group by products_id";
  }
/* ### EOF: Separate Pricing Per Customer v4.2.2 (10.17.11) (Step 43dD) ### */
  }
   }
/* ##### BOF: Multiple Sales Per Product (8.30.11) ##### */ /* ## REPLACED THIS LINE BY ADDING TO EVERY (8) $listing_sql ABOVE:  order by s.specials_new_products_price as r group by products_id (10.22.11) ## */
//    $listing_sql = "select * from (" . $listing_sql . " order by s.specials_new_products_price) as r group by products_id";
/* ##### EOF: Multiple Sales Per Product (8.30.11) ##### */
   if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
    if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
/* ##### BOF: Multiple Sales Per Product (8.30.11) REPLACED THIS WHOLE SECTION ##### */
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by products_name";  //ORIGINALLY pd.
	  break;
    }
  }
   } else {
  $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
  $sort_order = substr($HTTP_GET_VARS['sort'], 1);
  switch ($column_list[$sort_col-1]) {
    case 'PRODUCT_LIST_MODEL':
	  $listing_sql .= " order by products_model " . ($sort_order == 'd' ? 'desc' : '') . ", products_name";  //ORIGINALLY p. pd.
	  break;
    case 'PRODUCT_LIST_NAME':
	  $listing_sql .= " order by products_name " . ($sort_order == 'd' ? 'desc' : '');  //ORIGINALLY pd.
	  break;
    case 'PRODUCT_LIST_MANUFACTURER':
	  $listing_sql .= " order by manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", products_name";  //ORIGINALLY m. pd.
	  break;
    case 'PRODUCT_LIST_QUANTITY':
	  $listing_sql .= " order by products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", products_name";  //ORIGINALLY p. pd.
	  break;
    case 'PRODUCT_LIST_IMAGE':
	  $listing_sql .= " order by products_name";  //ORIGINALLY pd.
	  break;
    case 'PRODUCT_LIST_WEIGHT':
	  $listing_sql .= " order by products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", products_name";  //ORIGINALLY p. pd.
	  break;
    case 'PRODUCT_LIST_PRICE':
	  $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", products_name";  //ORIGINALLY pd.
	  break;
/* ##### EOF: Multiple Sales Per Product (8.30.11) ##### */
  }
   }
   $catname = HEADING_TITLE;
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  $image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  $image = tep_db_fetch_array($image);
  $catname = $image['catname'];
   } elseif ($current_category_id) {
  $image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
  $image = tep_db_fetch_array($image);
  $catname = $image['catname'];
   }
?>
<h1><?php echo $catname; ?></h1>
<div class="contentContainer">
<?php
// BOF: Store Mode
   if (STORE_MODE == 'Closed') {
?>
 <div class="stockWarning">
   <?php echo CLOSED_MESSAGE . ONLINE_DATE_TIME; ?>
 </div>
<?php
   }
// EOF: Store Mode
?>
<?php
// optional Product List Filter
   if (PRODUCT_LIST_FILTER > 0) {
  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
    $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
  } else {
    $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m 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 . "' order by m.manufacturers_name";
  }
  $filterlist_query = tep_db_query($filterlist_sql);
  if (tep_db_num_rows($filterlist_query) > 1) {
    echo '<div>' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . '<p align="right">' . TEXT_SHOW . ' ';
    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	  echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
    } else {
	  echo tep_draw_hidden_field('cPath', $cPath);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
    }
    echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
    while ($filterlist = tep_db_fetch_array($filterlist_query)) {
	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
    }
    echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
    echo tep_hide_session_id() . '</p></form></div>' . "\n";
  }
   }
   include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
</div>
<?php
 } else { // default page
?>
<?php

$x=1;
$counter= 1;
$counter2= 1;
$ban = array();
$banners_demo = tep_db_query("select * from " . TABLE_BANNERS . " where banners_group = 'index'");
if (tep_db_num_rows($banners_demo) == 0 ) {
$default_banner1 = tep_db_query("insert into " . TABLE_BANNERS . " (banners_title,  banners_url, banners_image, banners_group, date_added, status) values ('banner_left', 'index.php', 'az_banner1.jpg', 'index', now(), 1)");

$default_banner2 = tep_db_query("insert into " . TABLE_BANNERS . " (banners_title,  banners_url, banners_image, banners_group, date_added, status) values ('banner_mid', 'index.php', 'az_banner2.jpg', 'index', now(), 1)");

$default_banner3 = tep_db_query("insert into " . TABLE_BANNERS . " (banners_title,  banners_url, banners_image, banners_group, date_added, status) values ('banner_right', 'index.php', 'az_banner3.jpg', 'index', now(), 1)");

}
$banners_demo_query = tep_db_query("select * from " . TABLE_BANNERS . " where banners_group = 'index' and banners_title = 'banner_left' and status = 1 " );
while ($banners1 = tep_db_fetch_array($banners_demo_query)) 
{
$banner_left = $banners1['banners_id']; 
}
$banners_demo_query = tep_db_query("select * from " . TABLE_BANNERS . " where banners_group = 'index' and banners_title = 'banner_mid' and  status = 1");
while ($banners1 = tep_db_fetch_array($banners_demo_query)) 
{
$banner_mid = $banners1['banners_id']; 
}
$banners_demo_query = tep_db_query("select * from " . TABLE_BANNERS . " where banners_group = 'index' and banners_title = 'banner_right' and   status = 1");
while ($banners1 = tep_db_fetch_array($banners_demo_query)) 
{
$banner_right = $banners1['banners_id']; 
}
?>
<div id="indexDefaultMainContent" class="content">
   <div id="az_dynamic_banner_container">
    <?php require(TMPL_BOXES . 'az_dynamic_banner.php'); ?>
   </div>
   <div class="az_banner_static">

 <div class="banner_staticleft"> <?php echo !($banner_left == '')?str_replace('_blank', '_self', tep_display_banner('static', $banner_left)):""; ?></div>
 <div class="banner_staticmid"><?php echo !($banner_mid == '')?str_replace('_blank', '_self', tep_display_banner('static', $banner_mid)):""; ?></div>
 <div class="banner_staticright"><?php echo !($banner_right == '')?str_replace('_blank', '_self', tep_display_banner('static', $banner_right)):""; ?></div>
   </div>

</div>
<?php
 }
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Edited by The Munch
Link to comment
Share on other sites

Hope someone can help me. I have been looking all over and cant seem to get what I'm looking for.

 

I would like the wholesalers to see their prices and the retail price at the same time for a product, just to show them that they are getting a good price.

 

can someone point me in the right direction please!

Link to comment
Share on other sites

SPPC (4.2.2 for osc 2.3.1):

 

So I've narrowed it down to includes/modules/new_products.php, at least for the prices. I took the version of this file from new_installations_2.3.1, and the prices display correctly as long as you're selecting a category that has subcategories. When you're in the last category displaying its products, the prices are not the customer's group prices.

 

The other issue is the display of the products within category listings:

 

When you select a category with subcategories:

  • the products do not display properly
  • it only displays up to nine or ten products
  • there's no Sort By, Page #, or Display x items per page
  • the prices are correct

But - when you get the category without any more subcategories:

  • the products display correctly
  • all products display
  • the page is complete with the Sort By, Page #, and Display x items per page
  • the prices are wrong

So I'm guessing that the display properties are in another file... Does anyone have an educated guess on this?

Link to comment
Share on other sites

... is there anybody... out... there?

 

This is the last thing killing my site right now, and I could REALLY use some educated assistance!!

Edited by The Munch
Link to comment
Share on other sites

I think I've (possibly) figured out that the problem may lie in that I'm using an AlgoZone template. They've changed some coding, files, and whatnot. I can not find any information on a roadmap of changes to be able to find what's needed for this contribution in osc 2.3.1. The template has never really caused any problems before, when it comes to addons, so I've been a little surprised with this.

 

It's really sucking because the Admin works fine, and most of the site works. It's just this problem I've been describing on the last page of this forum.

 

Has anyone else gotten this to work using an AlgoZone template?

Link to comment
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'); ?>">

 

 

Hi peteravu

 

Did you manage to get this working I'm strangling with the same problem, I'm not and php guru only a beginner and winmerge does not help me to many lines that need to change

 

could you please assist me in this

Link to comment
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'); ?>">

 

Hi peteravu

 

Did you manage to get this working I'm strangling with the same problem, I'm not and php guru only a beginner and winmerge does not help me to many lines that need to change

 

could you please assist me in this

I change the file bacause the product_listing_multi.php is a 2003. So I change the curent product_listing.php to make a new product_listing_multi.php

 

Not sure if I changed other things so please compare witht your old product_listing.php

 

this is my product_listing_multi.php now

 

<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$
adapted for Separate Pricing Per Customer v4.2 2007/08/23
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');
?>

<div class="contentText">
<?php
if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td>
</tr>
</table>
<br>
<div>
<span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>
<span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
</div>
<br />
<?php
}
$prod_list_contents = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header ui-corner-top infoBoxHeading">' .
' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingHeader">' .
' <tr>';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
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_MIN_ORDER_QTY':
$lc_align = 'center';
$lc_text = ' ' . TABLE_HEADING_MIN_ORDER_QTY . ' ';
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
break;
case 'PRODUCT_LIST_BUY_NOW':
$lc_text = TABLE_HEADING_BUY_NOW;
$lc_align = 'center';
break;
}
if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
$lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
}
$prod_list_contents .= ' <td' . (tep_not_null($lc_align) ? ' align="' . $lc_align . '"' : '') . '>' . $lc_text . '</td>';
}
$prod_list_contents .= ' </tr>' .
' </table>' .
' </div>';
if ($listing_split->number_of_rows > 0) {
$rows = 0;
$listing_query = tep_db_query($listing_split->sql_query);
// BOF Separate Pricing per Customer
$no_of_listings = tep_db_num_rows($listing_query);
// global variable (session) $sppc_customer_group_id -> local variable customer_group_id
if(isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
$customer_group_id = $_SESSION['sppc_customer_group_id'];
} else {
$customer_group_id = '0';
}
while ($_listing = tep_db_fetch_array($listing_query)) {
$listing[] = $_listing;
$list_of_prdct_ids[] = $_listing['products_id'];
}
// next part is a debug feature, when uncommented it will print the info that this module receives
/*
echo '<pre>';
print_r($listing);
echo '</pre>';
*/
// get all product prices for products with the particular customer_group_id
// however not necessary for customer_group_id = 0
if ($customer_group_id != '0') {
$pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'");
// $no_of_pg_products = tep_db_num_rows($pg_query) ;
while ($pg_array = tep_db_fetch_array($pg_query)) {
$new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price'], 'specials_new_products_price' => '', 'final_price' => $pg_array['price']);
}
for ($x = 0; $x < $no_of_listings; $x++) {
// replace products prices with those from customers_group table
if(!empty($new_prices)) {
for ($i = 0; $i < count($new_prices); $i++) {
if( $listing[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
$listing[$x]['products_price'] = $new_prices[$i]['products_price'];
$listing[$x]['final_price'] = $new_prices[$i]['final_price'];
}
}
} // end if(!empty($new_prices)
$listing[$x]['specials_new_products_price'] = ''; // makes sure that a retail specials price doesn't carry over to another customer group
$listing[$x]['final_price'] = $listing[$x]['products_price']; // final price should not be the retail special price
} // end for ($x = 0; $x < $no_of_listings; $x++)
} // end if ($customer_group_id != '0')
// an extra query is needed for all the specials
$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in (" . implode(',', $list_of_prdct_ids) . ") and status = '1' and customers_group_id = '" . $customer_group_id . "'");
while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'products_price' => '', 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
}
// add the correct specials_new_products_price and replace final_price
for ($x = 0; $x < $no_of_listings; $x++) {
if(!empty($new_s_prices)) {
for ($i = 0; $i < count($new_s_prices); $i++) {
if( $listing[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
$listing[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
$listing[$x]['final_price'] = $new_s_prices[$i]['final_price'];
}
}
} // end if(!empty($new_s_prices)
} // end for ($x = 0; $x < $no_of_listings; $x++)
$prod_list_contents .= ' <div class="ui-widget-content ui-corner-bottom productListTable">' .
' <table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListingData">';
// while ($listing = tep_db_fetch_array($listing_query)) { (was original code)
for ($x = 0; $x < $no_of_listings; $x++) {
$rows++;
$prod_list_contents .= ' <tr>';
for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$prod_list_contents .= ' <td>' . $listing[$x]['products_model'] . '</td>';
break;
case 'PRODUCT_LIST_NAME':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>';
} else {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></td>';
}
break;
case 'PRODUCT_LIST_MANUFACTURER':
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a></td>';
break;
case 'PRODUCT_LIST_PRICE':
if (tep_not_null($listing[$x]['specials_new_products_price'])) {
$prod_list_contents .= ' <td align="right"><del>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span></td>';
} else {
$prod_list_contents .= ' <td align="right">' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</td>';
}
break;
case 'PRODUCT_LIST_QUANTITY':
$prod_list_contents .= ' <td align="right">' . $listing[$x]['products_quantity'] . '</td>';
break;
case 'PRODUCT_LIST_MIN_ORDER_QTY':
$prod_list_contents .= ' <td align="right">' . $lc_text = ' ' . $listing[$x]['products_min_order_qty'] . ' ';
break;
case 'PRODUCT_LIST_WEIGHT':
$prod_list_contents .= ' <td align="right">' . $listing[$x]['products_weight'] . '</td>';
break;
case 'PRODUCT_LIST_IMAGE':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
} else {
$prod_list_contents .= ' <td align="center"><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['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>';
}
break;
case 'PRODUCT_LIST_BUY_NOW':
$prod_list_contents .= ' <td align="center">' . $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="3"><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;
}
}
$prod_list_contents .= ' </tr>';
}
$prod_list_contents .= ' </table>' .
' </div>' .
'</div>';
echo $prod_list_contents;
} else {
?>
<p><?php echo TEXT_NO_PRODUCTS; ?></p>
<?php
}
if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<br />
<div>
<span style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></span>
<span><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></span>
</div>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="main"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></td>
</tr>
</table>
</form>
<?php
}
?>
</div>

Link to comment
Share on other sites

Has anyone sucessfully added this contibution and the qtpro addon. I have come unstuck at adding the code for the product_info.php page. Qtpro alters some code in this page, and its not their. Cabn anyone give any help.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

I have a heavily modified product_info.php, but a little over half way down... a bunch of stuff got moved to /includes/classes/pad_base.php for QT Pro.

 

/* ### LINE EDIT: Separate Pricing Per Customer v4.2.2  - Hide attributes from customer groups - ADD: and find_in_set()=0 ### */
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 ");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
//++++ QT Pro: Begin Changed code
/* EVERYTHING IN HERE WAS PUT INTO /includes/classes/pad_base.php, LINES 287-313 FOR QT Pro */
  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);
  require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
  $pad = new $class($products_id);
  echo $pad->draw();
   }
//Display a table with which attribute combinations is in stock to the customer?
if(PRODINFO_ATTRIBUTE_DISPLAY_STOCK_LIST == 'True'): require(DIR_WS_MODULES . "qtpro_stock_table.php"); endif;
//++++ QT Pro: End Changed Code

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...