Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    84
    Plugin Contributions
    0

    Default Re: Customer Authorization Status Question??

    Also upgraded

    Zen Cart 1.3.0.2
    Database Patch Level: 1.3.0.2

    Still only emails when i make an acount pending - NOT when I approve an account.

    Any suggestions?

  2. #12
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Customer Authorization Status Question??

    sounds like you've implemented it incorrectly

    post the first 75 lines of your /admin/customers.php file
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #13
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    84
    Plugin Contributions
    0

    Default Re: Customer Authorization Status Question??

    Code:
    require('includes/application_top.php');
    
      require(DIR_WS_CLASSES . 'currencies.php');
      $currencies = new currencies();
    
      $action = (isset($_GET['action']) ? $_GET['action'] : '');
    
      $error = false;
      $processed = false;
    
      if (zen_not_null($action)) {
        switch ($action) {
          case 'status': 
      $customers_id = zen_db_prepare_input($_GET['cID']); 
            if ($_GET['current'] == CUSTOMERS_APPROVAL_AUTHORIZATION) { 
              $sql = "update " . TABLE_CUSTOMERS . " set customers_authorization=0 where customers_id='" . (int)$customers_id . "'"; 
            } else { 
              $custinfo = $db->Execute("select customers_email_address, customers_firstname, customers_lastname 
                                        from " . TABLE_CUSTOMERS . " 
                                        where customers_id = '" . (int)$customers_id . "'"); 
              if ($custinfo->RecordCount() > 0) { 
                $message = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE; 
                $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE ; 
                zen_mail($custinfo->fields['customers_firstname'] . ' ' . $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT , $message, STORE_NAME, EMAIL_FROM, $html_msg, 'default'); 
              } 
              $sql = "update " . TABLE_CUSTOMERS . " set customers_authorization='" . CUSTOMERS_APPROVAL_AUTHORIZATION . "' where customers_id='" . $customers_id . "'"; 
            } 
            $db->Execute($sql); 
            $action = ''; 
            zen_redirect(zen_href_link(FILENAME_CUSTOMERS, 'cID=' . (int)$customers_id . '&page=' . $_GET['page'], 'NONSSL')); 
            break;  
    
          case 'update':
            $customers_id = zen_db_prepare_input($_GET['cID']);
            $customers_firstname = zen_db_prepare_input($_POST['customers_firstname']);
            $customers_lastname = zen_db_prepare_input($_POST['customers_lastname']);
            $customers_email_address = zen_db_prepare_input($_POST['customers_email_address']);
            $customers_telephone = zen_db_prepare_input($_POST['customers_telephone']);
            $customers_fax = zen_db_prepare_input($_POST['customers_fax']);
            $customers_newsletter = zen_db_prepare_input($_POST['customers_newsletter']);
            $customers_group_pricing = zen_db_prepare_input($_POST['customers_group_pricing']);
            $customers_email_format = zen_db_prepare_input($_POST['customers_email_format']);
            $customers_gender = zen_db_prepare_input($_POST['customers_gender']);
            $customers_dob = (empty($_POST['customers_dob']) ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_db_prepare_input($_POST['customers_dob']));
    		$customers_whole = zen_db_prepare_input($_POST['customers_whole']);
            $customers_authorization = zen_db_prepare_input($_POST['customers_authorization']);
            $customers_referral= zen_db_prepare_input($_POST['customers_referral']);
    
            if (CUSTOMERS_APPROVAL_AUTHORIZATION == 2 and $customers_authorization == 1) {
              $customers_authorization = 2;
              $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION2, 'caution');
            }
    
            if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 and $customers_authorization == 2) {
              $customers_authorization = 1;
              $messageStack->add_session(ERROR_CUSTOMER_APPROVAL_CORRECTION1, 'caution');
            }

  4. #14
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Customer Authorization Status Question??

    hmmm ... that same code works perfectly for me... granted, my testing was with approvals set to "not required".
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #15
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    84
    Plugin Contributions
    0

    Default Re: Customer Authorization Status Question??

    Quote Originally Posted by DrByte
    hmmm ... that same code works perfectly for me... granted, my testing was with approvals set to "not required".

    Thas is weird - well maybe this is a bug in the code. There is NO point in sending an approval email for someone who is already automatically approved.

    Seems just like a silly thing where it is working but only if making somebody who is already approved to pending status. Maybe just a sloppy if statement. who knows?

  6. #16
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Customer Authorization Status Question??

    aha ... the problem was in the testing ... yes, the IF is backwards and incomplete.

    here's the fix:

    PHP Code:
          case 'status':
            if (
    $_GET['current'] == CUSTOMERS_APPROVAL_AUTHORIZATION) {
              
    $sql "update " TABLE_CUSTOMERS " set customers_authorization=0 where customers_id='" . (int)$customers_id "'";
              
    $custinfo $db->Execute("select customers_email_address, customers_firstname, customers_lastname
                                        from " 
    TABLE_CUSTOMERS "
                                        where customers_id = '" 
    . (int)$customers_id "'");
              if ((int)
    CUSTOMERS_APPROVAL_AUTHORIZATION && (int)$_GET['current'] > && $custinfo->RecordCount() > 0) {
                
    $message EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE;
                
    $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE ;
                
    zen_mail($custinfo->fields['customers_firstname'] . ' ' $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT $messageSTORE_NAMEEMAIL_FROM$html_msg'default');
              }
            } else {
              
    $sql "update " TABLE_CUSTOMERS " set customers_authorization='" CUSTOMERS_APPROVAL_AUTHORIZATION "' where customers_id='" $customers_id "'";
            }
            
    $db->Execute($sql);
            
    $action '';
            
    zen_redirect(zen_href_link(FILENAME_CUSTOMERS'cID=' . (int)$customers_id '&page=' $_GET['page'], 'NONSSL'));
            break; 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #17
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    84
    Plugin Contributions
    0

    Default Re: Customer Authorization Status Question??

    I just replaced my code witht his and now when i shange the status of a customer it just takes me to the last page of my customers - it doesnt update theor status or send an email.


    Quote Originally Posted by DrByte
    aha ... the problem was in the testing ... yes, the IF is backwards and incomplete.

    here's the fix:

    PHP Code:
          case 'status':
            if (
    $_GET['current'] == CUSTOMERS_APPROVAL_AUTHORIZATION) {
              
    $sql "update " TABLE_CUSTOMERS " set customers_authorization=0 where customers_id='" . (int)$customers_id "'";
              
    $custinfo $db->Execute("select customers_email_address, customers_firstname, customers_lastname
                                        from " 
    TABLE_CUSTOMERS "
                                        where customers_id = '" 
    . (int)$customers_id "'");
              if ((int)
    CUSTOMERS_APPROVAL_AUTHORIZATION && (int)$_GET['current'] > && $custinfo->RecordCount() > 0) {
                
    $message EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE;
                
    $html_msg['EMAIL_MESSAGE_HTML'] = EMAIL_CUSTOMER_STATUS_CHANGE_MESSAGE ;
                
    zen_mail($custinfo->fields['customers_firstname'] . ' ' $custinfo->fields['customers_lastname'], $custinfo->fields['customers_email_address'], EMAIL_CUSTOMER_STATUS_CHANGE_SUBJECT $messageSTORE_NAMEEMAIL_FROM$html_msg'default');
              }
            } else {
              
    $sql "update " TABLE_CUSTOMERS " set customers_authorization='" CUSTOMERS_APPROVAL_AUTHORIZATION "' where customers_id='" $customers_id "'";
            }
            
    $db->Execute($sql);
            
    $action '';
            
    zen_redirect(zen_href_link(FILENAME_CUSTOMERS'cID=' . (int)$customers_id '&page=' $_GET['page'], 'NONSSL'));
            break; 

  8. #18
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Customer Authorization Status Question??

    argh -- still need to set the $customers_id:

    Code:
          case 'status': 
      $customers_id = zen_db_prepare_input($_GET['cID']); 
    .......
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. question about customer authorization..
    By sidewing in forum General Questions
    Replies: 2
    Last Post: 6 Nov 2010, 04:44 AM
  2. Changing Customer Authorization Status
    By freefire in forum Customization from the Admin
    Replies: 7
    Last Post: 11 Apr 2010, 11:31 PM
  3. Customer Approval Status - Authorization Pending
    By teamzr1 in forum General Questions
    Replies: 2
    Last Post: 17 Feb 2010, 01:41 AM
  4. Customer Authorization Status - Not Working?
    By Beeunique in forum Managing Customers and Orders
    Replies: 12
    Last Post: 1 Apr 2009, 10:02 AM
  5. Problem with Customer authorization/shop status
    By SoftCorpse in forum General Questions
    Replies: 3
    Last Post: 8 Jul 2006, 07:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg