Page 46 of 50 FirstFirst ... 364445464748 ... LastLast
Results 451 to 460 of 491
  1. #451
    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.

  2. #452
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: Additional Customers Fields

    Just tried the 3-0 version of this mod, I was able to get the test_field operating as a text field without problems. Has anyone been able to create a drop down menu with this?

    I understand all of the changes needed except the code that goes on the template pages:
    tpl_account_edit_default.php
    tpl_modules_create_account.php

    I read through every post in this branch and tried the following:
    Code:
    // We now set up an additional customer field for sales representative.
    if (isset($account->fields['field_name']) && $account->fields['field_name'] == "test_field") {
    echo add_customers_fields_for_create_account('test_field', 'zen_draw_pull_down_menu');
    } // End of additional customers fields for ages.
    nothing shows up
    do you have to hard code the values in these pages? I thought that's what the 'additional_customer_fields.php' page was for...to store the values...?

    Ideally I would like to pull the values from another custom table. These values would be charities that customers can choose and proceeds from their purchases will go to their selected organization.

    any advice would be greatly appreciated

  3. #453
    Join Date
    Sep 2007
    Posts
    18
    Plugin Contributions
    0

    Default Re: Additional Customers Fields

    follow up:

    I was able to get a functioning custom customer drop down with this code in the tpl files
    Code:
    // Additional Customers fields.***************************************
    if ($customersFields->countFields() > 0) {
        if ($customersFields->isActive('test_field')) {
    		$selected = $account->fields['test_field'];
    		
    		$pulldown_query = "select organization_id, name from organizations where status_id = 2 order by name";
      }
    
      $pulldown = $db->Execute($pulldown_query);
    
      if ($pulldown->RecordCount()>0) {
        $number_of_rows = $pulldown->RecordCount()+1;
    
    // Display a list
        $pulldown_array = array();
        if (!isset($_GET['orgainization_id']) || $_GET['organization_id'] == '' ) {
          $pulldown_array[] = array('id' => '', 'text' => PULL_DOWN_ALL);
        } else {
          $pulldown_array[] = array('id' => '', 'text' => PULL_DOWN_ORGANIZATIONS);
        }
    
        while (!$pulldown->EOF) {
          
          $pulldown_array[] = array('id' => $pulldown->fields['organization_id'], 'text' => $pulldown->fields['name']);
    
          $pulldown->MoveNext();
        }
        ?>    
            <fieldset>
            	<legend>Select an organization</legend>
                Choose the organization you would like to support with your purchases.<br />
            <?php echo zen_draw_pull_down_menu('test_field', $pulldown_array, $selected, 'id="select-org"'); ?>
            </fieldset>    
        <?php    
        }
    }
    // End of additional customers fields.********************************
    there is probably a better way to do it but it works for me

  4. #454
    Join Date
    Feb 2009
    Posts
    50
    Plugin Contributions
    0

    Default Re: Additional Customers Fields

    I am uploading Additional Customers Fields v3.0 as a new install. The instructions indicate to upload the following file into my zen cart shopping cart:

    includes/languages/english/additional_customers_field.php

    but that file is not in the v3.0 add-on files I downloaded...?

    Files with the same name are located in other folders in the v3.0 download:

    admin/includes/functions/extra_functions/
    admin/includes/languages/english/
    admin/includes/languages/english/Extra_definitions/

    I have downloaded them as the instructions indicate. Is there an error in the Additional Custormers Field v3.0 instructions regarding the file that they indicate is located at includes/languages/english/additional_customers_field.php?

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

    Default Re: Additional Customers Fields

    hows it going anyone still having troubles ??

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

    Default Re: Additional Customers Fields

    i should just add that step 2 refers to the additional_customers_fields.php file located in \admin\includes\languages\english\extra_definitions

  7. #457
    Join Date
    Feb 2009
    Posts
    50
    Plugin Contributions
    0

    Default Re: Additional Customers Fields

    Hayden!

    Thank you So, So, So VERY MUCH for the offline support you have given me!!! You really hung in there with me - was extremely patient, and put in a lot of time. The additional fields add-on is now Finally working perfectly!!

    You are Terrific and an extremely valuable resource!!

    My best to you,
    Anita

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

    Default Re: Additional Customers Fields

    :) , thats ok, you deserve some credit too for sticking it out when it didnt work straight away.

  9. #459
    Join Date
    Jan 2009
    Location
    Charlottesville, VA
    Posts
    51
    Plugin Contributions
    0

    Default Re: Additional Customers Fields

    Quote Originally Posted by hayden View Post
    hows it going anyone still having troubles ??
    Yeah, this guy.

    I have followed the instructions as supplied in the mod (using the v3.0 and I am getting a fatal error referencing class.base.php being defined already, on the customer side. I have the admin side working, to my knowledge. Any thoughts?

    Thanks,
    Frank

  10. #460
    Join Date
    Jan 2009
    Location
    Charlottesville, VA
    Posts
    51
    Plugin Contributions
    0

    Default Re: Additional Customers Fields

    By the way, I believe the following query will get you a working table with all the fields included:

    Code:
    CREATE TABLE IF NOT EXISTS `zen_customers_additional` (
      `field_id` int(11) NOT NULL AUTO_INCREMENT,
      `field_name` varchar(255) NOT NULL DEFAULT '',
      `field_status` char(2) NOT NULL DEFAULT '',
      `field_date` date NOT NULL,
      `field_required` int(11) NOT NULL,
      `use_url` varchar(255) NOT NULL,
      `field_url` varchar(255) NOT NULL,
      `field_url_name` varchar(255) NOT NULL,
      PRIMARY KEY (`field_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    This uses the zen_ table prefix; you may need to adjust this or remove it if you don't use table prefixes. Also, this inserts the whole table. If you already inserted the 3 fields the instructions specify, you'll want to drop the table, then use this.

    Frank

 

 
Page 46 of 50 FirstFirst ... 364445464748 ... LastLast

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