Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

I tried that, but even selecting with an ordersum larger than this or that throws an error. The best I can come up with is:

select  c.customers_lastname, c.customers_firstname, c. customers_group_id, c.customers_id, c.customers_newsletter, sum(op.products_quantity * op.final_price)as ot from customers c, 

orders_products as op,  orders as o where o.orders_id = op.orders_id and c.customers_id = o.customers_id group by 

c.customers_id having ot > 50 limit 0, 1000

Share this post


Link to post
Share on other sites

Hello all,

 

I am using this contribution and it has made life so much easy for me. Wonderful contribution indeed.

 

I would like to ask if anyone using SPPC also has some feature that I am looking for :

 

would like to display on the main page (where the new produts are displayed) a few items that I want to select to be specially featured.

 

if anyone has this working with SPPC , pls give me some ideas or hints.

 

dca

Share this post


Link to post
Share on other sites

Hey all, this is a great contribution.. im implementing it right now for RC1.

 

For the most part its working just fine however I have found some problems maybe you guys can help me with

 

Im getting this error:

1054 - Unknown column 'p.products_id' in 'on clause'

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials_retail_prices s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '10'

 

Ive traced it to this code.. in catalog/index.php

// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) {

 $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} else { // either retail or no need to get correct special prices

 $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

 /* $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; */

} // end else { // either retail...
// EOF Separate Pricing per Customer

 

Now the second $listing_sql in the else which is commented out is the original line of code for that part .. if I replace the new line (right above it) with the original.. the page loads just fine.. if I use the new line of code.. it gives that error. This section of code provided is the last part of the last modification for catalog/index.php for a new installation of SPPC 4.1.6

 

any ideas?

 

im thinking all that needs to be done is to use the original.. and change where it says TABLE_SPECIALS to TABLE_SPECIALS_RETAIL_PRICES .. ive tried this it works just fine.. but just thought id clarify with everyone else.

 

AND it seems that this needs to be done in every else section of code (there are 4 $listing_sql = ) where this needs to be done i believe

J

Edited by insaini

Share this post


Link to post
Share on other sites

fresh install of osc v2.2rc1

using sppc v4.16

i just copyed catalog files from new install folder over top of osc oringal files.

ran sql statments

edited login.php for admin email.

 

and i am getting the following. when i attempt to goto the admin control panael. the store from what i can tell is running fine, i just can't get into control panel.

 

1146 - Table 'oscommerce2.table_administrators' doesn't exist

 

select id from TABLE_ADMINISTRATORS limit 1

 

[TEP STOP]

Share this post


Link to post
Share on other sites
fresh install of osc v2.2rc1

using sppc v4.16

i just copyed catalog files from new install folder over top of osc oringal files.

ran sql statments

edited login.php for admin email.

 

and i am getting the following. when i attempt to goto the admin control panael. the store from what i can tell is running fine, i just can't get into control panel.

 

1146 - Table 'oscommerce2.table_administrators' doesn't exist

 

select id from TABLE_ADMINISTRATORS limit 1

What made you think you could copy the catalog files in the contribution (which are a couple of years old) over the files from an osC version that is a few weeks old and not get into problems?

 

Obviously the define for the new table administrators that is new in RC1 is not in those old files...

Share this post


Link to post
Share on other sites

I've added Actual Attributes Price to a store with SPPC. This contrib allows you to list the actual price of a product in the options menu, instead of the increase or decrease in cost. You leave the price prefix blank instead of typing a + or -.

With SPPC, the attribute menu shows the correct price for the main (retail) customers, but not the wholesale. I don't think there is a way to add a separate attribute price for wholesale and retail. Or is there?

Thanks, Matt

Share this post


Link to post
Share on other sites

Okay, this is no doubt a really stupid question, and generally I'm not really stupid, but...

 

I've been having problems getting SPPC mod to save the payment and shipping options for each specific group. So I found this fix on the contributions page

 

Seperate Pricing Per Customer V4.15 (bugfix) payment and shipping_allowed

 

I downloaded it and its a .php file, only I have no idea where to put it.

 

Anyone help me out?


Worse things happen at sea

Share this post


Link to post
Share on other sites

No I worked it out. I'm a a bit thick sometimes. Because it was a .php file it threw me a bit.

 

I worked out to open the file and follow the instructions inside it. Which worked a charm....


Worse things happen at sea

Share this post


Link to post
Share on other sites

Can someone please tell me what the "" is for in SPPC 4.16?

I notice that by default it goes to "Alert On"

 

Does having the alert on prevent wholesale customers from seeing wholesale prices?

 

If so, can it be defaulted to "Alert Off"?

 

I searched the forum and went through the documentation for sppc but could not find any explanation.

Share this post


Link to post
Share on other sites
Can someone please tell me what the "" is for in SPPC 4.16?

I notice that by default it goes to "Alert On"

 

Does having the alert on prevent wholesale customers from seeing wholesale prices?

 

If so, can it be defaulted to "Alert Off"?

The alert goes to "ON" when a customer signs up add fills in the field for the company tax id number. That is a customer you probably would like to take a look at to put him/her in another group.

 

Is that so bad?

Share this post


Link to post
Share on other sites

Features Question:

 

Some companies set min. quantities in which they satisfy for their wholesale order. For instance all wholesale orders must consist of 5 products, if they try to check out without 5 items in their cart, their purchase is not allowed.

 

Also, is there a way to make certain items visible to ONLY wholesalers and not retail customers?

Share this post


Link to post
Share on other sites
Some companies set min. quantities in which they satisfy for their wholesale order. For instance all wholesale orders must consist of 5 products, if they try to check out without 5 items in their cart, their purchase is not allowed.
If there is a contribution like that (I know there is one for minimum value) for regular osC, it is not that hard to adapt it to use with more than one group. In this thread it is mentioned once I think.

 

Also, is there a way to make certain items visible to ONLY wholesalers and not retail customers?

Yes, that is the Hide products from customer groups for SPPC contribution.

Share this post


Link to post
Share on other sites
If there is a contribution like that (I know there is one for minimum value) for regular osC, it is not that hard to adapt it to use with more than one group. In this thread it is mentioned once I think.

Yes, that is the Hide products from customer groups for SPPC contribution.

 

Hi, may I ask if there is a way to hide products from Guest which means that those users who have not login to the online store are unable to view those hidden products.

Please kindly help me out over here.

Thanks.

Share this post


Link to post
Share on other sites
Hi, may I ask if there is a way to hide products from Guest which means that those users who have not login to the online store are unable to view those hidden products.
Only when all your logged-in users are in another group than Retail. It would mean that you keep prices for Retail and that new group the same, but hide those certain products for the Retail group (customer group id 0).

Share this post


Link to post
Share on other sites

Hello all. I searched the forums and I don't see a person with this problem. I THINK it's related to SPPC but I don't know for sure. When I try to add something to my cart, appearently anything, I get the following error:

 

1052 - Column: 'products_id' in where clause is ambiguous

 

select products_status, options_id, options_values_id, attributes_hide_from_groups, '0' as hide_attr_status from products left join products_attributes using(products_id) where products_id = '158'

 

[TEP STOP]

 

If anyone can give any insight into this error I would greatly appreciate it.

Share this post


Link to post
Share on other sites
It looks like this MySQL4 problem in the attribute mod...

 

I appreciate the response however, I've very limited experience in code and that example does not look anything like my shopping_cart.php. I looked through the response you linked to and as far as I can tell the offending code from the example does not exist in my file. Here is what mine contains:

 

<?php
/*
 $Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 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_SHOPPING_CART);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));
?>
<!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"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><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_cart.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
 if ($cart->count_contents() > 0) {
?>
  <tr>
	<td>
<?php
$info_box_contents = array();
$info_box_contents[0][] = array('align' => 'center',
								'params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_REMOVE);

$info_box_contents[0][] = array('params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_PRODUCTS);

$info_box_contents[0][] = array('align' => 'center',
								'params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_QUANTITY);

$info_box_contents[0][] = array('align' => 'right',
								'params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_TOTAL);

$any_out_of_stock = 0;
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// Push all attributes information in an array
  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
								  from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
								  where pa.products_id = '" . (int)$products[$i]['id'] . "'
								   and pa.options_id = '" . (int)$option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . (int)$value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . (int)$languages_id . "'
								   and poval.language_id = '" . (int)$languages_id . "'");
	  $attributes_values = tep_db_fetch_array($attributes);

	  $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
	  $products[$i][$option]['options_values_id'] = $value;
	  $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
	  $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
	  $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
	}
  }
}

for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  if (($i/2) == floor($i/2)) {
	$info_box_contents[] = array('params' => 'class="productListing-even"');
  } else {
	$info_box_contents[] = array('params' => 'class="productListing-odd"');
  }

  $cur_row = sizeof($info_box_contents) - 1;

  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => 'class="productListing-data" valign="top"',
										 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));

  $products_name = '<table border="0" cellspacing="2" cellpadding="2">' .
				   '  <tr>' .
				   '	<td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
				   '	<td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';

  if (STOCK_CHECK == 'true') {
	$stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
	if (tep_not_null($stock_check)) {
	  $any_out_of_stock = 1;

	  $products_name .= $stock_check;
	}
  }

  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	reset($products[$i]['attributes']);
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
	}
  }

  $products_name .= '	</td>' .
					'  </tr>' .
					'</table>';

  $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
										 'text' => $products_name);

  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => 'class="productListing-data" valign="top"',
										 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

  $info_box_contents[$cur_row][] = array('align' => 'right',
										 'params' => 'class="productListing-data" valign="top"',
										 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
}

new productListingBox($info_box_contents);
?>
	</td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>
  </tr>
<?php
if ($any_out_of_stock == 1) {
  if (STOCK_ALLOW_CHECKOUT == 'true') {
?>
  <tr>
	<td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
  </tr>
<?php
  } else {
?>
  <tr>
	<td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
  </tr>
<?php
  }
}
?>
  <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="infoBox">
	  <tr class="infoBoxContents">
		<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 class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
<?php
$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
?>
			<td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
}
?>
			<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 } else {
?>
  <tr>
	<td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></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="infoBox">
	  <tr class="infoBoxContents">
		<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" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 }
?>
</table></form></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'); ?>

 

Again, I appreciate any help you can provide.

Share this post


Link to post
Share on other sites

Hello,

 

I was wondering if there's any possibility to move all the customers from a group to other, not one by one.

 

Is there any solution for this? Something like a bulk edit?

 

Thank you.

Share this post


Link to post
Share on other sites
What made you think you could copy the catalog files in the contribution (which are a couple of years old) over the files from an osC version that is a few weeks old and not get into problems?

 

Obviously the define for the new table administrators that is new in RC1 is not in those old files...

 

I Did the same thing and had the same problem. What made me think you could do that was the instructions that came with the SPPC v4.16 that was released in June of 2007. So besides the snide comments do you have anything helpful to add or do you just like taking shots at people who are new to the product?

 

If you can follow the instructions that come with the V4.16 for easy new installations can anyone give me a quick run through on how you actually do add this contribution into a new install of OSc?

Thanks for any assistance,

Mark

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

×