SMJobar Posted September 7, 2012 Share Posted September 7, 2012 (edited) The City field has stopped appearing when adding a new address (though it is okay when the user first registers their address) so because City is required, no new orders can be delivered to separate shipping addresses. This originally worked fine until I amended a country to serve as a mailing option for British Forces, and modified the address options there. I've since reset this to default, but the above error persists. I've noticed that when I try to create a new country, it first shows an address format without a city, so that might indicate where the problem is? This is currently costing my customer a lot of orders, so if someone can suggest anything, I would be extremely grateful. The version is 1.4.7.0 and the URL is http://www.bakewelltarts.co.uk/ Edited September 7, 2012 by SMJobar (see edit history) Link to comment Share on other sites More sharing options...
tomerg3 Posted September 7, 2012 Share Posted September 7, 2012 Goto Shipping->countries edit the country in question, and you will see an option to edit / add new fields (city should be available for adding. 1 Link to comment Share on other sites More sharing options...
SMJobar Posted September 7, 2012 Author Share Posted September 7, 2012 Thanks, Tomerg3, but I did that. I ensured all the country addresses I'd looked at or amended were set back to default, and they work just fine when a new user registers an address, just not when they try to add a new shipping address Link to comment Share on other sites More sharing options...
tomerg3 Posted September 7, 2012 Share Posted September 7, 2012 Are you using a custom theme? is it working if you switch to the default theme? Link to comment Share on other sites More sharing options...
SMJobar Posted September 7, 2012 Author Share Posted September 7, 2012 I'm using the default theme Link to comment Share on other sites More sharing options...
tomerg3 Posted September 7, 2012 Share Posted September 7, 2012 Quite odd, can't think of a reason off the top of my head. Did you make any changes to .tpl files or any other core files? Link to comment Share on other sites More sharing options...
SMJobar Posted September 7, 2012 Author Share Posted September 7, 2012 No. The only other thing I've modified before this error cropped up was to change the settings in the Good Relationship module. I've also been through all the files in the root and in the Prestashop theme, and none of these shows a changed date Link to comment Share on other sites More sharing options...
tomerg3 Posted September 7, 2012 Share Posted September 7, 2012 very odd, if you look at /themes/prestashop/address.tpl do you see something like <p class="required text"> <label for="city">{l s='City'}</label> <input type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'htmlall':'UTF-8'}{/if}{/if}" maxlength="64" /> <sup>*</sup> </p> Link to comment Share on other sites More sharing options...
SMJobar Posted September 7, 2012 Author Share Posted September 7, 2012 Yes, exactly the same coding. I suspect it might be something that changed in the database but I'm not familiar enough with the system to know what, if anything Link to comment Share on other sites More sharing options...
tomerg3 Posted September 7, 2012 Share Posted September 7, 2012 Try to clear the smarty cache just in case (delete everything except index.php in /tools/smarty/compile) It has nothing to do with the Database, there is no condition around that code, which means it should always display... Link to comment Share on other sites More sharing options...
SMJobar Posted September 7, 2012 Author Share Posted September 7, 2012 I've emptied tools/smarty/compile - there was no index.php in compile here - made no difference tools/smarty_V2/compile has only an index.php and nothing else Link to comment Share on other sites More sharing options...
SMJobar Posted September 7, 2012 Author Share Posted September 7, 2012 Thanks for all the help so far. I'm on UK time so will not be able to reply for a while soon. Please keep any ideas coming and I'll look into them first thing in the morning Link to comment Share on other sites More sharing options...
tomerg3 Posted September 8, 2012 Share Posted September 8, 2012 Look for a .php file that contains address.tpl in the /compile folder, and see if it has the word city (with code similar to the one pasted above) Link to comment Share on other sites More sharing options...
SMJobar Posted September 8, 2012 Author Share Posted September 8, 2012 Thanks. I've found the following: <p class="required text"> <label for="city"><?php echo smartyTranslate(array('s'=>'City'),$_smarty_tpl);?> </label> <input type="text" name="city" id="city" value="<?php if (isset($_POST['city'])){?><?php echo $_POST['city'];?> <?php }else{ ?><?php if (isset($_smarty_tpl->getVariable('address',null,true,false)->value->city)){?><?php echo smarty_modifier_escape($_smarty_tpl->getVariable('address')->value->city,'htmlall','UTF-8');?> <?php }?><?php }?>" maxlength="64" /> <sup>*</sup> </p> Link to comment Share on other sites More sharing options...
tomerg3 Posted September 8, 2012 Share Posted September 8, 2012 If I think of anything else, I'll let you know. Link to comment Share on other sites More sharing options...
El Patron Posted September 8, 2012 Share Posted September 8, 2012 "This originally worked fine until I amended a country to serve as a mailing option for British Forces, and modified the address options there. I've since reset this to default, but the above error persists." This is very odd, I took a look at your website, and no city field for any country that I tested. Do you see the 'city' in the address format for the testing or any other country? http://screencast.com/t/nIuXl0Ay If you have the experience you could try the following: access your mysql db via PHPMYADMIN -obtain a fresh copy of table address_format export your existing (yourdbprefix)_address_format (back up) empty the table address_format import the fresh copy of table address_format but basically your address_format table will look like you back office country address format data 1 Link to comment Share on other sites More sharing options...
SMJobar Posted September 8, 2012 Author Share Posted September 8, 2012 The countries are currently set to firstname lastname company vat_number address1 address2 postcode city Country:name phone but if I try to create a new country, this is what appears firstname lastname address1 address2 postcode Country:name phone I'm not used to MySQL, but suspect that might be where the problem lies, so I'll see if I can manage to follow your instructions Link to comment Share on other sites More sharing options...
SMJobar Posted September 8, 2012 Author Share Posted September 8, 2012 I've upgraded to 1.4.9 but that didn't solve it. I used MySQL Admin to upload a previous version of the address-format table which solved the City problem, and everything looked great until I tried to join as a new member and found it now didn't show a Postcode field when I tried to add an address even though it appears to be there in the Country settings. I did a complete restore of the latest backup, and the City problem is there again Link to comment Share on other sites More sharing options...
SMJobar Posted September 8, 2012 Author Share Posted September 8, 2012 Solved. Redid the restore of the address-format table AND checked I had Postcode Required selected for the UK (must have been switched during investigations). Many thanks to Tomerg3 for helping chase this down and to Elpatron for cornering it. You've saved me from an early grave. Link to comment Share on other sites More sharing options...
El Patron Posted September 8, 2012 Share Posted September 8, 2012 (edited) tomerg is a rock star...I've learned a lot from his posts Edited September 8, 2012 by elpatron (see edit history) 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