Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

I am completely stumped. Jan has been kind enough to help me find my errors thus far - and I'm hoping either she or someone here knows the answer to this one.

 

I have customized our osC so that the category pages show a list of products. If there are subcategory pages it shows the "topsellers.php" file. If there are no subcategory pages (or you are on the subcategory page) it shows the productinfo2.php file. Both of these files I created in my includes/boxes/ folder.

 

Now - here is the problem. If you are viewing the list of products from productinfo2.php file, when you click the Buy Now button in IE, nothing is added to the cart. (It does work in Firefox - but not IE). When I look at the code generated for the button, I find after product ID it has &sort=products_sort_order&osCsid=***** I don't know why the sort=products_sort_order is getting into the URL for the buy now button.

 

Here is where it's interesting. I created topsellers.php by modifying queries in productinfo2.php. If you are viewing the list of products through topsellers.php and click Buy Now - it works just fine!! It does not have the sort=product_sort_order in the URL.

 

For the life of me I cannot figure out why in the world the one page works and the other page doesn't. The only differences are in queries and there is an if statement in productinfo2 that is not in topsellers.

 

Anybody know why the sort=product_sort_order would show up in the Buy Now button URL ??

 

In hopes it helps:

productinfo2.php (the one with the problem)

<?php
global $current_category_id, $languages_id;

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

// BOF Separate Price per Customer, hide products and categories from groups
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
} // end if(!tep_session_is_registered('sppc_customer_group_id'))

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) where p.products_status = 1 AND p2c.categories_id = '" . (int)$current_category_id . "' AND p.products_master = 0 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");
$product_check = tep_db_fetch_array($product_check_query);

if ($product_check['total'] < 1) {
//BOF Separate Pricing Per Customer, Hide products and categories for groups
$hide_product = true; // needed for column_right
// EOF Separate Pricing Per Customer, Hide products and categories for groups
?>
<table border="0" width = "100%" cellspacing="3" cellpadding="3">
<tr>
	<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
</tr>
<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
	<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
</tr>
</table>	
<?php
} else {

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.products_short_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id), " . TABLE_CATEGORIES . " c where p2c.categories_id = '" . (int)$current_category_id . "' AND c.categories_id = p2c.categories_id AND p.products_status = '1' and p.products_master_status = 1 and p.products_master = 0 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_sort_order ASC"); 
while ($product_info = tep_db_fetch_array($product_info_query) ) {

if (tep_not_null($product_info['products_model'])) {
	$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
	$products_name = $product_info['products_name'];
} // end if (tep_not_null($product_info['products_model']))
?>
<table border="0" width = "100%" cellspacing="3" cellpadding="3">
<tr><td colspan="2"><hr></td></tr>
<?php	
		if (tep_not_null($product_info['products_image'])) {
?>
<tr>
	<td width="18%" rowspan="2" align="left" class="smallText">
<?php			
			 echo ' ' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?>
		</td>
		<?php
	} else {
	?>
<table border="0" width = "100%" cellspacing="3" cellpadding="3">
<tr>
	<td width="18%" rowspan="2" align="left" class="smallText">		
		<p align="center">No Image Available</p></td>
	<?php
	} // end if (tep_not_null($product_info['products_image']))
	?>
	<td width="82%" class="pageHeading"><?php echo $products_name; ?> </td>
</tr>
<tr>
	<td><?php 
			if ($product_info['products_short_description'] != NULL) {
				echo substr(embedded_href_replace($product_info['products_short_description']), 0, 350);
			} else {
				echo substr(embedded_href_replace($product_info['products_description']), 0, 350);
			} ?></td>
</tr>
<tr>
	<td> </td>
	<td><p><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id']) .'">Click Here for more detailed information and suggested use</a>'; ?></p></td>
</tr>
<tr>
	<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>	
	<tr>
	<td colspan=2><table border="0" width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td><table width="100%" border="0" cellspacing="3" cellpadding="3">
						<tr>
							<td align="center" valign="top"><strong>Item #</strong></td>
							<td align="center" valign="top"><strong>Name</strong></td>
							<td align="center" valign="top"><strong>Description</strong></td>
							<td align="center" valign="top"><strong>Price</strong></td>
							<td> </td>
						</tr>
<?php
$master_query = tep_db_query("select p.products_id, p.products_master, p.products_model, pd.products_name, pd.products_description, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, p.products_sort_order, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where p.products_master = '" . $product_info['products_id'] . "' and p.products_status = '1' 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_sort_order ASC");
while ($slaves = tep_db_fetch_array($master_query)) {

if ($new_price = tep_get_products_special_price($slaves['products_id'])) {
	//BOF Separate Pricing per Customer
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $slaves['products_id'] . "' and customers_group_id = '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
		$slaves['products_price'] = $scustomer_group_price['customers_group_price'];
	}
	//EOF Separate Pricing per Customer
	$products_price = '<s>' . $currencies->display_price($slaves['products_price'], tep_get_tax_rate($slaves['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($slaves['products_tax_class_id'])) . '</span>';
} else {
	//BOF Separate Pricing per Customer
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $slaves['products_id'] . "' and customers_group_id = '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
		$slaves['products_price'] = $scustomer_group_price['customers_group_price'];
	}
	// EOF Separate Pricing per Customer
	$products_price = $currencies->display_price($slaves['products_price'], tep_get_tax_rate($slaves['products_tax_class_id']));
}

?>
					  <tr>
						<td align="center" valign="top"><?php echo $slaves['products_model']; ?></td>
						<td align="center" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $slaves['products_id']) .'">' . $slaves['products_name'] . '</a>'; ?></td>
						<td align="center" valign="top"><?php echo $slaves['products_description']; ?></td>
						<td align="center" valign="top"><?php echo $products_price; ?></td>
						<td valign="top"><?php echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $slaves['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>'; ?></td>
					  </tr>
	<?php
		} // end while $slaves = tep_db_fetch_array($master_query); 
	?>
					</table>
				</td>
			</tr>
		</table>		
	</td>
</tr>
<tr>
	<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
} // end while ($product_info = tep_db_fetch_array($product_info_query) ) 
} // end if ($product_check['total'] < 1) 
?>
</table>

 

topsellers.php (the one that works)

<?php
global $current_category_id, $languages_id;

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

// BOF Separate Price per Customer, hide products and categories from groups
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
$customer_group_id = $sppc_customer_group_id;
} // end if(!tep_session_is_registered('sppc_customer_group_id'))

$topSellers_query = tep_db_query("select distinct p.products_master, c.categories_id from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd USING(products_id), " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_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_ordered desc, pd.products_name limit "  . MAX_DISPLAY_BESTSELLERS);
while ($topSellers = tep_db_fetch_array($topSellers_query) ) {


$product_info_query = tep_db_query("select distinct p.products_id, pd.products_name, pd.products_description, pd.products_short_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id), " . TABLE_CATEGORIES . " c where p.products_id = '" . $topSellers['products_master'] . "' and p2c.categories_id = '" . $topSellers['categories_id'] . "' AND c.categories_id = p2c.categories_id AND p.products_status = '1' and p.products_master_status = 1 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_sort_order");
while ($product_info = tep_db_fetch_array($product_info_query) ) {


if (tep_not_null($product_info['products_model'])) {
	$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
	$products_name = $product_info['products_name'];
} // end if (tep_not_null($product_info['products_model']))
?>
<table border="0" width = "100%" cellspacing="3" cellpadding="3">
<tr><td colspan="2"><hr></td></tr>
<?php	
		if (tep_not_null($product_info['products_image'])) {
?>
<tr>
	<td width="18%" rowspan="2" align="left" class="smallText">
<?php			
			 echo ' ' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?>
		</td>
		<?php
	} else {
	?>
<table border="0" width = "100%" cellspacing="3" cellpadding="3">
<tr>
	<td width="18%" rowspan="2" align="left" class="smallText">		
		<p align="center">No Image Available</p></td>
	<?php
	} // end if (tep_not_null($product_info['products_image']))
	?>
	<td width="82%" class="pageHeading"><?php echo $products_name; ?> </td>
</tr>
<tr>
	<td><?php 
			if ($product_info['products_short_description'] != NULL) {
				echo substr(embedded_href_replace($product_info['products_short_description']), 0, 350);
			} else {
				echo substr(embedded_href_replace($product_info['products_description']), 0, 350);
			} ?></td>
</tr>
<tr>
	<td> </td>
	<td><p><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id']) .'">Click Here for more detailed information and suggested use</a>'; ?></p></td>
</tr>
<tr>
	<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>	
	<tr>
	<td colspan=2><table border="0" width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td><table width="100%" border="0" cellspacing="3" cellpadding="3">
						<tr>
							<td align="center" valign="top"><strong>Item #</strong></td>
							<td align="center" valign="top"><strong>Name</strong></td>
							<td align="center" valign="top"><strong>Description</strong></td>
							<td align="center" valign="top"><strong>Price</strong></td>
							<td> </td>
						</tr>
<?php
$master_query = tep_db_query("select p.products_id, p.products_master, p.products_model, pd.products_name, pd.products_description, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, p.products_sort_order, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where p.products_master = '" . $product_info['products_id'] . "' and p.products_status = '1' 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_sort_order ASC");
while ($slaves = tep_db_fetch_array($master_query)) {

if ($new_price = tep_get_products_special_price($slaves['products_id'])) {
	//BOF Separate Pricing per Customer
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $slaves['products_id'] . "' and customers_group_id = '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
		$slaves['products_price'] = $scustomer_group_price['customers_group_price'];
	}
	//EOF Separate Pricing per Customer
	$products_price = '<s>' . $currencies->display_price($slaves['products_price'], tep_get_tax_rate($slaves['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($slaves['products_tax_class_id'])) . '</span>';
} else {
	//BOF Separate Pricing per Customer
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $slaves['products_id'] . "' and customers_group_id = '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
		$slaves['products_price'] = $scustomer_group_price['customers_group_price'];
	}
	// EOF Separate Pricing per Customer
	$products_price = $currencies->display_price($slaves['products_price'], tep_get_tax_rate($slaves['products_tax_class_id']));
}

?>
					  <tr>
						<td align="center" valign="top"><?php echo $slaves['products_model']; ?></td>
						<td align="center" valign="top"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $slaves['products_id']) .'">' . $slaves['products_name'] . '</a>'; ?></td>
						<td align="center" valign="top"><?php echo $slaves['products_description']; ?></td>
						<td align="center" valign="top"><?php echo $products_price; ?></td>
						<td valign="top"><?php echo '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $slaves['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>'; ?></td>
					  </tr>
	<?php
		} // end while $slaves = tep_db_fetch_array($master_query); 
	?>
					</table>
				</td>
			</tr>
		</table>		
	</td>
</tr>
<tr>
	<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
} // end while ($product_info = tep_db_fetch_array($product_info_query) ) 
} // end while ($topSellers = tep_db_fetch_array($topSellers_query) )
?>
</table>

 

Any ideas would be most appreciated as the site is currently live with this issue, and I've been having no luck finding anything in the forums that might explain this, nor have I had any luck trying to figure it out on my own (including file comparison programs to see if there is some difference from one to the other that would appear to cause the issue).

 

TIA !

Back to searching for some reason that would cause this :blush:


~Tracy
 

Share this post


Link to post
Share on other sites
I am completely stumped. Jan has been kind enough to help me find my errors thus far - and I'm hoping either she or someone here knows the answer to this one.

 

Well - after deleting a bunch from the productinfo2.php I am down to it having to be somewhere in this bit:

	$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.products_short_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id), " . TABLE_CATEGORIES . " c where p2c.categories_id = '" . (int)$current_category_id . "' AND c.categories_id = p2c.categories_id AND p.products_status = '1' and p.products_master_status = '1' and p.products_master = '0' 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_sort_order ASC"); 
while ($product_info = tep_db_fetch_array($product_info_query) ) {

 

This bit on topsellers.php is:

	$product_info_query = tep_db_query("select distinct p.products_id, pd.products_name, pd.products_description, pd.products_short_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id), " . TABLE_CATEGORIES . " c where p.products_id = '" . $topSellers['products_master'] . "' and p2c.categories_id = '" . $topSellers['categories_id'] . "' AND c.categories_id = p2c.categories_id AND p.products_status = '1' and p.products_master_status = 1 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_sort_order ASC");
while ($product_info = tep_db_fetch_array($product_info_query) ) {

 

I'm down to that being the only area of difference now (I removed the count query from productinfo2.php and removed the if statement for it as there aren't any categories with no products in them. I did leave the $topSellers query in topsellers.php above the $product_info_query as it is needed)

 

Any thoughts on why I'm getting the sort order in the button URL on the productinfo2.php page are greatly appreciated!


~Tracy
 

Share this post


Link to post
Share on other sites
Any thoughts on why I'm getting the sort order in the button URL on the productinfo2.php page are greatly appreciated!

 

PS - forgot to offer links to see this in action:

 

http://www.mountainmeadowherbs.com/womens-health-c-1.html - This uses the topsellers.php script to load the top selling products. The buy now button works here (even in IE).

 

http://www.mountainmeadowherbs.com/womens-...ncy-c-1_17.html - This uses the productinfo2.php script to load all of the products in the category onto the page. The buy now button does not work in IE here (does work in Firefox).


~Tracy
 

Share this post


Link to post
Share on other sites

Anyone have any clue how to have list of wholesale price displayed at column right under admin/categories.php? I've narrowed down to following codes but unable to get it work, any help will be greatly appreciated.

p.s. I am trying to have Tier 1 - 4 wholesale price displayed when having products highlighted

 

            $contents[] = array('text' => '<br>' . 
           							TEXT_PRODUCTS_MODEL . ' ' . $pInfo->products_model . '<br>' . 
           							TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . 
           							'Tier 1 :' . ' ' . $currencies->format($pInfo->sppcprice[$customers_group['customers_group_id']] . "' where customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'" ) . '<br>' . 
            							'Tier 2 :' . ' ' . $currencies->format($pInfo->customers_group_price) . '<br>' . 
            							'Tier 3 :' . ' ' . $currencies->format($pInfo->customers_group_price) . '<br>' . 
            							'Tier 4 :' . ' ' . $currencies->format($pInfo->customers_group_price['customers_group_id = 4']) . '<br>' . 
            							TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);

Share this post


Link to post
Share on other sites

Well, I am totally stuck now. I can use the topsellers.php (the working code) on the subcategory pages and I get the same problem! So apparently it has something to do with how the "buy now" button functions on top level vs. subcategory pages :blink:

 

Anyone have any ideas on what would cause buy_now to work differently from top category to subcategory pages?

 

PS - forgot to offer links to see this in action:

 

http://www.mountainmeadowherbs.com/womens-health-c-1.html - This uses the topsellers.php script to load the top selling products. The buy now button works here (even in IE).

 

http://www.mountainmeadowherbs.com/womens-...ncy-c-1_17.html - This uses the productinfo2.php script to load all of the products in the category onto the page. The buy now button does not work in IE here (does work in Firefox).


~Tracy
 

Share this post


Link to post
Share on other sites

I found the offending bit of code and currently have it commented out. I can't find anywhere that it breaks my site - but thought I'd post it so others know what bit of code is causing the problem - and maybe somebody will be able to come up with a work-a-round :)

 

The offending code in catalog/index.php

/* testing without this chunk of code
if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = 'products_sort_order';
	  $listing_sql .= " order by p.products_sort_order asc, pd.products_name";
	  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 p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_NAME':
	  $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
	  break;
	  case 'PRODUCT_LIST_DESCRIPTION':
		$listing_sql .= "order by pd.products_description " . ($sort_order == 'd' ? 'desc' : '');
		break; 					  
	case 'PRODUCT_LIST_MANUFACTURER':
	  $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $listing_sql .= " order by pd.products_name";
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_PRICE':
	  $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_SORT_ORDER':
	  $listing_sql .= " order by p.products_sort_order " . ($sort_order == 'd' ? "desc" : '') . ", pd.products_name";
	  break;
  }
}
*/

 

Well, I am totally stuck now. I can use the topsellers.php (the working code) on the subcategory pages and I get the same problem! So apparently it has something to do with how the "buy now" button functions on top level vs. subcategory pages :blink:

 

Anyone have any ideas on what would cause buy_now to work differently from top category to subcategory pages?


~Tracy
 

Share this post


Link to post
Share on other sites
Anyone have any clue how to have list of wholesale price displayed at column right under admin/categories.php? I've narrowed down to following codes but unable to get it work

It looks like nothing.... but this works (close to the bottom of the file around 1086, default):

			$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
		// BOF showing groups prices in right column
		$cust_group_price_query = tep_db_query("select products_id, customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pInfo->products_id . "' order by customers_group_id");
		$tiers = '';
		if (tep_db_num_rows($cust_group_price_query) > 0) {
		  while ($cust_group_price = tep_db_fetch_array($cust_group_price_query)) {
			$tiers .= '<br>Tier ' . $cust_group_price['customers_group_id'] . ' : ' . $currencies->format($cust_group_price['customers_group_price']);
		  }
		}
		$contents[] = array('text' => $tiers); // EOF showing groups prices in right column
		$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites
Well, I am totally stuck now. I can use the topsellers.php (the working code) on the subcategory pages and I get the same problem! So apparently it has something to do with how the "buy now" button functions on top level vs. subcategory pages

 

Anyone have any ideas on what would cause buy_now to work differently from top category to subcategory pages?

I don't see it. It probably has to do with the path you take to drill down to that page. The sort and products_sort_order end up in the url as get parameters in some page and because they are not added to the get variables that have to be removed from the link they stay in there.

When you have a link, like in the buy_now button, explicitly add those two to the tep_get_all_get_params() to have them removed tep_get_all_get_params('sort', 'products_sort_order') (often 'action' is in there).

Share this post


Link to post
Share on other sites
It looks like nothing.... but this works (close to the bottom of the file around 1086, default):

			$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
		// BOF showing groups prices in right column
		$cust_group_price_query = tep_db_query("select products_id, customers_group_price, customers_group_id from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $pInfo->products_id . "' order by customers_group_id");
		$tiers = '';
		if (tep_db_num_rows($cust_group_price_query) > 0) {
		  while ($cust_group_price = tep_db_fetch_array($cust_group_price_query)) {
			$tiers .= '<br>Tier ' . $cust_group_price['customers_group_id'] . ' : ' . $currencies->format($cust_group_price['customers_group_price']);
		  }
		}
		$contents[] = array('text' => $tiers); // EOF showing groups prices in right column
		$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');

 

 

Wow thanks a million Jan!!! You are my hero!!! :D

Share this post


Link to post
Share on other sites

Hello,

 

can someone tell me how to include the Special Price into new_product.php?

I used the "new installation" files from SPPC and there its only showing the final price.

<?php
/*
 $Id: new_products.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $
 adapted for Separate Pricing Per Customer v4.2 2008/07/13

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- new_products //-->
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 new contentBoxHeading($info_box_contents);

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
// BOF Separate Pricing Per Customer
$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, 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 {
$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, 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)

 $row = 0;
 $col = 0;

 $info_box_contents = array();

//  while ($new_products = tep_db_fetch_array($new_products_query)) {
for ($x = 0; $x < $no_of_new_products; $x++) {
// getting products_name added to the $new_products_query above so we can skip this
//	$new_products[$x]['products_name'] = tep_get_products_name($new_products[$x]['products_id']);

$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products[$x]['products_image'], $new_products[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products[$x]['products_id']) . '">' . $new_products[$x]['products_name'] . '</a><br>' . $currencies->display_price($new_products[$x]['products_price'], tep_get_tax_rate($new_products[$x]['products_tax_class_id'])));

$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
  } // end for ($x = 0; $x < $no_of_new_products; $x++)
} //  end if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0)
// EOF Separate Pricing Per Customer
new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

 

thanks

Share this post


Link to post
Share on other sites

Hi,

 

would someone be so nice to adapt this piece of code in allprods.php from "All Products v3.0 MS 2.2 with Images version 4.7 contrib latest fix" on a 2.2 RC1 shop to work with Hide products and categories for SPPC:

 

$listing_sql = "select p.products_id, products_weight, p.products_quantity, p.products_model, pd.products_name, pd.products_description, p.products_image, 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, p.products_date_added, m.manufacturers_name, m.manufacturers_id from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id $where";

 

I tried the possible fix given here: http://forums.oscommerce.com/lofiversion/i...hp?t251526.html, the first part works fine, prices are selected per customers group but if I add the new $listing_sql then all stops working. (tep stop)

 

// BOF Separate Pricing Per Customer/Hide products and categories
 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';
 }

// listing all products
$listing_sql = "select distinct p.products_id, p.products_model, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c on c.categories_id = p2c.categories_id and pd.language_id = '" . $languages_id . "' $where 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 pd.products_name";
// EOF Separate Pricing Per Customer/Hide products and categories

 

Thanks a lot in advance for the solution

 

David


david

Share this post


Link to post
Share on other sites

Tax / VAT on shipping costs are double on checkout_confirmation

 

Hi there,

 

since I have installed the SPPC update from 4.1 to 4.2 I have a strange error.

Only on shipping costs tax is added double on checkout_confirmation.

 

I think that must have something to do with order_total.php. I changed back to the old file (only this one), and as a result I get all lines double, where the second lines of shipping, tax and total are wrong.

 

See here:

checkout_confirmation.jpg

 

The first line of shipping (DPD Standard: 3,81 EUR) is ok, tax included only one time.

The scond line of shipping (DPD Standard: 4,53 EUR) is wrong, tax included two times (3,20 EUR +19% = 3,81 EUR + 19%= 4,53 EUR).

 

Can anybody help me? I try to find a solution for this since many weeks, I am really stucked here, this is the last thing I have to solve before the shop goes online. Where or what have I search for??

 

It doesn't matter which group I test. Retail and wholesale have both the same problem. I have only one tax class / zone / country (Germany) installed.

 

Thanks for your help.

 

Heike

Edited by lutzieluv

Share this post


Link to post
Share on other sites
Tax / VAT on shipping costs are double on checkout_confirmation

 

Is there nobody who can help me? :o Just an idea... ?? One hint... ??? :blink:

 

Thx.

 

Heike

Share this post


Link to post
Share on other sites

Hello! I just installed this contribution and am getting these errors when I try to log in to my admin panel. Please Help! I am not sure why this is happening...

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/filenames.php:112) in /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/filenames.php:112) in /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/functions/general.php on line 22

 

Any advise would be very helpful.

 

Thanks,

 

Mimi

Share this post


Link to post
Share on other sites
Hello! I just installed this contribution and am getting these errors when I try to log in to my admin panel. Please Help! I am not sure why this is happening...

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/filenames.php:112) in /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/filenames.php:112) in /home/content/i/v/y/ivyluxweb/html/catalog/admin/includes/functions/general.php on line 22

 

Any advise would be very helpful.

 

Thanks,

 

Mimi

 

Well, well, I answered my own question... there was additional lines below the ?> at the bottom of the file. Deleting these spaces fixed my problem.

Share this post


Link to post
Share on other sites

Hello,

 

Is anyone using a Newsletter HTML contribution with SPPC? If so which one is compatible with OSC?

 

Thanks JR

Share this post


Link to post
Share on other sites

I just did an install on a fresh RC2a store and it does not seem to be working... I guess not totally fresh, a few contributions, but only about 6 files were common, nothing big.

 

Everything looks good on the admin side - I can create groups, add group prices to products, etc.

 

When I login on the retail side it does not show the pricing. Any idea as to why this might be? I followed the instructions carefully and have uploaded all of the files.

 

http://www.onlinepaintballstore.net

user: blah@blah.com

pass: blahblah

Group: VIP, should have all prices showing as $25.00

Share this post


Link to post
Share on other sites

Nevermind, I figured it out.

 

I had PWA 2.0f installed previously and just had to rearrange the SQL query for login.php and logoff.php files.

 

Works wonders now! :D

Share this post


Link to post
Share on other sites

Hi,

 

Great Contri. Thanks.

 

I've tried to combine SPPC & QTpro, but unfortunately it doesn't work.

If I add a product to my cart, the cart keeps showing up empty.

 

Can anybody help me?

 

This is my code (layout is already modified):

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $
 adapted for Separate Pricing Per Customer v4.2 2007/06/23

 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_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
// BOF Separate Pricing per Customer
 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
  $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
?>
<!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 $product_info['products_name']; ?></title>
<meta name="description" content="<?php echo $product_info['products_name']; ?>">
<meta name="keywords" content="<?php echo $product_info['products_name']; ?>">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script type="text/javascript" src="highslide/highslide.js"></script>
<script type="text/javascript" src="highslide/highslide-html.js"></script>
<script type="text/javascript"> 
hs.graphicsDir = 'highslide/graphics/';
hs.outlineType = 'rounded-white';
window.onload = function() {
hs.preloadImages(5);
}
</script>
</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="1000" cellspacing="0" cellpadding="0" align="center">
 <tr>
<td class="column_left" 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"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="750" cellspacing="0" cellpadding="0" align="right">
<?php
 if ($product_check['total'] < 1) {
?>
  <tr>
	<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxRight">
	  <tr class="infoBoxContentsRight">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			</tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 } else {


tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
// BOF Separate Pricing per Customer
  if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	  $product_info['products_price']= $scustomer_group_price['customers_group_price'];
	  }
  } // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer

  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
// BOF Separate Pricing per Customer
  if ($customer_group_id > 0) { // only need to check products_groups if customer is not retail
	$scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
	if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
	$product_info['products_price']= $scustomer_group_price['customers_group_price'];
	}
} // end if ($customer_group_id > 0)
// EOF Separate Pricing per Customer

  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

if (tep_not_null($product_info['products_model'])) {
  $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
  $products_name = $product_info['products_name'];
}
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td rowspan="24" width="27%" valign="top" class="pageHeading"><span class="smallText"><?php echo '<a id="thumb'.$listing['products_id'].'" class="highslide" onclick="return hs.expand(this);" 
href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . ' ">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'],
$product_info['products_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br><center>' . TEXT_CLICK_TO_ENLARGE . '</center></a>'; ?></span></td>
		<td rowspan="24" width="7%" valign="top" class="pageHeading"> </td>
		<td width="66%" class="pageHeading"><?php echo $products_name; ?></td>
	  </tr>
	  <tr>
		<td class="pageHeading"><?php echo $products_price; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php
if (tep_not_null($product_info['products_image'])) {
//++++ QT Pro: Begin Changed code
?>
			<table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td class="smallText"><?php
//++++ QT Pro: End Changed Code
?>
					<?php
}
?>
					<p><?php echo stripslashes($product_info['products_description']); ?></p>
				  <?php
//++++ QT Pro: Begin Changed code
if (tep_not_null($product_info['products_image'])) {
?>					</td>
			  </tr>
			</table>
		  <?php
}
//++++ QT Pro: End Changed Code
$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
  $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 attributecombinations is on 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
?>
		</td>
		</tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		</tr>
<?php

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
?> 			
	  <tr>
		<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
		</tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		</tr>
<?php
}

if (tep_not_null($product_info['products_url'])) {
?>			
	  <tr>
		 <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
		</tr>
	  <tr>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		</tr>
<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>			
	  <tr>
		<td class="smallText"><span class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></span></td>
		</tr>

<?php
}
?>			

	  <tr>
		<td class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL') . '">' . tep_image_button('button_tell_a_friend.gif', IMAGE_BUTTON_TELL_A_FRIEND)  . '</a>'; ?></td>
	  </tr>
	</table></td>
  </tr>

<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
?>
<?php
}

if (tep_not_null($product_info['products_url'])) {
?>
<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
<?php
} else {
?>
<?php
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td>
<?php
if ((USE_CACHE == 'true') && empty($SID)) {
  echo tep_cache_also_purchased(3600);
} else {
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>		</td>
  </tr>
</table>
</form></td>
<!-- body_text_eof //-->
 </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'); ?>

 

I am really desperate, please help.

 

Chantal

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites
I've tried to combine SPPC & QTpro, but unfortunately it doesn't work.

If I add a product to my cart, the cart keeps showing up empty.

I don't see why product_info.php should be the source of the problem (I can't see an obvious problem and if it was working without SPPC I don't see why it suddenly wouldn't work now). It could also be application_top.php or includes/classes/shopping_cart.php.

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

×