Results 1 to 10 of 16

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Israel
    Posts
    285
    Plugin Contributions
    0

    Default City value of States

    Hi
    When a customer creates an account I need a pull down menu for cities.
    I can show the customer the pull down menu of the states and call it "city" but
    I need Zen to get this chosen state as a city value.
    I tried to play with the file tpl_modules_create_account.php without much success.

    Here is the original code of the city:
    Code:
    <label class="inputLabel" for="city"><?php echo ENTRY_CITY; ?></label>
    <?php echo zen_draw_input_field('city', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city" placeholder="' . ENTRY_CITY_TEXT . '"'. ((int)ENTRY_CITY_MIN_LENGTH > 0 ? '' : '')); ?>
    <br class="clearBoth" />
    And here is the original code of the states:
    Code:
    <?php
      if (ACCOUNT_STATE == 'true') {
        if ($flag_show_pulldown_states == true) {
    ?>
    <label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE; ?></label>
    <?php
          echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone"');
          if (zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert">' . ENTRY_STATE_TEXT . '</span>';
        }
    ?>
    
    <?php if ($flag_show_pulldown_states == true) { ?>
    <br class="clearBoth" id="stBreak" />
    <?php } ?>
    <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label; ?></label>
    <?php
        echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state" placeholder="' . ENTRY_STATE_TEXT . '"');
        if ($flag_show_pulldown_states == false) {
          echo zen_draw_hidden_field('zone_id', $zone_name, ' ');
        }
    ?>
    <br class="clearBoth" />

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: City value of States

    Do you need the state value to be part of the address, too? In what format is the address displayed?

  3. #3
    Join Date
    Aug 2010
    Location
    Israel
    Posts
    285
    Plugin Contributions
    0

    Default Re: City value of States

    Quote Originally Posted by lat9 View Post
    Do you need the state value to be part of the address, too? In what format is the address displayed?
    No. No need the state value.
    But I need to use the zone_id to be the "city" value.
    Here is the page link (in Hebrew).
    Instead of the text "state" I wrote "city" in Hebrew (עיר) so the customer needs to choose his city from the drop down list.
    Behind the sceen I need to get his "city" value from the state value.
    This I learnt after a customer tried to make paypal payment but paypal sent an error that the customer has no city...

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: City value of States

    @gunni, I'm still not sure what you need to do.

    Is it that you want the customer to choose a city (via the associated zone_id dropdown) and then use that city as both the city and state for the customer's address?

  5. #5
    Join Date
    Aug 2010
    Location
    Israel
    Posts
    285
    Plugin Contributions
    0

    Default Re: City value of States

    Quote Originally Posted by lat9 View Post
    @gunni, I'm still not sure what you need to do.

    Is it that you want the customer to choose a city (via the associated zone_id dropdown) and then use that city as both the city and state for the customer's address?
    No need for states.

    To make the story long:
    I have a category in the site with products that can not be shipped to some places in the country.
    They can be delivered only for some near cities.
    In order to make it happen, I put some code of Ajeh in the shipping module which says that if
    the cart contains products from category X and the shipping is to Y, then no way.
    Y is the zone_id.
    and in order to decide if the "city" is good for delivery or not, I need to know the city id and can not
    let the customer write the city as he likes. In this situation there will be too many options for same city
    (like new york or new-york etc').
    So I used the database of the states and for each "state" I put its' id number in the shipping module.
    The customer do not know that he chose a state. He thinks that he choose a city.
    I do not need the state as a state.
    The only problem is that now, I get the customer's state instead of city and paypal not accepting it.
    If I did not clear myself, please let me know.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: City value of States

    When you look at a customer's record in the admin, does it show the "City" as empty?

    Perhaps you need a small change to the "create_account" page's processing, where you use the zone_id value to look up the associated "City" and just copy that value into the customer's "City" field.

 

 

Similar Threads

  1. Replies: 2
    Last Post: 24 Nov 2012, 02:48 AM
  2. Shipping by percentage of retail value vs sale or discounted value
    By giftsandwhatnot in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 8 Aug 2011, 05:16 PM
  3. Replies: 2
    Last Post: 10 Jan 2011, 01:18 AM
  4. Replies: 4
    Last Post: 14 Jan 2009, 11:45 AM
  5. Using Value GV-mod.. entering value doesn't work
    By pixelarcher in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 6 Oct 2008, 04:58 PM

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