Forums / Managing Customers and Orders / Customers authorization status

Customers authorization status

Results 1 to 20 of 20
28 Oct 2014, 10:01
#1
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Posts:
162
Plugin Contributions:
0

Customers authorization status

Setting a customer's status e.g. "Pending approval - may browse no prices" doesn't seem to affect anything
Is there another switch in admin that I need to set?


thanks


Derek
28 Oct 2014, 13:00
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Customers authorization status

Check your settings in Configuration ... Customer Details ...
Customer Shop Status - View Shop and Prices
Customer must be approved to shop
0= Not required
1= Must login to browse
2= May browse but no prices unless logged in
3= Showroom Only



Customer Approval Status - Authorization Pending
Customer must be Authorized to shop
0= Not required
1= Must be Authorized to Browse
2= May browse but no prices unless Authorized
3= Customer May Browse and May see Prices but Must be Authorized to Buy
28 Oct 2014, 19:44
#3
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Posts:
162
Plugin Contributions:
0

Re: Customers authorization status

many thanks Linda - I was not aware of that switch!!
28 Oct 2014, 19:45
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Customers authorization status

Not a problem ... I do like to make those things ... :cool:
29 Oct 2014, 07:49
#5
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Posts:
162
Plugin Contributions:
0

Re: Customers authorization status

I still seem to have a problem:

My client wants to let people register a new account as normal and automatically become approved, purchase and buy goods.

He would also like then the option of changing a customer's status to say:
Customer May Browse and May see Prices but Must be Authorized to Buy

where he has a dispute with the customer
I've tried setting this option for a dummy customer but it doesn't seem to work - the add to cart button is still active
I am a bit confused as to the combination of admin switches needed for this process


please help

Derek
29 Oct 2014, 18:01
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Customers authorization status

You need to do some customization to have a new account be set to Authorized but still be able to change that after the fact and be able to change it while a customer is logged in so that the next click will reflect the change ...

Edit the file:
/includes/modules/create_account.php

and add the code in RED around line 69:
  $fax = zen_db_prepare_input($_POST['fax']);
// bof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved
//  $customers_authorization = CUSTOMERS_APPROVAL_AUTHORIZATION;
  $customers_authorization = 0;
// eof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved
  $customers_referral = zen_db_prepare_input($_POST['customers_referral']);


around line 260 or so:
                            'customers_default_address_id' => 0,
                            'customers_password' => zen_encrypt_password($password),
// bof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved
//                            'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
                            'customers_authorization' => (int)$customers_authorization
// eof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved
    );


/includes/init_includes/init_customer_autho.php
/**
 * recheck customer status for authorization
 */
// bof: override CUSTOMERS_APPROVAL_AUTHORIZATION check approval each click
//if (CUSTOMERS_APPROVAL_AUTHORIZATION > 0 && ($_SESSION['customer_id'] != '' and $_SESSION['customers_authorization'] != '0')) {
if ($_SESSION['customer_id'] != '') {
// eof: override CUSTOMERS_APPROVAL_AUTHORIZATION check approval each click
  $check_customer_query = "select customers_id, customers_authorization


and see if that works better for you ...
30 Oct 2014, 19:39
#7
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Posts:
162
Plugin Contributions:
0

Re: Customers authorization status

many thanks Linda for taking the time and trouble to code this.
I thought it would be a simple option of changing the customer authorisation status using the customer admin section.

The site in question is busy at the moment but when I have the chance to implement these changes I'll report back to you

best regards



Derek
01 Nov 2014, 08:32
#8
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Posts:
162
Plugin Contributions:
0

Re: Customers authorization status

Hi Linda

I tried inserting your mods into the the two files and uploaded but it doesn't seem to have made any difference.

I logged in with my dummy account and set the customer authorisation status to
Pending approval - may browse no prices
but all the prices were still there as well as add to cart buttons


best regards



Derek
01 Nov 2014, 13:18
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Customers authorization status

Make sure the 2 settings in post#2 are set to 2 ...

Go to your store as a guest, and everything should be:
Price Unavailable
APPROVAL PENDING

Make sure your test account is set to Green for Authorized, and then login ... you should see Prices and Add to Cart features ...

Now, in your Admin, click the Green icon on your test account customer and it will turn Red ... in the store click a link and everything should change back to:
Price Unavailable
APPROVAL PENDING

Then in the Admin, click the Red icon on your test customer so it turns Green and in the store click a link and you should see should Prices and Add to Cart features ...
05 Nov 2014, 07:25
#10
derek_bryant avatar

derek_bryant

Zen Follower

Join Date:
Jul 2008
Posts:
162
Plugin Contributions:
0

Re: Customers authorization status

thanks Linda

As I understand it, this would mean that by setting those options to 2:
2= May browse but no prices unless logged in
2= May browse but no prices unless Authorized

All visitors would have to register to see prices and then wait for authorisation from admin if new
My client prefers new visitors and registered customers to be able to browse and see prices and fill a shopping basket and then checkout either by creating a new customer account or by direct paypal etc.

Is this possible?

thanks



Derek
05 Nov 2014, 14:37
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Customers authorization status

Let me re-think this for what changes are required ... I will try to look at it this afternoon or tonight ...
08 Nov 2014, 16:45
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Customers authorization status

See if this works for you ...

Set both of those settings back to 0 ...

Then change the code in these files with the code in RED ...

/includes/init_includes/init_customer_auth.php

Around line 39:
// bof: block customers
if (true || $_SESSION['customer_id'] != '') {
// eof: block customers


around line 113:
  case (STORE_STATUS != 0):
    break;
// bof: block customers
  case ($_SESSION['customers_authorization'] > '0'):
  if (!in_array($_GET['main_page'], array(FILENAME_LOGIN, FILENAME_LOGOFF, FILENAME_CONTACT_US, FILENAME_PRIVACY))) {
    if ($_GET['main_page'] != CUSTOMERS_AUTHORIZATION_FILENAME) {
      zen_session_destroy();
      zen_redirect(zen_href_link(FILENAME_LOGOFF, $logoff_lang));
    }
  }
  break;
// eof: block customers
  case (CUSTOMERS_APPROVAL_AUTHORIZATION == '1' and $_SESSION['customer_id'] == ''):


/includes/functions/functions_prices.php

around line 159:
      switch (true) {
// bof: block customers
        case ($_SESSION['customers_authorization'] > '0'):
        // customer must be logged in to browse
        return TEXT_AUTHORIZATION_PENDING_PRICE;
        break;
// eof: block customers
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):


/includes/functions/functions_general.php

around line 1087:
      switch (true) {
// bof: block customers
        case ($_SESSION['customers_authorization'] > '0'):
        // customer must be logged in to browse
        return TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE;
        break;
// eof: block customers
        case (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == ''):


See if this works better for you ...
15 Dec 2017, 20:29
#13
gerrim avatar

gerrim

New Zenner

Join Date:
Jul 2013
Posts:
39
Plugin Contributions:
0

Re: Customers authorization status

Ajeh:

You need to do some customization to have a new account be set to Authorized but still be able to change that after the fact and be able to change it while a customer is logged in so that the next click will reflect the change ...

Edit the file:
/includes/modules/create_account.php

and add the code in RED around line 69:
  $fax = zen_db_prepare_input($_POST['fax']);
// bof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved
[B]//[/B]  $customers_authorization = CUSTOMERS_APPROVAL_AUTHORIZATION;
 $customers_authorization = 0;
[B]// eof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved[/B]
 $customers_referral = zen_db_prepare_input($_POST['customers_referral']);


around line 260 or so:
                            'customers_default_address_id' => 0,
                            'customers_password' => zen_encrypt_password($password),
// bof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved
[B]//[/B]                            'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
                           'customers_authorization' => (int)$customers_authorization
[B]// eof: override CUSTOMERS_APPROVAL_AUTHORIZATION and set to 0 for approved[/B]
   );

....


I know it’s been a long time since this thread was active but I'm hoping Ajeh, or someone else, can to help me with the code changes need for ZC 1.5.5e to achieve either:
  1. ideally, the proposed solution above, or
  2. at the very least, have customers who register to shop automatically authorized to buy and so can shop immediately instead of needing to wait until we manually approve them to shop.


I couldn't progress past step 1 of Ajeh's recommended changes (thanks for those - this is the closest solution I've been able to find yet) since my ZCv1.5.5e version of that create_account.php file looks quite different from step 2 code. BTW, none of my plug-ins have amended the /includes/modules/create_account.php file.

My current admin settings:
Customer Shop Status - View Shop and Prices = 0
Customer Approval Status - Authorization Pending = 3

The 2[SUP]nd[/SUP] setting is needed (as far as my research as shown) because:
  • The website’s default display prices need to include the local Aussie tax (GST) by law;
  • I need to know a customer’s address (i.e. they need to log in) before prices can be changed before purchase if they ship outside AUS
  • The normal delay before we manually give authorization will, I suspect, result in lost customers who get frustrated that they’ve registered but still can’t shop immediately.


My current system:
  • Zen Cart v1.5.5e
  • local WAMP + SSL (apache 2.4.23; mysql 5.7.14; php 5.6.25) – expect to go live in early 2018
  • Plugins:
    [LIST]
  • Clone of Responsive Sheffield Blue v2.0 (amended for compatibility with ZC1.5.5)
  • One Page Checkout v1.4.1
  • Direct Bank Deposit V1.5.3-revised; Australia Post Shipping Module v2.2.1
  • Image Handler v5.0.0Beta4, Database I/O v1.4.0, backup_mysql_plugin_v5c; Product Images on Invoice, Email v1.1; Ckeditor v3.7;
  • Super Orders v4.0.10, Edit Orders v4.3.0, Ty Package Tracker v3.1.5
  • Sales Report v3.2.0

[/LIST]

Thanks in advance. Zen Cart rocks!
17 Dec 2017, 08:37
#14
gerrim avatar

gerrim

New Zenner

Join Date:
Jul 2013
Posts:
39
Plugin Contributions:
0

Re: Customers authorization status

After lots more searching, I think I may have found the answer.

In case it helps others...to make it so that a new account is set to Authorized as default (a solution for ZCv1.5.5e):


  1. Make a copy of \includes\modules\create_account.php in \includes\modules\YOUR-TEMPLATE\ create_account.php (or amend the second one if it is created already
  2. At about line 277, comment out the existing line (1st line below) and replace it with the 2nd line below:


//   array('fieldName'=>'customers_authorization', 'value'=>$customers_authorization, 'type'=>'integer'),
      array('fieldName'=>'customers_authorization',  'value'=> 0, 'type'=>'integer'),


Any customer's status can then be manually changed at any later time via ADMIN>Customers>Customers and either changing the Authorized status from a green tick to a red cross - or editing the Customers Authorization Status from 'Approved' to another setting as required.

If I'm mistaken or there's a better way to do it, please let me know.

Thanks
Cheers...Gerri
17 Dec 2017, 08:47
#15
gerrim avatar

gerrim

New Zenner

Join Date:
Jul 2013
Posts:
39
Plugin Contributions:
0

Re: Customers authorization status

And thanks to Dr Byte who pointed me in the right direction, way back when, in post #2 here.
09 Apr 2021, 18:29
#16
chrx avatar

chrx

New Zenner

Join Date:
Aug 2005
Posts:
84
Plugin Contributions:
0

Re: Customers authorization status

Hello,

I am setting up a new store in v1.5.7c, with a B2B environment and will manually approve registration requests as they come in. That functionality works well at this point, but I am wondering how I might be able to trigger an automatic notification email once the registration is approved in the admin. Any suggestions are appreciated.

Cheers, chrx
09 Apr 2021, 18:51
#17
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Posts:
1,745
Plugin Contributions:
17

Re: Customers authorization status

If I remember correctly, the email notification is triggered only when you approve the account by using the red/green status icon in the customer listing, but it does NOT trigger if you edit a customer and then change status on the edit page.
09 Apr 2021, 19:18
#18
chrx avatar

chrx

New Zenner

Join Date:
Aug 2005
Posts:
84
Plugin Contributions:
0

Re: Customers authorization status

Thank you balihr! And thank you as well, for your initial advise on all of this.

I ran another registration test right after posting this question and just figured that out. On my initial tests, I was using the *Customers Authorization Status* pull-down within the specific Customers info page to revise the status and found there was no notification sent. Just on a whim I tried clicking the red *Authorized* icon on the Customers list page and that triggered the notification email. Perfect!
11 Jun 2021, 16:34
#19
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Posts:
166
Plugin Contributions:
0

Re: Customers authorization status

157C, clone a template, SiteMapXML v4.0.0
I had a customer that was able to purchase erroneously with a New Zealand address, but marked as United States (our store default). I was able to change the "Customers Authorization Status" with the pull down, but had to click the "update" button twice before selection took effect.
11 Jun 2021, 16:44
#20
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Posts:
166
Plugin Contributions:
0

Re: Customers authorization status

VDecalS:

157C, clone a template, SiteMapXML v4.0.0
I had a customer that was able to purchase erroneously with a New Zealand address, but marked as United States (our store default). I was able to change the "Customers Authorization Status" with the pull down, but had to click the "update" button twice before selection took effect.


.. I've now changed my CUTOMER DETAILS, "Create Account Default Country ID" to NONE. Now customer can see right away when I do not ship to them if not in the drop-down.