Results 1 to 10 of 491

Threaded View

  1. #11
    Join Date
    May 2008
    Location
    South Australia
    Posts
    86
    Plugin Contributions
    1

    Idea or Suggestion Re: Additional Customers Fields

    assuming you have followed the installation instructions and merged all needed files, finished the installation to be left broken, try this:


    Step 1: add missing table fields:



    that should fix ur mysql errors so u can atleast look at tha admin cfg page. now u can use the "Add Customer Fields" link.

    go in there and create your new fields, starting with just one called test_field (VARCHAR) to begin, (get the system working first)


    this will add the new fields to your db tables, but u still need to setup your forms:

    Step 2: add new fields to your admin customer pages:


    editing additional_customer_fields.php at the bottom allows you to specify the new fields you have and the style/size etc that they are presented with in your admin customers pages.


    by default youll have one named test_field, as a textarea box, this will line up with the test_field varchar we just created in step 1. so u can later once we get this one working add all types of inputs.

    heres mine as example:

    this gives a basic rectangular textarea box
    PHP Code:
    $additional_customers_fields_form_textarea_title['test_field'] = array('Company Details: ');

    $additional_customers_fields_form_textarea_length['test_field'] = array("50""70""5"); 
    this gives a two choice radio button
    PHP Code:
    $additional_customers_fields_form_radio_title['test_field2'] = array("Apply for Wholesale: ");

    $additional_customers_fields_form_radio_content['test_field2'] = array("Yes""No"); 
    you can see more examples commented out in that file

    at this stage you should be able to go to your customer pages, and see at the bottom your new fields

    Step 3: add new create <INPUT> fields:


    now for the fun bit, u can do this for both edit and create forms, i just did create, as the field data i was collecting i didnt need edited later...

    the file we begin with is tpl_modules_create_account.php and it will have a demo field called "test_field" (labeled as email address for some reason)

    at this point you can actually test the system and it should work, you should have an extra field in your create account form (labelled wrongly) but it should work, save the input and show it in the admin section for that customer.

    but your going to want to customize it so here mine as example: (this is just the section to edit near the bottom of the file:

    also note this isnt the simplest example, as it has javascript to enable/disable the textarea input box depending on the radio buttom choice :)

    hopefully it can show you what to do, otherwise just ask.

    PHP Code:
    <?php

    // Additional customers fields.

    if ($customersFields->countFields() > 0) {

        



            
    ?>

    <SCRIPT TYPE="text/javascript">

    <!--

    function whole(status)

    {

        

    if(status){

    document.getElementById("test_field").style.background='white';

    document.getElementById("wyes").checked = true

    document.getElementById('test_field').focus()

    }

    else{

    document.getElementById("test_field").style.background='#BDBDBD';    

    document.getElementById("test_field").value=''    ;

    }



    }

    //-->

    </SCRIPT>

            

            <fieldset>

            <legend>Request Wholesale:</legend><br />

            <?php echo 

            

            
    zen_draw_radio_field('test_field2''2','1' ,'id="wno" onClick="whole(0)"') . 

            

            
    '<label class="radioButtonLabel" for="email-format-html">No</label>' 

            

             
    zen_draw_radio_field('test_field2''1','' 'id="wyes" onClick="whole(1)"') .

             

              
    '<label class="radioButtonLabel" for="email-format-text">Yes</label>';

              

               
    ?>

              <br />

              

    <br class="clearBoth" />

            

            

            

            <label class="inputLabel" for="test_field">Company Details:</label>

            <?php echo zen_draw_textarea_field('test_field'205''' id="test_field" onClick="whole(1)" style="width: 400px; margin-left:130px;background-color:#BDBDBD"' ); ?>

            <br class="clearBoth" /></fieldset>

            <?php

        
    }   



    // End of additional customers fields.

    ?>
    Step 4: add new edit <INPUT> fields:


    as i mentioned earlier the xtra content im collecting doesnt need to be edited or viewd by the customer after submission so i removed the fields in tpl_account_edit_default.php , if u want them edit as needed , i imagine in a similar fashion to how we just did in step 4.


    good luck, (theres likely something i missed, so just let me know when it doesnt work)

    hayden.

    (merry christmas)

    additional admin fields: ("Add Customer Fields" page)

    --------------
    additional admin customer fields:

    --------------
    additional db fields (added by the admin forms)

    ---------------
    additional customer account creation inputs:
    Last edited by hayden; 25 Dec 2008 at 02:16 AM.

 

 

Similar Threads

  1. Additional Customers Fields
    By mizio78 in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 12 Aug 2011, 09:27 AM
  2. Additional Customers Fields Addon SQL problem
    By Dasha in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Sep 2008, 05:41 PM
  3. Additional customers fields v2-55 Question
    By balonglong78 in forum General Questions
    Replies: 0
    Last Post: 26 May 2008, 04:04 AM
  4. Need help installing "additional customers fields" module
    By CKlemow in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 1 Sep 2007, 03:22 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR