Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

I've presently got SPPC + QPBPP working great, thanks to this thread. I'd like to make QPBPP give breaks for ANY combinations of products ordered by wholesaler accounts, not just for one product or category. Where might I modify QPBPP for SPPC in order to make this happen?

 

I saw that QPBPP for SPPC has a per-category method you can adjust to. Could I perhaps modify the category comparison as shown in the install for PBPC and make it a less-than operation and make the number a large integer that I will never reach in categories? (and how would I go about this?)

 

I saw that OhYeah's problem is what I need. lol. Jan Z mentioned this:

One of the issues is that categories_id was not added to the list of fields in the $sql of the function loadProduct in PriceFormatter.php. Therefore, you get a NULL for all products as you found in your first issue.

 

Could I accomplish what I want through a PriceFormatter or PriceFormatterStore edit without modifying PBPC into my SPPC+QPBPP?

Edited by Swami
Link to comment
Share on other sites

Me neither. The code that processes that action can be found in application_top.php (switch $action, case: bla bla).

Thanks Jan, your hint was useful - I found some missing lines in my application_top, and replaced it with a saved version.

John

Link to comment
Share on other sites

Could I accomplish what I want through a PriceFormatter or PriceFormatterStore edit without modifying PBPC into my SPPC+QPBPP?

Probably not, but at least you don't need to query for the categories_id, you can just set that categories id in the sql ('1' as categories_id will probably do fine).

 

Making it possible to add a "discount_category" to a product so that you can mix and match products from all kinds of categories is still on my TO DO list but time is the problem.

Link to comment
Share on other sites

Probably not, but at least you don't need to query for the categories_id, you can just set that categories id in the sql ('1' as categories_id will probably do fine).

 

Making it possible to add a "discount_category" to a product so that you can mix and match products from all kinds of categories is still on my TO DO list but time is the problem.

 

Do you mean editing sql directly, or editing the sql query in the PBPCategory code? If right in mysql, how can multiple categories have one id without breaking categories?

 

If code, which file(s) and where would I set this? I'd need to put in the PBPCategory code then edit shopping_cart.php here?

// BOF Price Break for SPPC mod, price break per category
  $products_query = tep_db_query("select products_to_categories.products_id, categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " using(products_id) where customers_id = '" . (int)$customer_id . "'");
  while ($products = tep_db_fetch_array($products_query)) {
	$this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'category' => $products['categories_id']);
// EOF Price Break for SPPC mod, price break per category

 

I'm fearful of breaking the groups functionality that just started working. I'm terrible with PHP, but learning.

Link to comment
Share on other sites

I am in need of php pro help. Can anyone help me very specifically to set up SPPC + QPBPP (already installed and working) so that ANY combination of products triggers the discounts? I don't want price breaks per category. I need price breaks per number of items. I can't tell where or how many places to edit to achieve this. Please help!

 

Jan Z, your advice sounds like it should be good, but I do not know where to make these edits. This is less obvious for me:

Probably not, but at least you don't need to query for the categories_id, you can just set that categories id in the sql ('1' as categories_id will probably do fine).

 

Making it possible to add a "discount_category" to a product so that you can mix and match products from all kinds of categories is still on my TO DO list but time is the problem.

Link to comment
Share on other sites

Hello,

 

Was wondering if it is possible to have an auto email notification after someone creates an account as a dealer? I would like to be able when a dealer creates an account, that the system automatically emails them with a dealer application?

 

Thanks JR

Link to comment
Share on other sites

Was wondering if it is possible to have an auto email notification after someone creates an account as a dealer? I would like to be able when a dealer creates an account, that the system automatically emails them with a dealer application?

I would think so. You get an email when they enter a tax_id (around line 283 and further in create_account.php), so you could another email after that with the new customer as the recipient.

Edited by Jan Zonjee
Link to comment
Share on other sites

Probably not, but at least you don't need to query for the categories_id, you can just set that categories id in the sql ('1' as categories_id will probably do fine).

 

Making it possible to add a "discount_category" to a product so that you can mix and match products from all kinds of categories is still on my TO DO list but time is the problem.

 

Rather than make all the categories to the same id (which would break category links, no?), if the categories_id is not needed and you could set the categories_id to 1, couldn't you therefore test against ANY integer field in the products database with an insane > or < operation instead of "=1"? For instance, products_price > 0.00 or category_id < 5000?

 

I'm really grasping for a solution without much expertise in applying the actual code. :/

 

Desperate.

Link to comment
Share on other sites

Wonderful contribution! Thank you for putting so much work into it and for supporting it actively. :thumbsup:

 

I have a question: is it possible to have customers registering and being redirected to their group automatically upon their first login, so they will be able to see the prices for their group only? Is this how it works?

 

I'm asking because I have two kinds of clients:

 

A- Regular customers (an individual or a company) who will have a lower price

B- Clients with special (higher) prices

 

As far as I understand, the program will allow clients to register and show them a default price, right? How can each client be automatically redirected to the group they belong to so they will not see each others prices?

 

This situation is different from retail and wholesale prices. I cannot have group A registering and seeing the higher prices, because that will push them away. And I cannot have group B registering and seeing the regular prices until the admin approves them so they will now have the higher prices.

 

BTW, I'm using the Hide prices contribution, so customers need to login in order to see prices, this way, they won't know there are different prices.

 

TIA for any ideas on this.

Edited by Patty

Patty

Link to comment
Share on other sites

I've now got SPPC with PBPCategory functioning. It appears to work flawlessly. I'd like to make the jump now to create a 'discount_category' that I can refer to so that PBPC thinks everything is in one category so ALL products count towards the price breaks. I think I can do that in sql with a modify statement like this (what do you think?):

alter table products
add column discount_category decimal(15,4) not null default 0.0,
update products set discount_category=1 where products_status=1;

 

If the above is right, would I need to add a 'discount_category' to products_groups as well? And then I populate the column with the exact same values for all products (update statement shown above for all active products)?

 

Also, I'd need to edit any reference to 'TABLE_PRODUCTS_TO_CATEGORIES'? If so, which files and what would they change to?

 

Thanks in advance! I'm learning.

Link to comment
Share on other sites

My previous post is unneeded. I just realized that the PBPCategory is already working as I'd like. I do not know why. I can add ANY products in ANY combination from ANY category and the price breaks trigger.

 

I'd like to know why this is functioning this way so I don't accidently fix it. Perhaps I've got the database information messed up so it gets a NULL result and lumps all products together?

Link to comment
Share on other sites

LOL - well, that's what happens when I have to take a break from coding for a few months. Thank you again for helping and pointing out when I'm not doing so good :thumbsup:

 

We don't use the customers_specific_taxes_exempt, and in fact we don't need to use any of the tax info as we don't charge sales tax (there isn't any sales tax in our State, only income tax). Would it hurt anything if I skip the tax info alltogether, or should I just modify it according to other pages that have the tax queries for removing the specific taxes parts?

 

Thanks again!

 

 

Not so good Tracy, not so good:

 

if ($where_clause) { // this brace doesn't "end" in this piece of code, is that OK?

			$search_sql = "select * from ".TABLE_CUSTOMERS." where ".$where_clause;
			$search_query = tep_db_query($search_sql);
			$search_query_result = tep_db_fetch_array($search_sql);

//BOF SPPC
	$sppc_customer_group_id = $search_query_result['customers_group_id'];
//		for (sppc_customer_group_id) {
  $customers_specific_taxes_exempt = $search_query_result['customers_specific_taxes_exempt'];
  $check_customer_group_tax = tep_db_query("select customers_group_show_tax, customers_group_tax_exempt, group_specific_taxes_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'];
$sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt'];
$group_specific_taxes_exempt = $customer_group_tax['group_specific_taxes_exempt'];
if (tep_not_null($customers_specific_taxes_exempt)) {
	$sppc_customer_specific_taxes_exempt = $customers_specific_taxes_exempt;
} elseif (tep_not_null($group_specific_taxes_exempt)) {
	$sppc_customer_specific_taxes_exempt = $group_specific_taxes_exempt;
} else {
	$sppc_customer_specific_taxes_exempt = '';
}
		tep_session_register('sppc_customer_group_id');
		tep_session_register('sppc_customer_group_show_tax');
		tep_session_register('sppc_customer_group_tax_exempt');				
	 //   }
//			global $customer_group_id;
$customer_group_id = $sppc_customer_group_id;
//			if(!isset($customer_group_id)) { $customer_group_id = '0'; }

//EOF SPPC			

			if (tep_db_num_rows($search_query)) {

			$info_box_contents[] = array('align' => 'center',
						 'text'  => TEXT_ADMIN_MATCHES);

The group_specific_taxes might not be in your installation. It is from the latest version.

~Tracy
 

Link to comment
Share on other sites

Ok - I've added everything here except for the customers_specific_taxes parts. I also noticed that this line was duplicated, I only put it in once but thought I'd check to see if there was a reason for the duplicate other than a simple mistake :blush:

 

$sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt'];

 

I will be uploading and testing it shortly :thumbsup:

 

Thanks again!

 

 

 

Not so good Tracy, not so good:

 

if ($where_clause) { // this brace doesn't "end" in this piece of code, is that OK?

			$search_sql = "select * from ".TABLE_CUSTOMERS." where ".$where_clause;
			$search_query = tep_db_query($search_sql);
			$search_query_result = tep_db_fetch_array($search_sql);

//BOF SPPC
	$sppc_customer_group_id = $search_query_result['customers_group_id'];
//		for (sppc_customer_group_id) {
  $customers_specific_taxes_exempt = $search_query_result['customers_specific_taxes_exempt'];
  $check_customer_group_tax = tep_db_query("select customers_group_show_tax, customers_group_tax_exempt, group_specific_taxes_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'];
$sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt'];
$group_specific_taxes_exempt = $customer_group_tax['group_specific_taxes_exempt'];
if (tep_not_null($customers_specific_taxes_exempt)) {
	$sppc_customer_specific_taxes_exempt = $customers_specific_taxes_exempt;
} elseif (tep_not_null($group_specific_taxes_exempt)) {
	$sppc_customer_specific_taxes_exempt = $group_specific_taxes_exempt;
} else {
	$sppc_customer_specific_taxes_exempt = '';
}
		tep_session_register('sppc_customer_group_id');
		tep_session_register('sppc_customer_group_show_tax');
		tep_session_register('sppc_customer_group_tax_exempt');				
	 //   }
//			global $customer_group_id;
$customer_group_id = $sppc_customer_group_id;
//			if(!isset($customer_group_id)) { $customer_group_id = '0'; }

//EOF SPPC			

			if (tep_db_num_rows($search_query)) {

			$info_box_contents[] = array('align' => 'center',
						 'text'  => TEXT_ADMIN_MATCHES);

The group_specific_taxes might not be in your installation. It is from the latest version.

~Tracy
 

Link to comment
Share on other sites

Ok - I've added everything here except for the customers_specific_taxes parts. I also noticed that this line was duplicated, I only put it in once but thought I'd check to see if there was a reason for the duplicate other than a simple mistake :blush:

 

$sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt'];

Yep, that duplication was a mistake.

I will be uploading and testing it shortly

I'm almost sure that you will get errors about not having a column group_specific_taxes_exempt :)

Link to comment
Share on other sites

Ok - I've uploaded and tested and I can't seem to find where my query is incorrect. I keep getting the error:

 

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

 

Through researching this error on the forums, it would appear that it is caused by something in a query being incorrect, but I can't seem to spot it. This is all of the PHP in the block that I have added the BOF SPPC section to. All of the closing } are there (I had truncated it before which is why you weren't sure earlier) - maybe I'm simply trying to add this to the wrong section of code?

 

I'll keep going over it, just not seeing the error at the moment - any thoughts on your end?

 

<? 

		$info_box_contents = array();
		$info_box_contents[] = array('text' => TEXT_ADMIN_CREATE_ACCOUNT);

		new infoBoxHeading($info_box_contents, true, false);
		unset($info_box_contents);
		$info_box_contents[] = array('align' => 'center',
					 'text'  => '<a href="'.tep_href_link(FILENAME_ADMIN_CREATE_ACCOUNT,'','SSL').'">'.TEXT_ADMIN_CREATE_ACCOUNT.'</a>');

		new infoBox($info_box_contents);

	?>

	<br>

	<? 

		$info_box_contents = array();
		$info_box_contents[] = array('text' => TEXT_ADMIN_SEARCH_ACCOUNT);

		new infoBoxHeading($info_box_contents, true, false);

		unset($info_box_contents);

		$info_box_contents[] = array('align' => 'center',
					 'text'  => tep_draw_form('search_customers', tep_href_link(FILENAME_ADMIN,'','SSL'), 'get').TEXT_ADMIN_SEARCH_EMAIL.'<br>'.tep_draw_input_field('search_email').'<br>'.TEXT_ADMIN_SEARCH_LASTNAME.'<br>'.tep_draw_input_field('search_lastname').'<br>'.TEXT_ADMIN_SEARCH_PHONE.'<br>'.tep_draw_input_field('search_phone'));
		$info_box_contents[] = array('align' => 'center',
					 'text'  => tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH).tep_hide_session_id().'</form>');

		if ($HTTP_GET_VARS['search_email']) {
			$search_email = tep_db_prepare_input($HTTP_GET_VARS['search_email']);
			$where_clause = "customers_email_address RLIKE '".tep_db_input($search_email)."'";
		}

		if ($HTTP_GET_VARS['search_phone']) {
			$search_phone = tep_db_prepare_input($HTTP_GET_VARS['search_phone']);
			$where_clause .= ($where_clause ? ' or ' : '')."customers_telephone RLIKE '".tep_db_input($search_phone)."'";
		}

		if ($HTTP_GET_VARS['search_lastname']) {
			$search_lastname = tep_db_prepare_input($HTTP_GET_VARS['search_lastname']);
			$where_clause .= ($where_clause ? ' or ' : '')." customers_lastname RLIKE '".tep_db_input($search_lastname)."'";
		}


		if ($where_clause) {

			$search_sql = "select * from ".TABLE_CUSTOMERS." where ".$where_clause;
			$search_query = tep_db_query($search_sql);
			$search_query_result = tep_db_fetch_array($search_sql);

//BOF SPPC
	$sppc_customer_group_id = $search_query_result['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'];

		tep_session_register('sppc_customer_group_id');
		tep_session_register('sppc_customer_group_show_tax');
		tep_session_register('sppc_customer_group_tax_exempt');

	$customer_group_id = $sppc_customer_group_id;
	}
//EOF SPPC			

			if (tep_db_num_rows($search_query)) {

			$info_box_contents[] = array('align' => 'center',
						 'text'  => TEXT_ADMIN_MATCHES);


			$search_display = '<table border="1" width="100%" cellspacing="0" cellpadding="2">';
			$search_display .= '<tr><td class="tableHeading">'.TEXT_ADMIN_SEARCH_EMAIL.'</td><td class="tableHeading">'.TEXT_ADMIN_SEARCH_NAME.'</td><td class="tableHeading">'.TEXT_ADMIN_SEARCH_PHONE.'</td></tr>';	
			while ($search_result = tep_db_fetch_array($search_query)) {
				$search_display .= '<tr><td class="smallText"><a href="'.tep_href_link(FILENAME_ADMIN_LOGIN,'email_address='.$search_result['customers_email_address'],'SSL').'">'.$search_result['customers_email_address'].'</a></td><td class="smallText">'.$search_result['customers_firstname'].' '.$search_result['customers_lastname'].'</td><td class="smallText">'.$search_result['customers_telephone'].'</td></tr>';	
			}
			$search_display .= '</table>';

			$info_box_contents[] = array('align' => 'left',
						 'text'  => $search_display);

		} else {
				$info_box_contents[] = array('align' => 'center',
							 'text'  => TEXT_ADMIN_NO_MATCHES);
		}
		}

		new infoBox($info_box_contents);

	 ?>

 

:blush:

 

Ok - I've added everything here except for the customers_specific_taxes parts. I also noticed that this line was duplicated, I only put it in once but thought I'd check to see if there was a reason for the duplicate other than a simple mistake :blush:

 

$sppc_customer_group_tax_exempt = (int)$customer_group_tax['customers_group_tax_exempt'];

 

I will be uploading and testing it shortly :thumbsup:

 

Thanks again!

~Tracy
 

Link to comment
Share on other sites

Ok - I've uploaded and tested and I can't seem to find where my query is incorrect. I keep getting the error:

 

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

Probably the line if (tep_db_num_rows($search_query)) {

Better move it up anyway:

 if (tep_db_num_rows($search_query)) {
//BOF SPPC
	$sppc_customer_group_id = $search_query_result['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'];

		tep_session_register('sppc_customer_group_id');
		tep_session_register('sppc_customer_group_show_tax');
		tep_session_register('sppc_customer_group_tax_exempt');

	$customer_group_id = $sppc_customer_group_id;
	}
//EOF SPPC			

	  //	  if (tep_db_num_rows($search_query)) {

Link to comment
Share on other sites

Oops - forgot to remove the } here:

}
//EOF SPPC

 

That shouldn't be there ;)

 

I changed this:

$search_query_result = tep_db_fetch_array($search_sql);

 

to this:

$search_query_result = tep_db_fetch_array($search_query);

 

And it seems to be working with existing customers!! YAY!! Now to test it when creating a new account ;)

 

Thanks!! :thumbsup:

~Tracy
 

Link to comment
Share on other sites

Oops - forgot to remove the } here:

}
//EOF SPPC

 

That shouldn't be there ;)

 

I changed this:

$search_query_result = tep_db_fetch_array($search_sql);

 

to this:

$search_query_result = tep_db_fetch_array($search_query);

Ah yes, I overlooked those two. Good catch.

Link to comment
Share on other sites

Ugh! Well, it's working great for existing customers, but creating a new customer, when you get to the checkout_shipping.php page it just keeps reloading and won't continue past it <_<

 

Back to searching - LOL It looks like it has it's own create account page that I can compare with the normal create account page though, so hopefully this will be an easy fix :thumbsup:

 

Thanks again!!

 

Oops - forgot to remove the } here:

}
//EOF SPPC

 

That shouldn't be there ;)

 

I changed this:

$search_query_result = tep_db_fetch_array($search_sql);

 

to this:

$search_query_result = tep_db_fetch_array($search_query);

 

And it seems to be working with existing customers!! YAY!! Now to test it when creating a new account ;)

 

Thanks!! :thumbsup:

~Tracy
 

Link to comment
Share on other sites

Thank you Jan - I'll try doing that as well just to avoid possible future issues in case it needs to be moved up :)

 

Now to just figure out why I am not getting any shipping options to choose from (hence the reason the checkout_shipping.php just keeps reloading) when creating a new account on the catalog/admin_create_account.php page. Gotta find the forum for this contrib and see if they've mentioned a fix for this yet :)

 

:thumbsup:

 

Probably the line if (tep_db_num_rows($search_query)) {

Better move it up anyway:

 if (tep_db_num_rows($search_query)) {
//BOF SPPC
	$sppc_customer_group_id = $search_query_result['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'];

		tep_session_register('sppc_customer_group_id');
		tep_session_register('sppc_customer_group_show_tax');
		tep_session_register('sppc_customer_group_tax_exempt');

	$customer_group_id = $sppc_customer_group_id;
	}
//EOF SPPC			

	  //	  if (tep_db_num_rows($search_query)) {

~Tracy
 

Link to comment
Share on other sites

Now to just figure out why I am not getting any shipping options to choose from (hence the reason the checkout_shipping.php just keeps reloading) when creating a new account on the catalog/admin_create_account.php page. Gotta find the forum for this contrib and see if they've mentioned a fix for this yet :)

It looks like you added the session register stuff for SPPC on the wrong page because to me it looks like this link is really logging you in on the page defined by FILENAME_ADMIN_LOGIN:

					$search_display .= '<tr><td class="smallText"><a href="'.tep_href_link(FILENAME_ADMIN_LOGIN,'email_address='.$search_result['customers_email_address'],'SSL').'">'.$search_result['customers_email_address'].'</a></td><td class="smallText">'.$search_result['customers_firstname'].' '.$search_result['customers_lastname'].'</td><td class="smallText">'.$search_result['customers_telephone'].'</td></tr>';

Or I'm missing something :)

At least I don't see the end of link tag (< /a >).

Link to comment
Share on other sites

Hmmmm - you may have a point here :blush:

 

This is the catalog/admin_login.php page - does it look to you like it should be here instead of (or as well as) the page I put it on? Everything is working if the customer is already in the database. It only breaks if you have to create a new account. I'm wondering if this is the page it needs to be in for that purpose? :huh:

 

Thanks!!

 

  require('includes/application_top.php');
 require('includes/configure_simple_order_entry.php');

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
 if ($session_started == false) {
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
 }

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

 $error = false;

$email_address = tep_db_prepare_input($HTTP_GET_VARS['email_address']);


// Check if email exists
$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) . "'");
if (!tep_db_num_rows($check_customer_query)) {
  $error = true;
} else {

  $check_customer = tep_db_fetch_array($check_customer_query);
// Check that password is good

	if (SESSION_RECREATE == 'True') {
	  tep_session_recreate();
	}

	$cart->reset();

	$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_customer['customers_id'] . "' and address_book_id = '" . (int)$check_customer['customers_default_address_id'] . "'");
	$check_country = tep_db_fetch_array($check_country_query);

	$customer_id = $check_customer['customers_id'];
	$customer_default_address_id = $check_customer['customers_default_address_id'];
	$customer_first_name = $check_customer['customers_firstname'];
	$customer_country_id = $check_country['entry_country_id'];
	$customer_zone_id = $check_country['entry_zone_id'];
	tep_session_register('customer_id');
	tep_session_register('customer_default_address_id');
	tep_session_register('customer_first_name');
	tep_session_register('customer_country_id');
	tep_session_register('customer_zone_id');
	tep_session_register('administrator_login');

	tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'");

// restore cart contents
	$cart->restore_contents();

	tep_redirect(MANUAL_ORDER_REDIRECT);

}
tep_redirect(tep_href_link(FILENAME_ADMIN,'','SSL'));

require(DIR_WS_INCLUDES . 'application_bottom.php'); 
?>

 

 

It looks like you added the session register stuff for SPPC on the wrong page because to me it looks like this link is really logging you in on the page defined by FILENAME_ADMIN_LOGIN:

					$search_display .= '<tr><td class="smallText"><a href="'.tep_href_link(FILENAME_ADMIN_LOGIN,'email_address='.$search_result['customers_email_address'],'SSL').'">'.$search_result['customers_email_address'].'</a></td><td class="smallText">'.$search_result['customers_firstname'].' '.$search_result['customers_lastname'].'</td><td class="smallText">'.$search_result['customers_telephone'].'</td></tr>';

Or I'm missing something :)

At least I don't see the end of link tag (< /a >).

~Tracy
 

Link to comment
Share on other sites

It looks like my question 2 days ago got buried and was missed: http://www.oscommerce.com/forums/index.php?sho...p;#entry1147796

 

I really need to know how this contribution works or if I'll need to make some changes in order to have members from each group registering and loging in directly to their group prices.

 

TIA for any clues.

Patty

Link to comment
Share on other sites

It looks like my question 2 days ago got buried and was missed:

Yep

 

I really need to know how this contribution works or if I'll need to make some changes in order to have members from each group registering and loging in directly to their group prices.

In PHP the code can always be read :)

 

This has been discussed before, but I'm not going to try to find it ;)

 

One way to solve it is to mail group A a code and group B another code (of course you can improvise on that, give them a code that starts with a common thing and after x characters an individual code, then you can find back later who used what or prevent double use of the same code). For that you add another input field in create_account.php. Then in the code that reads the POST variables to add them to the database you do your thing with the code they entered and determine in what group this customer goes. Normally no entry for the group is added to the query, it is left to the default 0 when a row is inserted, so you would need to explicitly add it to the $sql_array that is assembled before being executed on line 199 in create_account.php:

tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

The default behaviour of the SPPC version of create_account.php is to add the customer in group retail (customer group id = 0) and then the admin moves them in another group.

Link to comment
Share on other sites

This is the catalog/admin_login.php page - does it look to you like it should be here instead of (or as well as) the page I put it on?

No it should be added to this page.

Everything is working if the customer is already in the database. It only breaks if you have to create a new account. I'm wondering if this is the page it needs to be in for that purpose?

Yes, but of course sessions can be set on any page, so you could add the sppc ones earlier and the rest on another page. But that doesn't work if you do not pass the page where the sppc session variables are set.

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