Hi All
I was trying to get Separate Pricing Per Customer working, but for some reason it wasn't. So I downladed the contribution and went over all the code changes. I found that catalog/login.php was untouched![]()
![]()
Here is the code needed to modify the /catalog/login.php
This will mean when you log on as a customer you will see products priced according to there customer group.Code:catalog\login.php Line 4 **AFTER** $Id: login.php,v 1.80 2003/06/05 23:28:24 hpdl Exp $ **ADD** adapted for Separate Price Per Customer v4.0 2005/02/22 Line 29 **REPLACE** $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); **WITH** // BOF Separate Pricing per Customer /* $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); */ $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_group_id, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); // EOF Separate Pricing Per Customer Line 44 **AFTER** if (SESSION_RECREATE == 'True') { tep_session_recreate(); } **ADD** // BOF Separate Pricing Per Customer: choice for logging in under any customer_group_id // note that tax rates depend on your registered address! if ($_GET['skip'] != 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD ) { $existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id "); echo '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">'; print ("\n<html "); echo HTML_PARAMS; print (">\n<head>\n<title>Choose a Customer Group</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset="); echo CHARSET; print ("\"\n<base href=\""); echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; print ("\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\">\n"); echo '<body bgcolor="#ffffff" style="margin:0">'; print ("\n<table border=\"0\" width=\"100%\" height=\"100%\">\n<tr>\n<td style=\"vertical-align: middle\" align=\"middle\">\n"); echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process&skip=true', 'SSL')); print ("\n<table border=\"0\" bgcolor=\"#f1f9fe\" cellspacing=\"10\" style=\"border: 1px solid #7b9ebd;\">\n<tr>\n<td class=\"main\">\n"); $index = 0; while ($existing_customers = tep_db_fetch_array($existing_customers_query)) { $existing_customers_array[] = array("id" => $existing_customers['customers_group_id'], "text" => " ".$existing_customers['customers_group_name']." "); ++$index; } print ("<h1>Choose a Customer Group</h1>\n</td>\n</tr>\n<tr>\n<td align=\"center\">\n"); echo tep_draw_pull_down_menu('new_customers_group_id', $existing_customers_array, $check_customer['customers_group_id']); print ("\n<tr>\n<td class=\"main\"> <br />\n "); print ("<input type=\"hidden\" name=\"email_address\" value=\"".$_POST['email_address']."\">"); print ("<input type=\"hidden\" name=\"password\" value=\"".$_POST['password']."\">\n</td>\n</tr>\n<tr>\n<td align=\"right\">\n"); echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); print ("</td>\n</tr>\n</table>\n</form>\n</td>\n</tr>\n</table>\n</body>\n</html>\n"); exit; } // EOF Separate Pricing Per Customer: choice for logging in under any customer_group_id Line 81 **AFTER** $customer_first_name = $check_customer['customers_firstname']; **ADD** // BOF Separate Pricing per Customer if ($_GET['skip'] == 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD && isset($_POST['new_customers_group_id'])) { $sppc_customer_group_id = $_POST['new_customers_group_id'] ; $check_customer_group_tax = tep_db_query("select customers_group_show_tax, customers_group_tax_exempt from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" .(int)$_POST['new_customers_group_id'] . "'"); } else { $sppc_customer_group_id = $check_customer['customers_group_id']; $check_customer_group_tax = tep_db_query("select customers_group_show_tax, customers_group_tax_exempt from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id = '" .(int)$check_customer['customers_group_id'] . "'"); } $customer_group_tax = tep_db_fetch_array($check_customer_group_tax); $sppc_customer_group_show_tax = (int)$customer_group_tax['customers_group_show_tax']; $sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt']; // EOF Separate Pricing per Customer Line 98 **AFTER** tep_session_register('customer_default_address_id'); tep_session_register('customer_first_name'); **ADD** // BOF Separate Pricing per Customer tep_session_register('sppc_customer_group_id'); tep_session_register('sppc_customer_group_show_tax'); tep_session_register('sppc_customer_group_tax_exempt'); // EOF Separate Pricing per Customer ------------------------------------------------------------------------------------------------------- catalog\logoff.php Line 4 **AFTER** $Id: logoff.php,v 1.13 2003/06/05 23:28:24 hpdl Exp $ **ADD** adapted for Separate Pricing Per Customer 2005/02/06 Line 22 **AFTER** tep_session_unregister('customer_first_name'); **ADD** // BOF Separate Pricing per Customer tep_session_unregister('sppc_customer_group_id'); tep_session_unregister('sppc_customer_group_show_tax'); tep_session_unregister('sppc_customer_group_tax_exempt'); // EOF Separate Pricing per Customer





LinkBack URL
About LinkBacks










Bookmarks