Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    186
    Plugin Contributions
    0

    Default Add Customers From Admin - default country

    I love the add customers from admin module by Rick Riehle but I was wondering if I can set the default country to United States in stead of being alphabetically listed. I searched cut can not seem to find posts addressing this.

    thanks,
    Marc

  2. #2
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Add Customers From Admin - default country

    Quote Originally Posted by tat2nu View Post
    I love the add customers from admin module by Rick Riehle but I was wondering if I can set the default country to United States in stead of being alphabetically listed. I searched cut can not seem to find posts addressing this.

    thanks,
    Marc
    I want to do the same. I think we need to adjust something on these lines:

    Code:
    if ($error == true) {
        if ($entry_country_error == true) {
          echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR;
        } else {
          echo zen_get_country_name($cInfo->entry_country_id) . zen_draw_hidden_field('entry_country_id');
        }
      } else {
        echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id);
      }
    But I can not figure it out. I successfully set this up for the account creation page, but now I forgot how I did it. Maybe someone else can help on this?

  3. #3
    Join Date
    Aug 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: Add Customers From Admin - default country

    Hey guys,
    I wanted to do the same, and I couldn't find it anywhere, so I went on a hunt.

    Anyways,

    File: /admin/includes/functions/general.php

    Look for the function zen_get_countries

    And here is how it should look like

    PHP Code:
      function zen_get_countries($default '') {
        global 
    $db;
        
    $countries_array = array();
        if (
    $default) {
          
    $countries_array[] = array('id' => '',
                                     
    'text' => $default);
        }
        
    $countries $db->Execute("select countries_id, countries_name
                                   from " 
    TABLE_COUNTRIES " WHERE countries_id!='223'
                                   order by countries_name"
    );

        
    $countries_array[] = array('id' => '223',
                                   
    'text' => 'United States');
        while (!
    $countries->EOF) {
          
    $countries_array[] = array('id' => $countries->fields['countries_id'],
                                     
    'text' => $countries->fields['countries_name']);
          
    $countries->MoveNext();
        }

        return 
    $countries_array;
      } 
    Hope that helps
    =]

 

 

Similar Threads

  1. v150 Add customers from Admin
    By logic1 in forum Customization from the Admin
    Replies: 9
    Last Post: 28 Aug 2015, 07:08 AM
  2. v150 Add Customers from Admin
    By elepepe in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 Jul 2012, 08:59 AM
  3. How do I set default country when using Add Customers via Admin addon?
    By Andy_GS in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 21 Apr 2009, 09:40 AM
  4. Add Customers from Admin
    By stevebrett in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 16 Mar 2009, 05:39 PM
  5. Add Customers from Admin
    By bigbadboy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 Apr 2008, 02:42 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