Jump to content

country ID required


Recommended Posts

Hi,

I am new to prestashop and encountered a problem:

- when I try to add a new address I get an error "country ID required" but the country field doesn't exist (not need)

- if I try to add in Localizations>Countries field Country:name and save, this field doesn't appear in Address form and in Localizations>Countries line is modified and appear Country?

 

i have prestashop 15.2.0.

Thanks.

Link to comment
Share on other sites

when I try to add a new address I get an error "country ID required" but the country field doesn't exist (not need)

 

There must be a country associated with every address. Country ID is a required field by PrestaShop, it cannot be eliminated. There should be a country field in the form displayed when you add a new address. If not, there is something wrong with your installation. Did you upgrade from an earlier version?

 

if I try to add in Localizations>Countries field Country:name and save, this field doesn't appear in Address form

 

Fields you add/remove there are for invoices etc where an address is displayed, does not reflect which fields will appear in the registration forms.

 

Marty Shue

Link to comment
Share on other sites

There must be a country associated with every address. Country ID is a required field by PrestaShop, it cannot be eliminated. There should be a country field in the form displayed when you add a new address. If not, there is something wrong with your installation. Did you upgrade from an earlier version?

 

no is fresh install , I had installed before 1.5.1.0 and same error, so it must be a problem with server config but meets, the requirements

 

Web server: Apache 1.3, Apache 2.x, Nginx or Microsoft IIS

PHP 5.1+ installed and enabled

MySQL 5.0+ installed with a database created

Link to comment
Share on other sites

  • 3 months later...

I had the same problem.

It's generated by value "Country?" in Admin > Localization > Countries > Edit (any country) > Address format.

 

There are two possible solutions (tested in version 1.5.3.1):

 

1)

For each country, change the part of value in the parameter Address format from "Country?" to "country?" (change only the first character to lowercase).

 

2)

Make the change in classes/AddressFormat.php in function getOrderedAddressFields.

 

Find the row:

$out[] = trim($word_item);

 

... and change it to:

$out[] = strtolower(trim($word_item));

 

 

That's all, enjoy ;-)

Edited by Já (see edit history)
Link to comment
Share on other sites

For Prestashop 1.5.3! With the Guest checkout disabled, and process of checkout in single page.

 

I've tryed the method described bellow, but without success, otherwise I've made for me to have country_id and City to be hidden values. Those who want to know how I did it - follow these steps:

1. in "themes/prestashop/css/order-opc.css" add at the bottom this line:

#center_column #new_account_form p.hidden {visibility:hidden;}

 

2. In the "themes/prestashop/order-opc-new-account.tpl" faind and comment out the lines from number 223 to 228 (there is a <select> tag) instead of this, right before the commented <select> strarts, insert new line and write this

<input type="hidden" name="id_country" id="id_country" value="147">

of course change 147 to your Country ID, that you can find in admin > Localization > Countries.

 

after that add the class "hidden" to the line #221 made it like this

<p class="required select hidden">

 

3. Go with this steps for the field "city" and add there in "value" - your city - to be like: value="Ohio".

 

That worked for me, after close to 6 hours of researching in google :) well, hope you'll find it quite usefull.

Edited by vally7 (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
×
×
  • Create New...