Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Steven,

This did not work, But you are right-on with your thought about not allowing discounted items to be awarded points. I thought about your comment and went to the admin and changed the discounted items option to TRUE. Guess what? Wholesale now receives points. Unfortunately I will never be able to run specials on my prducts like this.
Sorry, but I don't get it. If you had "When customers redeem points, do you want to exclude items already discounted ? Redeemptions enabled only on items with full price" set to false, REDEMPTION_DISCOUNTED would have been false and the function would have returned true no matter what the prices were. :blink:

 

The only other function that seems to look at the price is get_award_discounted. You should perhaps amend this function in the same way as shown for get_points_rules_discounted. However, if I understand that code correctly it returns true whenever a single product in the basket has the same price as the products_price (and USE_POINTS_FOR_SPECIALS == 'false'). Not the behaviour the developer had in mind I think :huh:

Link to comment
Share on other sites

THAT DID IT.

 

I made the change you suggested concerning get_award_discounted($order) at line 136 and now all appears to work ok. I will cycle it several times to prove operational.

 

Thanks for your help.

 

 

Steven,

Sorry, but I don't get it. If you had "When customers redeem points, do you want to exclude items already discounted ? Redeemptions enabled only on items with full price" set to false, REDEMPTION_DISCOUNTED would have been false and the function would have returned true no matter what the prices were. :blink:

 

The only other function that seems to look at the price is get_award_discounted. You should perhaps amend this function in the same way as shown for get_points_rules_discounted. However, if I understand that code correctly it returns true whenever a single product in the basket has the same price as the products_price (and USE_POINTS_FOR_SPECIALS == 'false'). Not the behaviour the developer had in mind I think :huh:

Link to comment
Share on other sites

So I installed this contribution and it works great - it seems to do exactly what it's supposed to do. I'm having one problem, though, on the admin side. Since installing the module, whenever i use the 'search' function to find a customer I get the following error message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where c.customers_lastname like '%kleinbaum%' or c.customers_firstname like '%kl' at line 1

 

select count(*) as total from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id, customers_groups cg where c.customers_group_id = cg.customers_group_id where c.customers_lastname like '%kleinbaum%' or c.customers_firstname like '%kleinbaum%' or c.customers_email_address like '%kleinbaum%'

 

[TEP STOP]

 

 

Any thoughts?

 

Thanks, Josh

Link to comment
Share on other sites

I'm having one problem, though, on the admin side. Since installing the module, whenever i use the 'search' function to find a customer I get the following error message:
I remember that bug, but it was repaired in the last version. [changelog_v411.txt: bugfixes: - admin/customers.php see: http://www.oscommerce.com/forums/index.php?sho...ndpost&p=560311 (wrong sql, search didn't work properly)]
Link to comment
Share on other sites

Jan,

 

I've been trying to get this file (Wish List Cobtribution) to work with SPPC for the longest time now. I just can't seem to.

 

I have brought it back to the state where it works with salemaker. I'm guessing it can be done as I've managed (with your help) to make all the other places that display a price on my site work with SPPC & salemaker.

 

Your help in the past has always either been exactly right or pointed me in the right direction.

 

Would you mind taking a look at it, and advising me on how I might go about it...

 

Thanks.

 

Carlos

 

<?php

echo tep_draw_form('wishlist_form', tep_href_link(FILENAME_WISHLIST)); 

?>
<table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB;?>">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	  </tr>
	</table></td>
  </tr>

<?php
 if ($messageStack->size('wishlist') > 0) {
?>
	<tr>
	  <td align="center">
  <table border="0" cellspacing="0" cellpadding="0" width="100%" class="messageBox">
	<tr>
	  <td align="center">
	<table border="0" cellspacing="0" cellpadding="0">
	<tr><td><br><?php echo $messageStack->output('wishlist'); ?><br></td></tr>
	</table>
	  </td>
	</tr>
  </table>
	  </td>
	</tr>
  <tr><td height="5"></td></tr>
<?php
 }

if (is_array($wishList->wishID) && !empty($wishList->wishID)) {
reset($wishList->wishID);

?>
  <tr>
	<td>
	<table border="0" width="100%" cellspacing="0" cellpadding="3" class="productListing">
	  <tr>
			<td width="25%" class="productListing-heading" align="center"><?php echo BOX_TEXT_IMAGE; ?></td>
			<td width="35%" class="productListing-heading" align="center"><?php echo BOX_TEXT_PRODUCT; ?></td>
			<td width="25%" class="productListing-heading" align="center">Price Information</td>
			<td width="15%" class="productListing-heading" align="center"><?php echo BOX_TEXT_SELECT; ?></td>
	  </tr>

<?php
	$i = 0;

	while (list($wishlist_id, ) = each($wishList->wishID)) {

		$product_id = tep_get_prid($wishlist_id);

		$products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.short_desc, p.products_status, 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 . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where pd.products_id = '" . $product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by products_name");
		$products = tep_db_fetch_array($products_query);

		  if (($i/2) == floor($i/2)) {
			$class = "productListing-even";
		  } else {
			$class = "productListing-odd";
		  }

?>
			  <tr class="<?php echo $class; ?>">
				<td width="25%" class="productListing-data" align="center">

<!-- Modification -->
<?php	if($products['products_status'] == 0) {
// <!-- Modification Pic/No Pic -->
				if (tep_not_null($products['products_image'])) {
					echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
				} else {
				  echo tep_image(DIR_WS_IMAGES . 'no_image.gif');
				}

// <!-- /Modification Pic/No Pic -->
	} else {
// <!-- Modification Pic/No Pic -->
				if (tep_not_null($products['products_image'])) {
?>					<script language="javascript"><!--
		  document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $products['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $products['products_image'], addslashes($products['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?>');
		  //--></script>
		  <noscript>
		  <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $products['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
		  </noscript>
<?php			   } else {
				  echo tep_image(DIR_WS_IMAGES . 'no_image.gif');
				}
// <!-- /Modification Pic/No Pic -->
	}
?>
<!-- /Modification -->

				</td>

<!-- Modification -->
<?php				if($products['products_status'] == 0) {
?>					<td width="35%" align="center"><table border="0" cellpadding="3" cellspacing="0" width="96%"><tr><td align="center" class="productListing-data"><b><?php echo $products['products_name']; ?></b>
<?php			   } else {
?>					<td width="35%" align="center"><table border="0" cellpadding="3" cellspacing="0" width="96%"><tr><td align="center" class="productListing-data"><b><a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>"><?php echo $products['products_name']; ?></a></b>
<?php			   }
?>
<!-- /Modification -->

				<input type="hidden" name="prod_link[]" value="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $wishlist_id, 'NONSSL'); ?>" />
				<input type="hidden" name="prod_name[]" value="<?php echo $products['products_name']; ?>" />
<?php

/*******************************************************************
******** THIS IS THE WISHLIST CODE FOR PRODUCT ATTRIBUTES  *********
*******************************************************************/

			  $attributes_addon_price = 0;

			  // Now get and populate product attributes
				$att_name = "";
				if (isset($wishList->wishID[$wishlist_id]['attributes'])) {
					while (list($option, $value) = each($wishList->wishID[$wishlist_id]['attributes'])) {
						  echo tep_draw_hidden_field('id[' . $wishlist_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 = '" . $wishlist_id . "'
								   and pa.options_id = '" . $option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . $value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . $languages_id . "'
								   and poval.language_id = '" . $languages_id . "'");
						$attributes_values = tep_db_fetch_array($attributes);

				   		if ($attributes_values['price_prefix'] == '+') {
							$attributes_addon_price += $attributes_values['options_values_price'];
				   		} else if($attributes_values['price_prefix'] == '-') {
					 		$attributes_addon_price -= $attributes_values['options_values_price'];
						}
						$att_name .= " (" . $attributes_values['products_options_name'] . ": " . $attributes_values['products_options_values_name'] . ") ";
				   		echo '<br /><small><i> ' . $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] . '</i></small>';
					} // end while attributes for product

				}

				echo '<input type="hidden" name="prod_att[]" value="' . $att_name . '" />';

				$products['specials_new_products_price'] = tep_get_products_special_price($products['products_id']); 
			   	if (tep_not_null($products['specials_new_products_price'])) {
			   		$products_price = '<b><span class="productSpecialPrice">SPECIAL</span> <br>' . $currencies->display_price($products['specials_new_products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</b>';
			   	} else {
				   	$products_price = '<b>' . $currencies->display_price($products['products_price']+$attributes_addon_price, tep_get_tax_rate($products['products_tax_class_id'])) . '</b>';
				}

/*******************************************************************
******* CHECK TO SEE IF PRODUCT HAS BEEN ADDED TO THEIR CART *******
*******************************************************************/

		if($cart->in_cart($wishlist_id) && ($products['products_status'] != 0)) {
			echo '<br /><font color="#FF0000"><b>Item in Cart</b></font>';
		}

		$i++;
?>

<!-- Modification -->
<?php				if($products['products_status'] == 0) {
?>					</td></tr><tr><td class="productListing-data" style="text-align: Justify; line-height: 125%"><?php echo $products['short_desc']; ?></td></tr></table>
<?php			   } else {
?>					</td></tr><tr><td class="productListing-data" style="text-align: Justify; line-height: 125%"><?php echo $products['short_desc']; ?></td></tr><tr><td align="right"><a class="popUpNavigation" href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']); ?>">More Information >>></a></td></tr></table>
<?php			   }
?>
<!-- /Modification -->

		</td>

<!-- Modification -->
<?php				if($products['products_status'] == 0) {
?>					<td width="25%" class="productListing-data" align="center"><b>Item Is Currently<br><font color="#FF0000">NOT ?AVAILABLE</font></b></td>
<?php			   } else {
?>					<td width="25%" align="center" class="productListing-data"><?php echo $products_price; ?></td>
<?php			   }
?>
<!-- /Modification -->

<!-- Modification -->
<?php							if($products['products_status'] == 0) {
?>					<td width="15%" align="center"><?php echo tep_image_submit('small_delete.gif', ' Delete From Wish List ', 'name="delete_prod" value="delete_wishprod"'); ?></td>
				<input type="hidden" name="add_wishprod[]" value="<?php echo $wishlist_id; ?>" />
<?php			   } else {
?>					<td width="15%" align="center" class="productListing-data"><?php echo tep_draw_checkbox_field('add_wishprod[]',$wishlist_id); ?></td>
<?php			   }
?>
<!-- /Modification -->

	  </tr>

<?php
	}
?>
	</table>
	</td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td align="center" class="wishList">Update The Wish List By Placing A Check In The Check Box To The Right Of The Item(s)<br>Then Click On Either The "ADD TO CART" Or The "DELETE" Button Below</td>
	  </tr>
<!-- 		  <tr>
			<td height="5"></td>
	  </tr>
	  <tr>
		<td align="center" class="main"><?php // echo BOX_TEXT_WISHLIST_HELP_WHOLESALE;?></td>
	  </tr>
-->		</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="0" class="infoBox">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="3">
  <tr class="infoBoxContents">
	<td align="center"><?php echo tep_image_submit('button_delete.gif', ' Delete From Wish List ', 'name="delete_prod" value="delete_prod"'); ?></td>
	<td align="center"><?php echo tep_image_submit('button_in_cart.gif', ' Add to Cart ', 'name="add_prod" value="add_prod"'); ?></td>
	  </tr>
	</table></td>
  </tr>
	</table></td>
  </tr>
</table>
<?php

/*******************************************************************
*********** CODE TO SPECIFY HOW MANY EMAILS TO DISPLAY *************
*******************************************************************/

if(!tep_session_is_registered('customer_id')) {

?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td align="center"><table border="0" cellspacing="0" cellpadding="0" width="96%">
  <tr>
	<td class="main" style="text-align: Justify; line-height: 125%"><?php echo WISHLIST_EMAIL_TEXT_GUEST; ?></td>
  </tr>
	</table></td>
  </tr>
  <tr>
	<td align="center">
		<table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td align="center" class="main"><table cellpadding="2" cellspacing="0">
			  <tr>
				<td class="main"><?php echo TEXT_YOUR_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_name', $your_name); ?><b><font color="#FF0000"> ?*</font></b></td>
				</tr>
				<tr>
				<td class="main"><?php echo TEXT_YOUR_EMAIL; ?></td>
				<td class="main"><?php echo tep_draw_input_field('your_email', $your_email); ?><b><font color="#FF0000"> ?*</font></b></td>
				</tr>
			</table></td>
		  </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
		  <tr>
			<td align="center"><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
		  </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
<?php 

} else {

?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="center"><table border="0" cellspacing="0" cellpadding="0" width="96%">
  <tr>
	<td class="main" style="text-align: Justify; line-height: 125%"><?php echo WISHLIST_EMAIL_TEXT; ?></td>
  </tr>
	</table></td>
  </tr>
  <tr>
	<td align="center">
		<table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php
}

$email_counter = 0;
while($email_counter < DISPLAY_WISHLIST_EMAILS) {
?>

  <tr>
	<td align="center">
		<table border="0" width="98%" cellspacing="0" cellpadding="2">
		  <tr>
			<td align="center" class="main"><table cellpadding="2" cellspacing="0">
			  <tr>
				<td class="main"><?php echo TEXT_NAME; ?></td>
				<td class="main"><?php echo tep_draw_input_field('friend[]', $friend[$email_counter]); ?><b><font color="#FF0000"> ?*</font></b></td>
				</tr>
				<tr>
				<td class="main"><?php echo TEXT_EMAIL; ?></td>
				<td class="main"><?php echo tep_draw_input_field('email[]', $email[$email_counter]); ?><b><font color="#FF0000"> ?*</font></b></td>
				</tr>
			</table></td>
		  </tr>

<?php
$email_counter++;
}
?>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>
  <tr>
	<td align="center"><table border="0" width="70%" cellspacing="0" cellpadding="0">
		  <tr>
			<td class="main"><?php echo TEXT_MESSAGE .  tep_draw_textarea_field('message', 'soft', 25, 3); ?></td>
		  </tr>
	</table></td>
  </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
		  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="0" class="infoBox">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="3">
  <tr class="infoBoxContents">
	<td align="center"><?php echo tep_image_submit('button_send.gif', IMAGE_BUTTON_SEND_WISHLIST, 'name="email_prod" value="email_prod"'); ?></td>
	  </tr>
	</table></td>
  </tr>
	</table></td>
  </tr>
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?></td>
		  </tr>
		</table>
	</td>
  </tr>
</table>
	</td>
  </tr>
</table>
</form>
<?php

} else { // Nothing in the customers wishlist

?>
<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td align="center" class="main"><?php echo BOX_TEXT_NO_ITEMS_RETAIL;?></td>
	  </tr>
	</table>
	</td>
  </tr>
</table>

<?php 
}
?>

Link to comment
Share on other sites

Has anybody experienced the dissappearance of prices from the products_groups table?

 

I have just lost 102 of 115 product prices for one Customer group, but retained all 115 product prices for the other Customer group.

 

I have a recent backup to restore prices, but I'd like a fix, or at least a pointer.

Link to comment
Share on other sites

Has anybody experienced the dissappearance of prices from the products_groups table?

 

I have just lost 102 of 115 product prices for one Customer group, but retained all 115 product prices for the other Customer group.

 

I have a recent backup to restore prices, but I'd like a fix, or at least a pointer.

 

Mystery solved - Host problem!

Link to comment
Share on other sites

Good Morning.

 

I just installed this mod and I am having trouble with the admin side. I keep gettting this message

Parse error: parse error, unexpected '&' in /home/xxx/admin/categories.php on line 910

 

I tried placing ' ' and removing &nsp; all together, but mothing seems to work and it just points to another error in the same string. It's within this block of code

 

<tr bgcolor="#ebebff">
   <td class="main"><?php 
		 if (isset($pInfo->sppcoption)) {
   echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', (isset($pInfo->sppcoption[ $customers_group['customers_group_id']])) ? 1: 0);
  } else {
  echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name'];
  }
 &nsp;</td>

 

Any ideas how to fix this?

Edited by simplyclesha

Thanks!

Clesha

Link to comment
Share on other sites

just installed this mod and I am having trouble with the admin side. I keep gettting this message

Parse error: parse error, unexpected '&' in /home/xxx/admin/categories.php on line 910

<tr bgcolor="#ebebff">
   <td class="main"><?php 
		 if (isset($pInfo->sppcoption)) {
   echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', (isset($pInfo->sppcoption[ $customers_group['customers_group_id']])) ? 1: 0);
  } else {
  echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name'];
  }
 &nsp;</td>

The last few lines of that piece of code should be (around line 589 in the categories.php that comes with the package):

	  } else {
  echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name'];
  }
?>
 ?</td>

So a PHP end tag is missing and &nsp; should be   (but that is not causing the error, the missing end tag is).

Link to comment
Share on other sites

Carlos,

I've been trying to get this file (Wish List Cobtribution) to work with SPPC for the longest time now. I just can't seem to.
The most elegant way would be to first collect all the products_id's (as shown below) and then pick up all the info for all items on the wishlist in one query (and then using the extra [$x] as in includes/modules/product_listing.php). As a starter I suggest to use this code (starts around line 49 in your file):

<?php
$i = 0;
// BOF Separate Pricing per Customer
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }

while (list($wishlist_id, ) = each($wishList->wishID)) {
$list_of_prdct_ids[] = tep_get_prid($wishlist_id);
if (tep_not_null($list_of_prdct_ids)) { // implode will give an error when $list_of_prdct_ids is empty
$specials_query = tep_db_query("select products_id, specials_new_products_price from " . TABLE_SPECIALS . " where products_id in ('" . implode("','",$list_of_prdct_ids) . "') and status = '1' and customers_group_id = '" . $customer_group_id . "'");
   while ($specials_array = tep_db_fetch_array($specials_query)) {
   $special_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_new_products_price' => $specials_array['specials_new_products_price'] , 'final_price' => $specials_array['specials_new_products_price']);
   } // end while ($specials_array = tep_db_fetch_array($specials_query))		
} // end if (tep_not_null($list_of_prdct_ids))	
} // end while (list($wishlist_id, ) = each($wishList->wishID))
reset($wishList->wishID);
// EOF Separate Pricing per Customer

while (list($wishlist_id, ) = each($wishList->wishID)) {

$product_id = tep_get_prid($wishlist_id);
// BOF Separate Pricing per Customer
if ($customer_group_id == '0') {
  $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.short_desc, p.products_status, p.manufacturers_id, p.products_price, p.products_tax_class_id, NULL as specials_new_products_price, p.products_price as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");
} else {
  $products_query = tep_db_query("select pd.products_id, pd.products_name, pd.products_description, p.products_image, p.short_desc, p.products_status, p.manufacturers_id, pg.customers_group_price as products_price, p.products_tax_class_id, NULL as specials_new_products_price, pg.customers_group_price as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_GROUPS . " pg using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = '" . $product_id . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and pg.customers_group_id =  '" . $customer_group_id . "'");	
} // end if/else ($customer_group_id == '0')

$products = tep_db_fetch_array($products_query);

// add special price if there is one, replace final price in that case too
	if (tep_not_null($special_prices)) {
	for ($i = 0; $i < count($special_prices); $i++) {
	 if( $products['products_id'] == $special_prices[$i]['products_id'] ) {
	   $products['specials_new_products_price'] = $special_prices[$i]['specials_new_products_price'];
	   $products['final_price'] = $special_prices[$i]['final_price'];
	 }
	   }
   } // end if (tep_not_null($special_prices))
// EOF Separate Pricing per Customer

if (($i/2) == floor($i/2)) {
$class = "productListing-even";
} else {
$class = "productListing-odd";
}

This basically goes through the wishlist to pick up the products_id's, then collects all the special prices (to avoid even more queries), then uses a different query for retail and customers groups (avoids picking up special prices) and then adds in the special prices and replaces the final price (special price if there is one). The rest stays the same.

 

Haven't been able to test this, since I don't have that contribution installed so expect bugs.

Link to comment
Share on other sites

Jan,

 

Your code worked right out of the box (so to speak). I only had to copy and paste.

 

What a wonderful feeling it is to have this completed - I literally had spent several days trying all the different ways SPPC's code is implemented in the many files I have, which show prices; trying to make one of these ways work with this Wish List file.

 

This SPPC contribution, along with Price Break, and having it all work with Salemaker has been an extreme & lengthy experience for me. As I mentioned already, I had previous to SPPC+ about 4 dozen contributions nstalled, almost all of them modified in some way or another.

 

You have helped me either directly or indirectly (by way of reading what you have written to others here) with just about every file. Thank you seems less than adequate.

 

In general, for the most part, this OSC community is full of people who are helpful, and generous with their time. However you stand out even amongst the best of them with your reliable input, and your unassuming, thoughtful, and really extremely, generous manner.

 

Thank you.

 

Carlos

Link to comment
Share on other sites

Hi everyone,

 

I'm relatively new to this stuff, and am having a problem with SPPC. I have 3 price groups, 0, 1 and 2 (List, Member and Wholesale) with the default group set to 1 - Member. After a new customer creates an account (create_account_success.php), they see group 0 List prices rather than group 1 Member prices until they log out and then log back in again. After they create their account, the database lists a value of 1 in customer_group_id as it should. But, somehow the spcc_customer_group_id variable that is used in product_info.php doesn't have any value (it's null, I think) and they end up in the 0 group because the tests are for spcc_customer_group_id != 0. When they log out and then log back in, the spcc_customer_group_id has a value of 1 and sppc displays the correct pricing.

 

After customers create an account, they see high list prices and don't return, so it's a problem that I need to figure out. It seems like sppc_customer_group_id is set in login.php. But, new customers don't go through login.php - so can I do something like add sppc_customer_group_id = 1 to create_account_success.php?

 

I don't really know how to solve this, so any help that you can provide would be greatly appreciated.

 

My web site is live at www.tastarsupply.com if you want to see the problem in action.

Link to comment
Share on other sites

tastar,

 

I am not sure, but it seems like you're making it more difficult than it has to be by trying to reset the defalt sppc sequence (so to speak).

 

If I understand you correctly you are trying to make the new signups see the prices set for group 1 or "member", when I think sppc by default wants to have them see group 0 or "list".

 

I'm guessing it can be done, but I'm wondering what's the point... when you can just set your prices around having new signups & guests seeing group 0 (retail or list or whatever) prices then naming your other groups whatever you like. I don't recall seeing anywhere, where customers actually see a groups name.

 

The only point is, is to have guests, and new signups see the same price - is it not? And by default sppc has guests and new/initial signups seeing the same price in group 0.

 

Hope this makes some sense, and maybe even helps a little bit. If not, I'm sure someone else with more experience and knowledge will be able to, and will, advise you.

 

Regards,

 

Carlos

Link to comment
Share on other sites

Tony,

It seems like sppc_customer_group_id is set in login.php. But, new customers don't go through login.php - so can I do something like add sppc_customer_group_id = 1 to create_account_success.php?
You are right, this is a flaw in the create_account process: a number of session variables are not set that are set when you login. See this post and the last line for a link to the fix. In your case (since the default is 1 instead of 0) you will need to set sppc_customer_group_id to 1 instead of 0.
Link to comment
Share on other sites

Tony,

You are right, this is a flaw in the create_account process: a number of session variables are not set that are set when you login. See this post and the last line for a link to the fix. In your case (since the default is 1 instead of 0) you will need to set sppc_customer_group_id to 1 instead of 0.

 

Thank you, Jan. It was that simple. I guess my next step is to understand more about searching forums, session variables, etc. so I can actually contribute something. SPPC is a great contribution, it really adds a lot of power and flexibility to the system.

Link to comment
Share on other sites

Kate,

Yes, but I still don't understand why you get these errors. Did you use the files that came with the contribution or did you make the changes manually?

I think you would be best off with "table rate" that is a standard method in the admin section. For the three different zones I think you can best add two different table rate. Terry K gave tips about how to do that in the Tips and Tricks section of the forum.

 

JanZ

 

(Apologises for the delay replying). I used the files exactly that came with the contribution no manual changes. This is the only contribution added to the basic package and I installed it on a barebones installation. Other than changing the colours and images and a couple of amendments to the CSS file I've made no other changes to the package (haven't dared I'm a hardware person not a programmer!!)

 

Thank you for direction to the tips and tricks.

 

Kate

Link to comment
Share on other sites

A little off topic.. but you guys all seem to be on the same track as my store..

 

Right now we are going to be doig manul credit card processing in house.. I can;t figure out how to show which types pf cards we accept (ie mast/visa/amex only) as well I need to add in that dasterdly CVV2 code.. which mod is everyone using for that?? I see several.. some very complicated some overly simple looking..

 

thanks

Edited by wkdwich

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

Link to comment
Share on other sites

I Have SPPC installed and now installed the latest version, to date, of Price Break. Two things happened that I want to change. One - in Admin Under Customer, the area where i create customer groups dissapeared, and Two - when logging in, on the Catalog side, after the user name and pass is entered, it takes me to additional page asking which Customer group i want. How can I fix this? Otherwise it works great.

What would you do if you knew you could not fail?

Link to comment
Share on other sites

Change to the above post:

 

I have fixed the Admin side (my error). The only issue now is when a non-Wholesale account is created, it still asks which group the user wants to log in as. I want to remove this page and simply log the user as originally without asking which group they belong to. I want to determine that and have control over it through Admin.

 

Any help is greatly appreciated.

 

I Have SPPC installed and now installed the latest version, to date, of Price Break. Two things happened that I want to change. One - in Admin Under Customer, the area where i create customer groups dissapeared, and Two - when logging in, on the Catalog side, after the user name and pass is entered, it takes me to additional page asking which Customer group i want. How can I fix this? Otherwise it works great.

What would you do if you knew you could not fail?

Link to comment
Share on other sites

Change to the above post:

 

I have fixed the Admin side (my error). The only issue now is when a non-Wholesale account is created, it still asks which group the user wants to log in as. I want to remove this page and simply log the user as originally without asking which group they belong to. I want to determine that and have control over it through Admin.

 

Any help is greatly appreciated.

 

the only time it should bring up that page where it asks you which group you want to log in as is if you log in using your admin email addresss.

 

Its a feature for the admin. It SHOULDNT do it if you use any other email address when logging in.

Link to comment
Share on other sites

I have figured it out.

 

I Have SPPC installed and now installed the latest version, to date, of Price Break. Two things happened that I want to change. One - in Admin Under Customer, the area where i create customer groups dissapeared, and Two - when logging in, on the Catalog side, after the user name and pass is entered, it takes me to additional page asking which Customer group i want. How can I fix this? Otherwise it works great.

What would you do if you knew you could not fail?

Link to comment
Share on other sites

If anybody could offer some help on this, it would be greatly appreciated :)

 

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=725513

 

Thanks in advance

 

If there's one thing I like, it's persistence.

 

What happens when you use the file as is?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

If there's one thing I like, it's persistence.

 

What happens when you use the file as is?

 

it work fine, but doesnt contain any of the SPPC group prices to edit(of course since its the stock contrib). I would like to be able to edit the SPPC groups as well as the regular retail group if possible.

 

The contrib is actually a nice contrib.....its like easypopulate except you change everything in the admin section instead of excel. I would imagine more SPPC users would find good use for the multiple price update contrib.

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