howardliptzin Posted December 19, 2023 Share Posted December 19, 2023 Hello, I am running PS 1.6.1.7 and recently discovered that when new customers register their addresses, the country pull down menu is blank. There's nothing to choose from. Something got corrupted or changed, because it used to work just fine. In the Localization tab in the back office, all countries are properly activated. When I go to the configuration page, the only notes I see are listed below. I have no idea if any of these are relevant. Can anyone help? Any suggestions? THANKS! Missing files (1) admin3348/filemanager/uploader/success.php Updated files (5) admin3348/ajax.php admin3348/autoupgrade/index.php admin3348/themes/default/template/controllers/products/helpers/form/form.tpl controllers/admin/AdminAccessController.php controllers/front/ContactController.php Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 19, 2023 Share Posted December 19, 2023 Did you specifically test the order page and the country drop-down is not working? Link to comment Share on other sites More sharing options...
howardliptzin Posted December 19, 2023 Author Share Posted December 19, 2023 Yes, exactly. I even turned off the address option in initial registration and the same thing happened on the address creation form later on. Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 19, 2023 Share Posted December 19, 2023 To make sure it isn't cause by a module would suggest to disable all 3-rd party modules and check if it happens the same. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 19, 2023 Share Posted December 19, 2023 Try clearing the shop cache. This can remove outdated data that might be causing the issue. Temporarily disable any recently installed or updated modules to see if any of them conflict with the country selection. Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 19, 2023 Share Posted December 19, 2023 @PrestaServicePro Is your service repeating the previous post? Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 19, 2023 Share Posted December 19, 2023 32 minutes ago, QuickUpdate.net said: @PrestaServicePro Is your service repeating the previous post? Ok, disabling modules was mentioned earlier, it's a common troubleshooting step for various issues in PrestaShop. and recommended cache clearing too. so I think it is not a repetition. Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 19, 2023 Share Posted December 19, 2023 @PrestaServicePro insulting anyone in the forum reading his post... "so I think it is not a repetition." 🤯 Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 19, 2023 Share Posted December 19, 2023 @QuickUpdate.netfocus on solving the missing country dropdown issue. Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 19, 2023 Share Posted December 19, 2023 @PrestaServicePro is thinking they are now in charge of telling us what we should do 🤯 Link to comment Share on other sites More sharing options...
howardliptzin Posted December 19, 2023 Author Share Posted December 19, 2023 I disabled modules, cleared the prestashop cache and the browser, logged out, logged back in and still the problem persists. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 20, 2023 Share Posted December 20, 2023 12 hours ago, howardliptzin said: I disabled modules, cleared the prestashop cache and the browser, logged out, logged back in and still the problem persists. 1) Open the root/controllers/front/addresscontroller.php file. Search for n assignCountries See if it's there. 2) In the path root/override/controllers/front/addresscontroller.php if there is a file like this, rename it, then clear the cache and check again in private browser mode. Link to comment Share on other sites More sharing options...
howardliptzin Posted December 20, 2023 Author Share Posted December 20, 2023 (1) In root/controllers/front/addresscontroller.php file I found the assignCountries section (pasted in below). (2) The file addresscontroller.php does NOT exist in the path root/override/controllers/front/addresscontroller.php Here is the code: protected function assignCountries() { $this->id_country = (int)Tools::getCountry($this->_address); // Generate countries list if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) { $countries = Carrier::getDeliveredCountries($this->context->language->id, true, true); } else { $countries = Country::getCountries($this->context->language->id, true); } // @todo use helper $list = ''; foreach ($countries as $country) { $selected = ((int)$country['id_country'] === $this->id_country) ? ' selected="selected"' : ''; $list .= '<option value="'.(int)$country['id_country'].'"'.$selected.'>'.htmlentities($country['name'], ENT_COMPAT, 'UTF-8').'</option>'; } // Assign vars $this->context->smarty->assign(array( 'countries_list' => $list, 'countries' => $countries, 'sl_country' => (int)$this->id_country, )); } /** * Assign template vars related to address format */ (2) Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 20, 2023 Share Posted December 20, 2023 Look the countries are assigned to the $list variable, you should try to print this and check if it contains anything, if not switch the line: "if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {" to "if (!Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {" (notice the !) and print again - if it contains anything goo then the configuration "PS_RESTRICT_DELIVERED_COUNTRIES" is the problem otherwise it's somewhere else Link to comment Share on other sites More sharing options...
howardliptzin Posted December 20, 2023 Author Share Posted December 20, 2023 Hello, thanks for the info, but I do not fully understand the instructions. You wrote: Quote Look the countries are assigned to the $list variable, you should try to print this and check if it contains anything, if not switch the line: I do not understand what you mean by "try to print this". Print the code on paper? Why do I have to print and not just read the file on the screen? And then -- what do you mean if it contains ANYTHING? What do you mean by ANYTHING!? Please explain this again in other words or with more detail. THANKS! Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 20, 2023 Share Posted December 20, 2023 Change the following line in your file: "if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {" -> to "if (!Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {" (notice the ! near the first paranthesis that is the change you need to make), after that reload you shop and check if it works Link to comment Share on other sites More sharing options...
howardliptzin Posted December 20, 2023 Author Share Posted December 20, 2023 OK, will try and let you know, merci grazie gracias! Link to comment Share on other sites More sharing options...
howardliptzin Posted December 20, 2023 Author Share Posted December 20, 2023 Hey it worked!! THANKS FOR YOUR HELP. 😃 But now I notice a few more things wrong. (I don't know what happened to "break" the site...) (1) The "State" pull down has the same problem. (2) I do not see any Zip Code field. (3) Whenever I login as a customer on the front end, when I click on the add address link the page refreshes to an address form without full header or footer of the site. When i click to go back to the home I just see blank white page with just the logo. When I clear the browser's cache, the site is back again, but if I login again and try insert an address the same thing happens over and over again. It would be great if you or someone out there could help me again. -H Link to comment Share on other sites More sharing options...
howardliptzin Posted December 21, 2023 Author Share Posted December 21, 2023 Should I open a new topic for each of these problems? Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 21, 2023 Share Posted December 21, 2023 The code change was to check what might be the problem - not to remain like that, you need to change the code back to how it was, but basically you know that "PS_RESTRICT_DELIVERED_COUNTRIES" is the issue so you need to find in the back office where the setting for restricted countries is and enable available countries from there. Link to comment Share on other sites More sharing options...
howardliptzin Posted December 21, 2023 Author Share Posted December 21, 2023 ah ok, that makes sense. Any ideas for the States problem? Same issue. Link to comment Share on other sites More sharing options...
QuickUpdate.net Posted December 21, 2023 Share Posted December 21, 2023 Probably same cause - look into your settings where you find some kind of *country restrictions / enabled countries* and check if all is ok there - most likely in regionalization and / or shop settings (btw it doesn't mean that the settings are incorrect also, it might also be a Prestashop issue but in that case it is much harder to investigate and or resolve) Link to comment Share on other sites More sharing options...
howardliptzin Posted December 21, 2023 Author Share Posted December 21, 2023 thanks, I've already checked all the country settings in the entire localization section, and there are no relevant restrictions. I guess it's a prestashop problem. I've contacted a developer on Upwork to help. 😮 Thanks for your help, I appreciate it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now