Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

about user account activation Rate Topic   - - - - -

 
  • staright
  • Member
  • Members
  • Join Date: 11-Jul 08
  • 119 posts

Posted 15 August 2008 - 04:00 PM #1

Hi.

I wondering, is it possible?
I have a two customer, retail and whosale.
CS cart only can be activate to the all customer

"Administrator must activate new user accounts"

but i want to apply to wholsale customer only.

is it available?

 
  • Guest_dab_*
  • Guests

Posted 30 September 2008 - 08:33 AM #2

In order to automatically activate only your wholesale membership accounts you should replace the following part of code in the "fn_users.php" file located in the "core" directory of your CS-cart installation:
	if (AREA == 'C') {
		$_data['membership_status'] = 'P';
	}
with this one:
	if (AREA == 'C') {
		if ($_data['membership_id'] == 'YOUR_WHOLESALE_MEMBERSHIP_ID') {
			$_data['membership_status'] = 'A';    
		} else {
			$_data['membership_status'] = 'P';
		}
	}
where "YOUR_WHOLESALE_MEMBERSHIP_ID" is the id of your wholesale membership.
I hope that will help.

 
  • mdekok3000
  • Senior Member
  • Members
  • Join Date: 06-Feb 08
  • 883 posts

Posted 02 October 2008 - 01:58 PM #3

If you don't know what your wholesale membership id is then look in your cscart_membership_descriptions table.
[SIZE=2]
[/SIZE]

 

Posted 11 October 2008 - 05:19 PM #4

A couple questions if I may... your adjustment would automatically activate Wholesale accounts, but require manual activation of non-wholesale accounts. Correct? And if so, you could just reverse it to automatically activate all accountes EXCEPT wholesale.

Do you need to have "Administrator must activate new user accounts" turned on or off for this to work?

Thanks for the help.

JB
1.3.5 about to make the switch...
Free Shipping + Real Time Shipping Mod

 
  • mdekok3000
  • Senior Member
  • Members
  • Join Date: 06-Feb 08
  • 883 posts

Posted 13 October 2008 - 09:46 PM #5

Yes to the first question. Just switch the "P" and "A".
[SIZE=2]
[/SIZE]

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 31 March 2009 - 04:56 PM #6

cscart_membership_descriptions table

Where would I find this please? Is this an id specific to each cscart install or something ...its not an individual member id is it.

Thanks
Paul

 
  • WebGuy
  • Senior Member
  • Members
  • Join Date: 02-Dec 08
  • 419 posts

Posted 31 March 2009 - 05:09 PM #7

cscart_membership_descriptions table

Where would I find this please? Is this an id specific to each cscart install or something ...its not an individual member id is it.


This is in reference to your cs-cart database. You can find this using phpMyAdmin.
Once you have phpMyAdmin open you can scroll down to the cscart_membership_descriptions table...highlight the table and click "browse" to see the membership descriptions which include the ID.
WebGuy
www.nutraceaonline.com
CS-CART VERSION: 1.3.5 SP4

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 31 March 2009 - 10:16 PM #8

Thanks webguy found it now, the only other thing that wasn't answered above

Do you need to have "Administrator must activate new user accounts" turned on or off for this to work?

Paul

 
  • WebGuy
  • Senior Member
  • Members
  • Join Date: 02-Dec 08
  • 419 posts

Posted 31 March 2009 - 10:22 PM #9

I really don't know that answer to that one...but it would be easy just to try both ways and see which one works. :cool:
WebGuy
www.nutraceaonline.com
CS-CART VERSION: 1.3.5 SP4

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 31 March 2009 - 10:37 PM #10

Doesn't seem to work on either setting, turn on admin needs to approve and both need approval, here's the code, maybe I did something wrong.

// Get all memberships list
//
function fn_get_memberships($only_avail = '', $lang_code = '')
{
global $db_tables, $cart_language;

if (empty($lang_code)) {
$lang_code = $cart_language;
}

if (AREA == 'C') {
if ($_data['membership_id'] == '3') {
$_data['membership_status'] = 'p';
} else {
$_data['membership_status'] = 'a';
}
}

 
  • WebGuy
  • Senior Member
  • Members
  • Join Date: 02-Dec 08
  • 419 posts

Posted 31 March 2009 - 10:48 PM #11

I'm just guessing here as there are others who would know for sure..
But it might be your "p" and "a" are lowercase...I believe they need to be UPPER.
WebGuy
www.nutraceaonline.com
CS-CART VERSION: 1.3.5 SP4

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 31 March 2009 - 11:01 PM #12

Ok tried changing then but still no good, if you have "Administrator must activate new user accounts" ticked it blocks both, if you un tick it both can register without authorization, must have something else wrong somewhere I guess.

 
  • WebGuy
  • Senior Member
  • Members
  • Join Date: 02-Dec 08
  • 419 posts

Posted 31 March 2009 - 11:03 PM #13

Yeah, sorry I don't have time to take a look at it right now...maybe someone else will post. If I can get to it I'll post what I find.
WebGuy
www.nutraceaonline.com
CS-CART VERSION: 1.3.5 SP4

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 31 March 2009 - 11:11 PM #14

Ok thanks for your help

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 31 March 2009 - 11:21 PM #15

What does the "P" mean ... in the next line of code there is a B but not P

return db_get_array("SELECT a.membership_id, a.avail, a.type, b.membership FROM $db_tables[memberships] as a LEFT JOIN $db_tables[membership_descriptions] as b ON b.membership_id=a.membership_id AND b.lang_code='$lang_code' WHERE 1 $only_avail ORDER BY membership");

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 01 April 2009 - 12:30 AM #16

Had put code in the wrong place, found the right place around line 291 but still not working when testing it.

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 01 April 2009 - 12:44 AM #17

just noticed in fn_user.php there are a few red symbols in front of $user_data and where ever that appears, is this normal php code or a bug?

@$user_data

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 06 April 2009 - 01:28 PM #18

Bumping this as still can't get it to work, anyone any ideas what I am doing wrong please, really need to get it to work

Thanks in advance

Paul

 
  • quantex
  • Member
  • Members
  • Join Date: 28-Apr 07
  • 94 posts

Posted 08 April 2009 - 09:14 AM #19

Is there no one that can help here?

Paul

 
  • WebGuy
  • Senior Member
  • Members
  • Join Date: 02-Dec 08
  • 419 posts

Posted 08 April 2009 - 02:48 PM #20

It's too hard to say what could be wrong.
It might be you have a skin that this code doesn't work with.
It could be that code was for a certain version and you are using a different version.
It could be that some changes have been made since that code was released.

If you've double-checked and triple checked your code and it still isn't working then it probably needs some other code to get it to work properly, if at all.

Looking at your code, it doesn't look like you've made the correct replacement:

// Get all memberships list
//
function fn_get_memberships($only_avail = '', $lang_code = '')
{
global $db_tables, $cart_language;

if (empty($lang_code)) {
$lang_code = $cart_language;
}

if (AREA == 'C') {
if ($_data['membership_id'] == '3') {
$_data['membership_status'] = 'p';
} else {
$_data['membership_status'] = 'a';
}
}


MY CODE:

//
// Get all memberships list
//
function fn_get_memberships($type, $lang_code = '')
{
global $db_tables, $cart_language;

if (empty($lang_code)) {
$lang_code = $cart_language;
}

$where = " a.avail='Y'";

if ($type == 'C' || AREA == 'C') {
$where .= " AND type='C'";
}
elseif ($type == 'A') {
$where .= " AND type='A'";
}


Now if you scroll further down from this part of code you will see the code that needs to be replaced as specified in the original post:

In order to automatically activate only your wholesale membership accounts you should replace the following part of code in the "fn_users.php" file located in the "core" directory of your CS-cart installation:

Code:
if (AREA == 'C') {
$_data['membership_status'] = 'P';
}with this one:


Code:
if (AREA == 'C') {
if ($_data['membership_id'] == 'YOUR_WHOLESALE_MEMBERSHIP_ID') {
$_data['membership_status'] = 'A';
} else {
$_data['membership_status'] = 'P';
}
}where "YOUR_WHOLESALE_MEMBERSHIP_ID" is the id of your wholesale membership.


So maybe you've still replaced the wrong code?
Like I said it's kind of hard to tell...and could be a number of things.
WebGuy
www.nutraceaonline.com
CS-CART VERSION: 1.3.5 SP4