Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

I am going to be building a store, but wanted to find out if SPPC can do what I need before I get started - hoping to add the contrib to clean install :)

 

I am planning to have the regular site and the store separate (the store kept in the catalog directory). What I want is when someone clicks the 'online store' link on the regular (top) site, they will first go to a login page. I just want this page to have login information (no merchandise or other boxes) as follows:

 

1. Customer Login box for current customers - this would log them into the osc site with their special pricing through SPPC, hopefully redirecting them to the catalog/index page already logged in.

2. Link for businesses that want to become customers - I would like this to be a form they fill out requesting a business acct, which we then have to approve. ( 'I would like to apply for a business account' or something like that)

3. Link for general customers (retail)... 'I want to shop with my credit card' or something along those lines. This would link to the standard catalog/index page

 

This is for an established business - most of our customers are other businesses who have accounts with us and get special pricing. We're not expecting a lot of outside customers, but that doesn't mean we won't be accepting any:)

 

I have not yet tested SPPC - just read through the documentation. Love the screenshots :D Can SPPC work with a login page like I listed above? Anyone know how this could be done? Not even sure this is an SPPC question, or more of a general osc question, as I don't know if the login page idea is possible with or without SPPC, but any help is greatly appreciated!

 

Thanks

 

Donna

Link to comment
Share on other sites

A little OT, sorry.. Trying to install Page Editor v1.5 and having some difficulty, I know many of you use this also.. if you do I would appreciate you checking out this post and giving me a hand..

 

Page Editor v1.5 not working

 

Thanks so much

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

Donna,

I am planning to have the regular site and the store separate (the store kept in the catalog directory). What I want is when someone clicks the 'online store' link on the regular (top) site, they will first go to a login page. I just want this page to have login information (no merchandise or other boxes) as follows:

 

1. Customer Login box for current customers - this would log them into the osc site with their special pricing through SPPC, hopefully redirecting them to the catalog/index page already logged in.

This works exactly the same as with a regular osC site.

You can change the appearance of the login.php page to your fancy... to a certain extent (remove the columns left and right is easy for example, just comment out e.g.:

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

and perhaps change the HTML of the page too. You can't put it outside the /catalog/ directory I think, because osC needs the session/cookies to remember the customer and what he/she has in the shopping cart (people jumping from your shop to the regular site and back will lose all the contents in their shopping cart).

2. Link for businesses that want to become customers - I would like this to be a form they fill out requesting a business acct, which we then have to approve. ( 'I would like to apply for a business account' or something like that)
In SPPC attention is drawn to new business accounts when they enter their tax id number in the create account page. You could add a checkbox with that phrase after it and get yourself attended to that when the checkbox is ticked (needs some additional code).
3. Link for general customers (retail)... 'I want to shop with my credit card' or something along those lines. This would link to the standard catalog/index page
Shouldn't be a problem. Perhaps you want something like the Purchase Without Account (PWA) contribution too? I think people have done that in combination with SPPC.
Link to comment
Share on other sites

Exactly what I needed - Thank you! :D

 

 

 

Donna,

This works exactly the same as with a regular osC site.

You can change the appearance of the login.php page to your fancy... to a certain extent (remove the columns left and right is easy for example, just comment out e.g.:

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

and perhaps change the HTML of the page too. You can't put it outside the /catalog/ directory I think, because osC needs the session/cookies to remember the customer and what he/she has in the shopping cart (people jumping from your shop to the regular site and back will lose all the contents in their shopping cart).

In SPPC attention is drawn to new business accounts when they enter their tax id number in the create account page. You could add a checkbox with that phrase after it and get yourself attended to that when the checkbox is ticked (needs some additional code).

Shouldn't be a problem. Perhaps you want something like the Purchase Without Account (PWA) contribution too? I think people have done that in combination with SPPC.

Link to comment
Share on other sites

Forget this.. I removed this MOD and installed Define Content and tinyMCE editor and I had a very productive day with that setup

 

A little OT, sorry.. Trying to install Page Editor v1.5 and having some difficulty, I know many of you use this also.. if you do I would appreciate you checking out this post and giving me a hand..

 

Page Editor v1.5 not working

 

Thanks so much

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

Hi,

 

I am having this error

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/admin/includes/functions/database.php on line 99

 

 

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC);

}

 

I don't get it. Only catalog/includes/functions/database.php has to be modified in the install guide.

Any clue?

Link to comment
Share on other sites

Janz,

 

hi,

 

i use the sppc version 4.12... and installed yesterday the contrib "Hide products from customer groups for SPPC" extra.

and everything is super.. i can hide for customer groups my artikel..

 

but now my question:

how can i hide categories for the groups.. do i need there a new contrib oder how can i realisise it?

 

thanks a lot for your help

 

greetz

tali

 

Thanks for your help :D Now it worked for me too.

 

Your the best

:D

 

Best Regards

Thomas B.

Link to comment
Share on other sites

John,

I am having this error

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

Sounds like a mistake in adding code to a page/box/module where the error originally comes from. The code in the page/box/module asks for the results of a query where there hasn't been any.
Link to comment
Share on other sites

hey guys, i have installed the "Featured Products" contrib... and it works but it shows the wrong price category in the "Featured Product" box... if you use the product category menu however the price fits the customer group...

 

i think i just need to add something to my "featured_products.php"... but i am not sure what...

 

please let me know if i need to post the contents of any other file...

 

anywayz... here is my "featured_products.php" file:

 

<?php
/*
 $Id: featured_products.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

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

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FEATURED_PRODUCTS));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- coolMenu //-->
<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>
<!-- coolMenu_eof //-->

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
///// To random featured products
//  list($usec, $sec) = explode(' ', microtime());
//  srand( (float) $sec + ((float) $usec * 100000) );
//  $mtm= rand();
//////
  $featured_products_array = array();
			$featured_products_query_raw = "select p.products_id, pd.products_name, 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, 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 and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added DESC, pd.products_name";
// to random//  $featured_products_query_raw = "select p.products_id, pd.products_name, 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, 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 and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm)";
  $featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_FEATURED_PRODUCTS);

 if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?> </td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td> <!-- Featured Products Main Page Box -->
			 <table bgcolor="ffffff" border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if ($featured_products_split->number_of_rows > 0) {
$featured_products_query = tep_db_query($featured_products_split->sql_query);
while ($featured_products = tep_db_fetch_array($featured_products_query)) {
  if ($new_price = tep_get_products_special_price($featured_products['products_id'])) {
	$products_price = '<s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>';
  } else {
	$products_price = $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['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=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['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=' . $featured_products['products_id']) . '"><b><u>' . $featured_products['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
		<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['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 {
?>
	  <tr>
		<td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
 }
?>
	</table>
			</td>
  </tr>
<?php
 if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td>
			  <table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?></td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table>
	   </td>
  </tr>
<?php
 }
?>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

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

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

"sorting" does not seem to work in the "orders" section of my admin-->customers section...

 

i want to be able to sort by name and/or customer group... i can click the little arrows... but no matter which i try to sort by nothing happens...

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

i have installed the "Featured Products" contrib... and it works but it shows the wrong price category in the "Featured Product" box... if you use the product category menu however the price fits the customer group...

 

i think i just need to add something to my "featured_products.php"... but i am not sure what...

It is a little bit more than just something. Check this post on page 105. There is also a version of the featured products box in this thread (a couple of pages back from this one).

 

Regarding the sorting in admin/orders... there are no arrows for sorting in that page....

Link to comment
Share on other sites

well i cut & pasted the file on page 105 and replaced my "featured_products.php" with its contents... but it still didn't work... and now when i click the featured products link from the main page i get parse error on line 210 of the file ...

 

(210 is the blank line at the end of the file)...

 

and are the arrows in this picture not for sorting???:

 

 

customermenu.png

 

help

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

im sorry it was the customer section of admin-->customers that had the arrows... not the order section... :)

 

but anywayz, they dont work and i would like them to...

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

I'm having some trouble with the Add to Cart button in the product listing pages. It was working fine until I installed Seperate Price Per Customer and Sort Order contributions. I also installed the Contribution Installer Package Contribution but did not install any of its packages. That one required me to change a bunch of permissions on a variety of files. I try to always use the newest releases after inspection on the readme files.

 

If someone has the following files so I can compare them with mine, maybe I won't need to yank the store and upload my old backup.

 

I know (should read, think) the following files have some sort of connection to this button:

 

catalog/includes/modules/product_listing.php

catalog/includes/application_top.php

catalog/index.php

 

Maybe there is suppose to be a define somewhere I deleted with a slip or maybe a file or folder permission is preventing the transfer or products to the cart?

 

Any help on this?

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I installed this as well as the Price Break for SPPC. My question is that if a user is in the "Retail" group, a product marked with a Special price shows that price properly for that group. If the Special price is lower than if a user order #+ items then the Special price is used. If I create a new Customer Group, the Special price does not show up anywhere for that user. If I put $20.00 in the Customer Group field, and the Special price is $18.00, I want the $18.00 price to be used. I am not sure if it is suppose to work this way and I installed something wrong or if the Customer Group price field overrides the Special and there is no way around it.

 

I cannot find a SPPC with Quantity Price Break forum, so not sure if this is the correct forum to ask in. Plus I am not sure if this is a SPPC or a QPB Priceformatter.php issue(if it is an issue).

 

Any suggestions?

Link to comment
Share on other sites

well i cut & pasted the file on page 105 and replaced my "featured_products.php" with its contents... but it still didn't work... and now when i click the featured products link from the main page i get parse error on line 210 of the file ...

 

(210 is the blank line at the end of the file)...

Found another one on my hard disk this evening. I tested this one and at least it doesn't give errors.

<?php
/*
 $Id: featured_products.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $
 adapted for Separate Pricing Per Customer v4 2005/03/10

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

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

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
///// To random featured products
//  list($usec, $sec) = explode(' ', microtime());
//  srand( (float) $sec + ((float) $usec * 100000) );
//  $mtm= rand();
//////
// BOF Separate Pricing Per Customer
//  global variable (session): $sppc_customers_group_id -> local variable $customer_group_id

 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }

  $featured_products_array = array();
			$featured_products_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, NULL as specstat, 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 and pd.language_id = '" . $languages_id . "' left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added DESC, pd.products_name";
 // EOF Separate Pricing Per Customer
// to random//  $featured_products_query_raw = "select p.products_id, pd.products_name, 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, 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 and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm)";
  $featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_FEATURED_PRODUCTS);

 if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?> </td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td> <!-- Featured Products Main Page Box -->
	 <table bgcolor="ffffff" border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if ($featured_products_split->number_of_rows > 0) {
// BOF Separate Pricing Per Customer

 $featured_products_query = tep_db_query($featured_products_split->sql_query);
if (($no_of_featured_prdcts = tep_db_num_rows($featured_products_query)) > 0) {
while ($_featured_products = tep_db_fetch_array($featured_products_query)) {
$featured_products[] = $_featured_products;
$list_of_prdct_ids[] = $_featured_products['products_id'];
} 

$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";
 if ($no_of_featured_prdcts > 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_featured_prdcts; $x++) {
// replace products prices with those from customers_group table
	if(!empty($new_prices)) {
	for ($i = 0; $i < count($new_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
		$featured_products[$x]['products_price'] = $new_prices[$i]['products_price'];
		}
	}
} // end if(!empty($new_prices)
  } // end for ($x = 0; $x < $no_of_featured_prdcts; $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, status as specstat from 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'], 'specstat' => $specials_array['specstat']);
}

// add correct specials_new_products_price
if(!empty($new_s_prices)) {
for ($x = 0; $x < $no_of_featured_prdcts; $x++) { 
	for ($i = 0; $i < count($new_s_prices); $i++) {
		if( $featured_products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
		$featured_products[$x]['specials_new_products_price'] = $new_s_prices[$i]['specials_new_products_price'];
		$featured_products[$x]['specstat'] = $new_s_prices[$i]['specstat'];
		}
	   }
   } 
} // // end if(!empty($new_s_prices)
 } // end if ($no_of_featured_prdcts = tep_db_num_rows($featured_products_query)) > 0)


//	while ($featured_products = tep_db_fetch_array($featured_products_query)) {
for ($x = 0; $x < $no_of_featured_prdcts; $x++) {
  if ($featured_products[$x]['specstat']) {
	$products_price = '<s>' . $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($featured_products[$x]['specials_new_products_price'], tep_get_tax_rate($featured_products[$x]['products_tax_class_id'])) . '</span>';
  } else {
	$products_price = $currencies->display_price($featured_products[$x]['products_price'], tep_get_tax_rate($featured_products[$x]['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=' . $featured_products[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products[$x]['products_image'], $featured_products[$x]['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=' . $featured_products[$x]['products_id']) . '"><b><u>' . $featured_products[$x]['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($featured_products[$x]['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $featured_products[$x]['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . $products_price; ?></td>
		<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products[$x]['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>
	  </tr>
	  <tr>
		<td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
} // EOF Separate Pricing Per Customer
 } else {
?>
	  <tr>
		<td class="main"><?php echo TEXT_NO_NEW_PRODUCTS; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
 }
?>
	</table>
	</td>
  </tr>
<?php
 if (($featured_products_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
  <tr>
	<td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="smallText"><?php echo $featured_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_FEATURED_PRODUCTS); ?></td>
		<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $featured_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
	  </tr>
	</table>
   </td>
  </tr>
<?php
 }
?>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

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

and are the arrows in this picture not for sorting???
Yes, and they work fine with me (and most other people I guess since I don't recall any complaints about it). Did you try the one from the package?
Link to comment
Share on other sites

I'm having some trouble with the Add to Cart button in the product listing pages.
The code that handles the pushing of the button is found in includes/application_top.php but isn't changed by SPPC (somewhere around line 370):

	  // performed by the 'buy now' button in product listings and review page
  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
							if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
							  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
							} else {
							  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

The product listing is handled by includes/modules/product_listing.php which is changed quite a bit for SPPC. For SPPC the fetch array is done first to store the results in an array and get the product_id's. With the product_id's at hand, the group prices and special prices are queried and then the array with the stored results is looped a couple of times to change the prices. Because normally the loop through the products is done with while ($listing = tep_db_fetch_array($listing_query)) and now you have to loop through the array with for ($x = 0; $x < $no_of_listings; $x++) every instance of $listing['db_field'] needs to be changed to $listing[$x]['db_field']. If you forget this somewhere, for example with the products_id on the buy now button you can get a problem like you describe (products_id is empty then but you can see that in the HTML source of the page).

Link to comment
Share on other sites

If I create a new Customer Group, the Special price does not show up anywhere for that user. If I put $20.00 in the Customer Group field, and the Special price is $18.00, I want the $18.00 price to be used. I am not sure if it is suppose to work this way and I installed something wrong or if the Customer Group price field overrides the Special and there is no way around it.
That is the way it is supposed to work in SPPC and the QPB for SPPC contribution. Specials need to be set for each group.
I cannot find a SPPC with Quantity Price Break forum, so not sure if this is the correct forum to ask in.
Correct, there is no separate thread for it so yes this is the correct forum for the QPB for SPPC contribution.
Link to comment
Share on other sites

The code that handles the pushing of the button is found in includes/application_top.php but isn't changed by SPPC (somewhere around line 370):

	  // performed by the 'buy now' button in product listings and review page
  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
							if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
							  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
							} else {
							  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

The product listing is handled by includes/modules/product_listing.php which is changed quite a bit for SPPC. For SPPC the fetch array is done first to store the results in an array and get the product_id's. With the product_id's at hand, the group prices and special prices are queried and then the array with the stored results is looped a couple of times to change the prices. Because normally the loop through the products is done with while ($listing = tep_db_fetch_array($listing_query)) and now you have to loop through the array with for ($x = 0; $x < $no_of_listings; $x++) every instance of $listing['db_field'] needs to be changed to $listing[$x]['db_field']. If you forget this somewhere, for example with the products_id on the buy now button you can get a problem like you describe (products_id is empty then but you can see that in the HTML source of the page).

 

Well I thank you very much for the reply.

However, my application_top.php case "buy_now" is in fine shape. I'll post my product_listing.php to see if someone can run a compare on it to see if I missed something. I also tried to install the Multi Check boxes contribution hoping that the original code supplied by the contributor would wash away my problem. No Luck there. I may have duplicated the error on that sheet.

 

I did become dejected and burned down my store, then resurected the "Older" full backup that doesn't have the SPPC, sort order, and CIP contributions on it. It works fine. Excepting for a shipping per item module tripling itself (what's up with that???). But other than that I think I can rebuild it with the awesome SPPC contribution which I need very much.

 

I would of course rather fix this perfectly good store and move on.

 

Here is my code:

 

<?php

/*

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

adapted for Separate Pricing Per Customer v4 2005/02/26

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

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

?>

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

<tr>

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

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

</tr>

</table>

<?php

}

 

$list_box_contents = array();

 

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

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_text = TABLE_HEADING_MODEL;

$lc_align = '';

break;

case 'PRODUCT_LIST_NAME':

$lc_text = TABLE_HEADING_PRODUCTS;

$lc_align = '';

break;

case 'PRODUCT_LIST_MANUFACTURER':

$lc_text = TABLE_HEADING_MANUFACTURER;

$lc_align = '';

break;

case 'PRODUCT_LIST_PRICE':

$lc_text = TABLE_HEADING_PRICE;

$lc_align = 'right';

break;

case 'PRODUCT_LIST_QUANTITY':

$lc_text = TABLE_HEADING_QUANTITY;

$lc_align = 'right';

break;

case 'PRODUCT_LIST_WEIGHT':

$lc_text = TABLE_HEADING_WEIGHT;

$lc_align = 'right';

break;

case 'PRODUCT_LIST_IMAGE':

$lc_text = TABLE_HEADING_IMAGE;

$lc_align = 'center';

break;

case 'PRODUCT_LIST_BUY_NOW':

$lc_text = TABLE_HEADING_BUY_NOW;

$lc_align = 'center';

break;

case 'PRODUCT_SORT_ORDER':

$lc_text = TABLE_HEADING_PRODUCT_SORT;

$lc_align = 'center';

break;

}

 

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

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

}

 

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

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

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

}

 

if ($listing_split->number_of_rows > 0) {

$rows = 0;

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

// BOF Separate Pricing per Customer

$no_of_listings = tep_db_num_rows($listing_query);

// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

 

if(!tep_session_is_registered('sppc_customer_group_id')) {

$customer_group_id = '0';

} else {

$customer_group_id = $sppc_customer_group_id;

}

 

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

*/

$select_list_of_prdct_ids = "products_id = '".$list_of_prdct_ids[0]."' ";

if ($no_of_listings > 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 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 (".$select_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 (".$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'], '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++)

 

// while ($listing = tep_db_fetch_array($listing_query)) { (was original code)

for ($x = 0; $x < $no_of_listings; $x++) {

$rows++;

 

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

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

} else {

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

}

 

$cur_row = sizeof($list_box_contents) - 1;

 

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

$lc_align = '';

 

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_align = '';

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

break;

case 'PRODUCT_LIST_NAME':

$lc_align = '';

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

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a> ';

}

break;

case 'PRODUCT_LIST_MANUFACTURER':

$lc_align = '';

$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id']) . '">' . $listing[$x]['manufacturers_name'] . '</a> ';

break;

case 'PRODUCT_LIST_PRICE':

$lc_align = 'right';

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

$lc_text = ' <s>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> ';

} else {

$lc_text = ' ' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' ';

}

break;

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

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

break;

case 'PRODUCT_LIST_WEIGHT':

$lc_align = 'right';

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

break;

case 'PRODUCT_LIST_IMAGE':

$lc_align = 'center';

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

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';

}

break;

// EOF Separate Pricing per Customer

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

$lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing['products_id']) . '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</form>';

break;

case 'PRODUCT_SORT_ORDER';

$lc_align = 'center';

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

break;

}

 

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

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

'text' => $lc_text);

}

}

 

new productListingBox($list_box_contents);

} else {

$list_box_contents = array();

 

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

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

'text' => TEXT_NO_PRODUCTS);

 

new productListingBox($list_box_contents);

}

 

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

?>

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

<tr>

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

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

</tr>

</table>

<?php

}

?>

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Thanks JanZ for the quick reply.

 

That is the way it is supposed to work in SPPC and the QPB for SPPC contribution. Specials need to be set for each group.

 

Is there anyway to modify it so the Specials work for other Customer Groups besides the Retail group? What I am looking at is if I a Customer Group has a standard price break of say 20% with 2+ items ordered, 30% with 5+ ordered, 40% for 10+ items, but for some reason I use the regular Special feature to make a 40% for everybody, it would be nice that the other Customer Group picks up on the special price for all orders up to 1-9 items. Then when the Special is over, everything would revert back to the Customer Group's usual percentage discount. Hopefully that makes sense :-)

 

Thanks again.

Link to comment
Share on other sites

I'll post my product_listing.php to see if someone can run a compare on it to see if I missed something.
I think I said something about the need to change $listing['db_field'] to $listing[$x]['db_field'] and guess what, you didn't do that (three instances, two of $listing['products_id] and one of $listing['products_sort_order']):

// EOF Separate Pricing per Customer
case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
$lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing['products_id']) . '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</form>';
break;
case 'PRODUCT_SORT_ORDER';
$lc_align = 'center';
$lc_text = '?' . $listing['products_sort_order'] . '?';
break;
}

Link to comment
Share on other sites

Well I Uploaded the full admin side of the store and care fully stripped out the Simple Template System contribution out of the catalog side. The Buttons work, I did not upload the product_listing.php page that was altered for Seperate Price PC and it is still the pre-SPPC from the Old backup. I am able to log in and buy products using dummy accounts made in the past.

 

I am getting the following error in the admin side, probably missed something so I am going to look for it now. That will leave uploading of the final page to finish the store being product_listing.php with the SPPC and Product Sort Order contributions. (I also use a quantity box above the Add to Cart button that works fine.) I can't seem to integrate them into this page.

 

Is there some help with that?

 

I will hunt for the cause of the other errors and attempt the fix.

 

Here are some screen shots.

 

catalog side:

 

 

pl1.jpg

 

pl2.jpg

 

pl3.jpg

 

Admin Error:

 

fe_admin.jpg

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I think I said something about the need to change $listing['db_field'] to $listing[$x]['db_field'] and guess what, you didn't do that (three instances, two of $listing['products_id] and one of $listing['products_sort_order']):

// EOF Separate Pricing per Customer
case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
$lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing['products_id']) . '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</form>';
break;
case 'PRODUCT_SORT_ORDER';
$lc_align = 'center';
$lc_text = '?' . $listing['products_sort_order'] . '?';
break;
}

 

Sorry, I didn't see you had made the post.

 

I will fix those and see what happens.

Thanks

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

Note: Sorry, Can't seem to get the screen shots working in the former post.

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I think I said something about the need to change $listing['db_field'] to $listing[$x]['db_field'] and guess what, you didn't do that (three instances, two of $listing['products_id] and one of $listing['products_sort_order']):

// EOF Separate Pricing per Customer
case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
$lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing['products_id']) . '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</form>';
break;
case 'PRODUCT_SORT_ORDER';
$lc_align = 'center';
$lc_text = '?' . $listing['products_sort_order'] . '?';
break;
}

 

 

So I made the changes to the three instances, and it does not work. If I revert back to my old product_listing.php, the Add to Cart buttons work in product listings.

 

Here is the old product listings that makes the buttons work.

 

<?php

/*

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

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

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

?>

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

<tr>

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

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

</tr>

</table>

<?php

}

 

$list_box_contents = array();

 

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

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_text = TABLE_HEADING_MODEL;

$lc_align = '';

break;

case 'PRODUCT_LIST_NAME':

$lc_text = TABLE_HEADING_PRODUCTS;

$lc_align = '';

break;

case 'PRODUCT_LIST_MANUFACTURER':

$lc_text = TABLE_HEADING_MANUFACTURER;

$lc_align = '';

break;

case 'PRODUCT_LIST_PRICE':

$lc_text = TABLE_HEADING_PRICE;

$lc_align = 'right';

break;

case 'PRODUCT_LIST_QUANTITY':

$lc_text = TABLE_HEADING_QUANTITY;

$lc_align = 'right';

break;

case 'PRODUCT_LIST_WEIGHT':

$lc_text = TABLE_HEADING_WEIGHT;

$lc_align = 'right';

break;

case 'PRODUCT_LIST_IMAGE':

$lc_text = TABLE_HEADING_IMAGE;

$lc_align = 'center';

break;

case 'PRODUCT_LIST_BUY_NOW':

$lc_text = TABLE_HEADING_BUY_NOW;

$lc_align = 'center';

break;

case 'PRODUCT_SORT_ORDER':

$lc_text = TABLE_HEADING_PRODUCT_SORT;

$lc_align = 'center';

break;

}

 

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

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

}

 

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

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

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

}

 

if ($listing_split->number_of_rows > 0) {

$rows = 0;

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

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

$rows++;

 

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

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

} else {

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

}

 

$cur_row = sizeof($list_box_contents) - 1;

 

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

$lc_align = '';

 

switch ($column_list[$col]) {

case 'PRODUCT_LIST_MODEL':

$lc_align = '';

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

break;

case 'PRODUCT_LIST_NAME':

$lc_align = '';

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

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';

}

break;

case 'PRODUCT_LIST_MANUFACTURER':

$lc_align = '';

$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';

break;

case 'PRODUCT_LIST_PRICE':

$lc_align = 'right';

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

$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

} else {

$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

}

break;

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

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

break;

case 'PRODUCT_LIST_WEIGHT':

$lc_align = 'right';

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

break;

case 'PRODUCT_LIST_IMAGE':

$lc_align = 'center';

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

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';

}

break;

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

$lc_text = '<form name="cart_quantity" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing['products_id']) . '"><input type="hidden" name="products_id" value="' . $listing['products_id'] . '"><input type="text" name="quantity" value="1" maxlength="5" size="5"><br>' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</form>';

break;

case 'PRODUCT_SORT_ORDER';

$lc_align = 'center';

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

break;

}

 

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

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

'text' => $lc_text);

}

}

 

new productListingBox($list_box_contents);

} else {

$list_box_contents = array();

 

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

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

'text' => TEXT_NO_PRODUCTS);

 

new productListingBox($list_box_contents);

}

 

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

?>

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

<tr>

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

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

</tr>

</table>

<?php

}

?>

 

I am also getting an error in the admin section on all the links in the left columns headings. Nothing will engage.

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/leakp/public_html/catalog/admin/includes/functions/database.php:13) in /home/leakp/public_html/catalog/admin/includes/functions/database.php on line 13

 

The spot that it refers to is here:

(I'm still hunting for the contribution change that is doing this one)

 

 

<?php

/*

$Id: database.php,v 1.23 2003/06/20 00:18:30 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

global $$link;

 

if (USE_PCONNECT == 'true') {

$$link = mysql_pconnect($server, $username, $password);

} else {

$$link = mysql_connect($server, $username, $password);

}

 

if ($$link) mysql_select_db($database);

 

return $$link;

}

 

function tep_db_close($link = 'db_link') {

global $$link;

 

return mysql_close($$link);

}

 

function tep_db_error($query, $errno, $error) {

die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');

}

 

function tep_db_query($query, $link = 'db_link') {

global $$link, $logger;

 

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {

if (!is_object($logger)) $logger = new logger;

$logger->write($query, 'QUERY');

}

 

$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

 

if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {

if (mysql_error()) $logger->write(mysql_error(), 'ERROR');

}

 

return $result;

}

 

function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {

reset($data);

if ($action == 'insert') {

$query = 'insert into ' . $table . ' (';

while (list($columns, ) = each($data)) {

$query .= $columns . ', ';

}

$query = substr($query, 0, -2) . ') values (';

reset($data);

while (list(, $value) = each($data)) {

switch ((string)$value) {

case 'now()':

$query .= 'now(), ';

break;

case 'null':

$query .= 'null, ';

break;

default:

$query .= '\'' . tep_db_input($value) . '\', ';

break;

}

}

$query = substr($query, 0, -2) . ')';

} elseif ($action == 'update') {

$query = 'update ' . $table . ' set ';

while (list($columns, $value) = each($data)) {

switch ((string)$value) {

case 'now()':

$query .= $columns . ' = now(), ';

break;

case 'null':

$query .= $columns .= ' = null, ';

break;

default:

$query .= $columns . ' = \'' . tep_db_input($value) . '\', ';

break;

}

}

$query = substr($query, 0, -2) . ' where ' . $parameters;

}

 

return tep_db_query($query, $link);

}

 

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC);

}

 

function tep_db_result($result, $row, $field = '') {

return mysql_result($result, $row, $field);

}

 

function tep_db_num_rows($db_query) {

return mysql_num_rows($db_query);

}

 

function tep_db_data_seek($db_query, $row_number) {

return mysql_data_seek($db_query, $row_number);

}

 

function tep_db_insert_id() {

return mysql_insert_id();

}

 

function tep_db_free_result($db_query) {

return mysql_free_result($db_query);

}

 

function tep_db_fetch_fields($db_query) {

return mysql_fetch_field($db_query);

}

 

function tep_db_output($string) {

return htmlspecialchars($string);

}

 

function tep_db_input($string) {

return addslashes($string);

}

 

function tep_db_prepare_input($string) {

if (is_string($string)) {

return trim(stripslashes($string));

} elseif (is_array($string)) {

reset($string);

while (list($key, $value) = each($string)) {

$string[$key] = tep_db_prepare_input($value);

}

return $string;

} else {

return $string;

}

}

 

?>

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

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...