Zen Cart Logo
Forums / Basic Configuration / remove country dropdown

remove country dropdown

Locked

Views: 2,386

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
8 Nov 2006, 11:15 PM
#1
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

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?

9 Nov 2006, 12:54 AM
#2
igd avatar

igd

New Zenner

Join Date:
Nov 2004
Posts:
76
Plugin Contributions:
0

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

<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

<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