Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    336
    Plugin Contributions
    0

    Default remove country dropdown

    I've been trying to find a way to remove the country dropdown from the create account and shipping address -- since we only sell to customers living in this country.

    Up until now, I just deleted all other countries from our country list. However, we need to allow the country dropdown for billing addresses, so people with foreign credit cards can still buy from us. This is absolutely necessary here.

    I know that's not normal for most shops, so I haven't been able to find info on the forums for this situation.

    My question is just -- is this possible to do?
    Currently using ZEN CART v. 1.3.6

  2. #2
    Join Date
    Nov 2004
    Posts
    77
    Plugin Contributions
    0

    Default Re: remove country dropdown

    depending on the version, you may be able to do this pretty simply by editing all your files that contain the address block

    NOTE: this is off the top of my head so be sure to BACKUP BACKUP BACKUP. Also realize that users will not be able to update there billing address, to allow them to edit there billing address's. we would need to do a bit more coding for that.

    like tpl_modules_address_book_details.php
    or tpl_modules_create_account.php

    theres plenty more obviously I dont know them all by heart so you will have to do some looking.

    I think this is for 1.3 and beyond but i am not positive, if its an earlier version i believe the equivalent of this file was located in a boxes directory.

    so, anyway making sure your following your proper override's procedure edit tpl_modules_address_book_details.php as an example of what you will need to do throughout the diffrent pages.

    find at approx line 100

    Code:
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_get_country_list('zone_country_id', $entry->fields['entry_country_id'], 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
    <br class="clearBoth" />
    and change it to

    Code:
    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY; ?></label>
    <?php echo zen_draw_hidden_field('zone_country_id', 'DEFAULT_COUNTRY_ID'); ?>
    <br class="clearBoth" />

    Now I notice in the code that you replaced between the single quotes DEFAULT_COUNTRY_ID. replace that with the id number of the country you wish to be assigned to there account. such as united states. this is the simplest method since you will find that in other files the default country id may be based on entries allready in the database, so simply replacing DEFAULT_COUNTRY_ID
    is the simplest method.

    Do this for all files that you do not want the customer to be able to edit, accept for your billing address page.


    Hope it works,

    Dan

 

 

Similar Threads

  1. v151 Shipping country dropdown
    By simon1066 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 30 Mar 2014, 11:03 AM
  2. Country Dropdown
    By trevor4370 in forum General Questions
    Replies: 1
    Last Post: 5 Jan 2009, 01:20 PM
  3. [Done v1.3.6] Country Dropdown Bug
    By zytroop in forum Bug Reports
    Replies: 60
    Last Post: 20 Jan 2007, 12:37 PM
  4. 1.36 Country Dropdown - how do I fix?
    By kimsonvu in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 19 Jan 2007, 06:25 PM
  5. Country Dropdown
    By crichw in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 4 Dec 2006, 03:28 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