Page 1 of 2 12 LastLast
Results 1 to 10 of 259

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    I have created a supplier registration form based on this mod, where the only remaining problem is getting the Country to display as its Name rather than its Number (eg "Australia" rather than "13") after selection from the Country dropdown menu.

    Rather than post the entire files, references to Country are as follows:

    includes/modules/pages/supplier_registration/header_php.php

    Line 33
    $country = '';

    After if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
    Line 61
    $country = zen_db_prepare_input($_POST['zone_country_id']);

    After // BOF Error Messages
    Line 111
    if (!zen_not_null($country)) {
    $error = true;
    $messageStack->add('supplier_registration', 'Please select your country');
    }

    After //assemble the email contents:
    Line 203
    'country:' . "\t" . $country . "\n" .

    includes/templates/your_template/tpl_supplier_registration_default.php

    After <fieldset>
    Line 76
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" ') . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>

    What have I done wrong?

    TIA

  2. #2
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    Bump.

    While I am sure the problem lies with the zone_country_id, changing this to country_name, as well as changing numerous other variants in the code, has not yet produced the desired effect - display of country name in the email.

    I feel Wits End is fast approaching.

  3. #3
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    Bump, anyone, please!!!

  4. #4
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default How to add country dropdown that returns the country name

    Quote Originally Posted by dw08gm View Post
    I have created a supplier registration form based on this mod, where the only remaining problem is getting the Country to display as its Name rather than its Number (eg "Australia" rather than "13") after selection from the Country dropdown menu.

    Rather than post the entire files, references to Country are as follows:

    includes/modules/pages/supplier_registration/header_php.php

    Line 33
    $country = '';

    After if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
    Line 61
    $country = zen_db_prepare_input($_POST['zone_country_id']);

    After // BOF Error Messages
    Line 111
    if (!zen_not_null($country)) {
    $error = true;
    $messageStack->add('supplier_registration', 'Please select your country');
    }

    After //assemble the email contents:
    Line 203
    'country:' . "\t" . $country . "\n" .

    includes/templates/your_template/tpl_supplier_registration_default.php

    After <fieldset>
    Line 76
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" ') . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>

    What have I done wrong?

    TIA
    How to add country dropdown that returns the country name, rather than country_id number, in email forms (eg band_signup).

    Further to my posts above, I think I have a solution. Although not thoroughly tested, eg text vs html emails, the country name now appears as such in Email Archive Manager. If anyone has a better solution, please post.)

    A. In includes\functions\html_output.php, towards the end of the file and immediately before

    Code:
    /*
     * Assesses suitability for additional parameters such as rel=nofollow etc
     */
    add

    Code:
    /*
     * Creates a pull-down list of countries names (and extract country name)
     */
      function zen_get_country_listname($name, $selected = '', $parameters = '') {
        $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
        $countries = zen_get_countries();
    
        for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
          $countries_array[] = array('id' => $countries[$i]['countries_name'], 'text' => $countries[$i]['countries_name']);
        }
    
        return zen_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
      }
    Notes A:
    1. This code is a copy of the preceeding function zen_get_country_list, except 'countries_id' is replaced by 'countries_name'.
    2. There is no override for includes\functions\html_output.php, therefore upon upgrade, the new file may have to be edited accordingly.
    3. Ideally this code would be placed in either includes\modules\pages\your_page\header_php.php or includes\templates\your_template\templates\tpl_your_page_default.php, but I am unsure about the placement. Anyone?

    B. In includes\modules\pages\your_page\header_php.php, after

    Code:
      if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
    add (or change to)

    Code:
        $country = zen_db_prepare_input($_POST['countries_name']);
    C. In includes\templates\your_template\templates\tpl_your_page_default.php, amongst the list of <labels>
    add (or change to)

    Code:
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_get_country_listname('countries_name', $selected_country, 'id="country"') . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />
    Notes B and C:
    1. If adding (rather than replacing) the code from steps B and C, you will need to add the other bits of code as per the above quoted post.
    Last edited by dw08gm; 10 Nov 2009 at 02:55 PM.

  5. #5
    Join Date
    Nov 2008
    Posts
    40
    Plugin Contributions
    0

    Default I want to share my custom form with a customer upload

    I want to share my custom form with a customer upload. This custom form was made for my sellers to submit their products to us to sell.

    1. This uses a custom form created from the "band signup"
    2. A popup window created with a generator
    3. An additional program called "upload-point"
    4. Set up additional check to make sure customer uploads file
    5. It emails me that a product is submitted - but requires the customer to enter the file name.
    6. It puts the uploaded files in a folder named "files" with the original file name, not a zencart renumbered file name.
    7. The popup window asks for the file, then shows the file being uploaded, then is reported that the file has been uploaded successfully.

    Take a look creativelearnables.com/index.php?main_page=submit_product . You can try it with a small image or text file to see how it works.

    I was just so excited, I had to share.

    If anyone is interested in making a form like this, let me know.

  6. #6
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    I am interested, particularly the upload file part.

    Can only one file be uploaded per form, or can it handle multiple file uploads with (say) advice of the filenames in the comments section?

    Does it come with an auto-complete function, for those already with an account?

  7. #7
    Join Date
    Nov 2008
    Posts
    40
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Quote Originally Posted by dw08gm View Post
    I am interested, particularly the upload file part.

    Can only one file be uploaded per form, or can it handle multiple file uploads with (say) advice of the filenames in the comments section?

    Does it come with an auto-complete function, for those already with an account?
    The Upload-Point is quite cool. I changed it to only upload one file, but it is set up for 5. It also has even more options, such as allowing the customer to see their uploaded files, delete, rename, file size and other options.

    http://covertheweb.com/upload-point/

    I used this in a popup window on my custom form.

  8. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: I want to share my custom form with a customer upload

    Sounds great.. Ever give any thought of bundling this up and submitting it as a contribution or even bundling it up and posting it to this thread.. I certainly would be interested in a form like this..

  9. #9
    Join Date
    Nov 2008
    Posts
    40
    Plugin Contributions
    0

    Default Re: I want to share my custom form with a customer upload

    Quote Originally Posted by DivaVocals View Post
    Sounds great.. Ever give any thought of bundling this up and submitting it as a contribution or even bundling it up and posting it to this thread.. I certainly would be interested in a form like this..
    I will try to get it together today and post it here. I am not a php wizard to answer lots of "how it works" problems, but I can try.

    The reason I posted about it is because you see lots of people here looking for something like this and thought it might be helpful.

  10. #10
    Join Date
    Nov 2008
    Posts
    40
    Plugin Contributions
    0

    Default Re: I want to share my custom form with a customer upload

    I hope this works for everyone. Please read the READ ME FIRST file, it gives you complete directions on how to install this form and needed changes to make it work correctly.

    Since the UPLOAD-POINT file is to big for me to include in the total set up, you need to download it from here and upload it on your server first then upload my files. My files will overwrite 4 files in the "upload" folder.

    If you have questions, I am very limited in my knowledge of php, but I will try to do my best.
    Attached Files Attached Files

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. custom survey forms
    By cpk in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 2 May 2011, 05:07 PM
  2. Custom Forms
    By wwiii in forum General Questions
    Replies: 3
    Last Post: 11 May 2009, 05:51 PM
  3. Customer's seeing other users' data in forms
    By erikcw in forum General Questions
    Replies: 5
    Last Post: 30 Jan 2008, 11:30 PM
  4. Custom Collection of Attribute Data
    By Fastcar in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2008, 01:01 PM
  5. Custom Forms - Help?
    By TurtleDove in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 9 Jun 2006, 02:46 AM

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