Results 1 to 3 of 3
  1. #1

    help question Customer Approval based on Referral Code Input

    Is there a way I can set the default approval status to 'Authorization Pending' and allow customers to be automatically authorized if they input a specific Referral Code during account sign up? Any code modification is fine, but I am not a programmer so it would need to be somewhat explicit. Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Customer Approval based on Referral Code Input

    This is just a quick short reply to get you started in a logical direction in a way that prevents you having to alter any core code.

    1. Write an observer class to monitor the 'NOTIFY_LOGIN_SUCCESS_VIA_CREATE_ACCOUNT' notifier point
    2. The update() method should read the customers table for the customers_referral value of the record for the customers_id which matches $_SESSION['customers_id']
    3. Then, if the referral code is "valid for an upgrade", it needs to update that record of the database with the new customers_authorization number, and set the $_SESSION['customers_authorization'] value to the new authorization number too.

    That's it.

    Ya, I know, technical. But that's the outline of what to do.
    .

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

    Idea or Suggestion Re: Customer Approval based on Referral Code Input

    Actually, I was able to do it by adding a line to create_account.php file, but I do know this is not the most secure way to do it (where BLABLABLA is the referral code):
    PHP Code:
        if ($customers_referral == 'BLABLABLA')
          
    $sql_data_array['customers_authorization'] = '0'
    lol. Well, it did work :) I'll admit I have some C++ and Java knowledge from HS and a college class or two but that's it.

 

 

Similar Threads

  1. Display Model based on Account Approval
    By zstar in forum General Questions
    Replies: 4
    Last Post: 18 Feb 2011, 03:15 PM
  2. Replies: 0
    Last Post: 14 Feb 2010, 10:25 PM
  3. Code: is customer member of discount group? - restricting view based on membership
    By wputler in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 8
    Last Post: 20 Feb 2009, 08:43 PM
  4. Customer Referral Code questions
    By Rasyr in forum General Questions
    Replies: 0
    Last Post: 11 Oct 2008, 09:39 PM
  5. Restrict Customer Registration Based on Zip Code
    By sghill in forum Managing Customers and Orders
    Replies: 4
    Last Post: 29 Mar 2008, 06:23 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