Add Tax ID Field Onto Wholesale Form

The site builder system does not allow a store administrator to add additional fields to the wholesale form. You can use this quick customization to add a field onto the wholesale vendor's address field. In this example, we're adding the Tax ID field to the application:

VERSION 2.8x:

  1. Open the wholesale.php page in the /enc/ folder.

  2. Find the line:

    $req_wspass = "";

    and underneath, add:

    $web_taxid = "";
  3. Find the line:

    $fieldarr = array('req_company' => 'Company', 'req_website' => 'Web Site', 'req_email' => 'Email Address', 'req_address' => 'Address', 'req_password' => 'Password', 'req_repass' => 'Re-enter'); // fields/labels

    and change this to:

    $fieldarr = array('req_company' => 'Company', 'req_website' => 'Web Site', 'req_email' => 'Email Address', 'req_address' => 'Address', 'req_password' => 'Password', 'req_repass' => 'Re-enter', 'web_taxid' => 'Tax ID'); // fields/labels
  4. Find the line:
    $insquery = "INSERT INTO " ...

    and just above this line, add:

    if (!empty($web_taxid))
    $req_address .= "rnTax ID: " .$web_taxid;
  5. Find the lines:

    
    Email Address:
     
    
    
  6. and just below it, add:

    
    Tax ID:
     
    
    
  7. (Optional) To make this a required fields, replace every instance of 'web_taxid' with 'req_taxid' in the above modification. (This includes changing $web_taxid to $req_taxid)

VERSION 2.7x:

  1. Open the wholesale.php page in the /enc/ folder.

  2. Find the line:

    $stripaddress = pullspam(stripbadstuff($_POST['addressinfo']), "body", "strip", "yes");

    and underneath, add:

    if (!empty($_POST[taxid]))
    $stripaddress .= " Tax ID: " .pullspam(stripbadstuff($_POST['taxid']), "body", "strip", "yes");
  3. Just under that, find the line:

    $addaddress = addslash_mq(pullspam(stripbadstuff($_POST['addressinfo']), "body", "add", "yes"));

    and underneath, add:

    if (!empty($_POST[taxid]))
    $addaddress .= " Tax ID: " .addslash_mq(pullspam(stripbadstuff($_POST['taxid']), "body", "add", "yes"));
  4. Find the lines:

    
    Email Address:
    
    
    
  5. and just below it, add:

    
    Tax ID:
    
    
    
  6. (Optional) To make this a required fields, just above the line:

    $addaddress = addslash_mq(pullspam(stripbadstuff($_POST['addressinfo']), "body", "add", "yes"));

    add:

    if (empty($_POST['taxid']))
    die("Please enter your Tax ID.");

VERSION 2.55:

  1. Open the wholesale.php page in the /enc/ folder.

  2. Find the line:

    $addaddress = addslash_mq(stripbadstuff($_POST['addressinfo']));

    and underneath, add:

    if (!empty($_POST[taxid]))
    $addaddress .= " Tax ID: " .addslash_mq(stripbadstuff($_POST['taxid']));
  3. Just under that, find the line:

    $stripaddress = stripslashes(stripbadstuff($_POST['addressinfo']));

    and underneath, add:

    if (!empty($_POST[taxid]))
    $stripaddress .= " Tax ID: " .stripslashes(stripbadstuff($_POST['taxid']));
  4. Find the lines:

    
    Email Address:
     
    
    
    

    and just below it, add:

    
    Tax ID:
     
    
    
    
  5. (Optional) To make this a required fields, just above the line:

    $addaddress = addslash_mq(stripbadstuff($_POST['addressinfo']));

    add:

    if (empty($_POST['taxid']))
    die("Please enter your Tax ID.");

Now when a vendor applies to sell items wholesale, their tax ID will be appended to the bottom of the address field. You can do the same thing for any additional fields as needed - just repeat the above steps, changing taxid to some other value, and Tax ID to some other text.