yebberdog Posted July 22, 2009 Share Posted July 22, 2009 I have recently installed the UK address module to change the layout and format of both the invoice and delivery address. part of this module adds another field "county" to the address table in the database. I am trying to change change the address layout / format in the various email confirmation html files, however Icannot seem to find where the variable / tags which are passed to the email htmp file are propagated from. For example in the order confirmation email there is a field "invoice_postal_code" where does this come from, which file.I assumed that by simply adding "{invoice_county}" to the html file, it would pull from the database the correct value for "county".Any help would be greatly welcomed as this is the only area of modification that I seem to be having problems with.Many thanks Link to comment Share on other sites More sharing options...
glosticks Posted July 22, 2009 Share Posted July 22, 2009 dont know if this will help but try {invoice_state) Link to comment Share on other sites More sharing options...
yebberdog Posted July 23, 2009 Author Share Posted July 23, 2009 Thanks, for your reply. However I do not think this will work as the field I created through myphpadmin is "county", which has been intergrated and working in all the associated address and order files. I just cannot see how to link this field to the order confirmation email html file nor can I see where other tags such as invoice_postal_code are derived from or which associated files create this variable and pass it to the email file.Again any help would be very appreciated as I have spent hours trying to work this out and I am sure to a seasoned programmer that this is probably quite basic.Again thank you for any advice.Best regards Link to comment Share on other sites More sharing options...
glosticks Posted July 23, 2009 Share Posted July 23, 2009 Have not had a chance to look at the UK mod as. I modify my site without adding an extra field into the database, but have a look at /classes/address.php Link to comment Share on other sites More sharing options...
yebberdog Posted July 24, 2009 Author Share Posted July 24, 2009 Thanks for the input, I have worked out that all emails and associated variables are passed from the mailalerts module to the associated html files in the mail directory. The problem is that even if I add the following code:'{delivery_county}' => $delivery->county,'{invoice_county}' => $invoice->county,It is not being passed the the orderconf htmlf using the tag {invoice_county}I just cannot work it out, this is the only problem I am having with Prestshop, which appart from the need to re-format that address to UK format is an excellent package. I know this is all down to my lack of programming experiance, but it is very fundimental for our market.Again any help will be greatly appreciated.Many thanks Link to comment Share on other sites More sharing options...
glosticks Posted July 24, 2009 Share Posted July 24, 2009 I think mail alerts only, sends emails for products out of stock and new orders to the store ownerthese are the only templates in that folder Link to comment Share on other sites More sharing options...
yebberdog Posted July 24, 2009 Author Share Posted July 24, 2009 Hi ChrisHaving checked through the html file in the mail directory they cover virtually everything from product out of stock to customer order confirmation. Thats right both customer and admin side based on settings. Still stuck however getting county to register on the customer order confirmation email, guess its time to get the php book out and spend some time on it. This really is a bit of a joke, all I want to do is change the default address layout so that it suits the UK. This is such a simple task on ZenCart that I am considering moving back, however I like the simplicity and small size of Prestashop, as it is ideal for clients who want a simple ecommerce solution. Shame Never mind Link to comment Share on other sites More sharing options...
glosticks Posted July 24, 2009 Share Posted July 24, 2009 I think a lot of the problem is caused by the actual Uk conversion, I found their is no need for the extra field to be added to the database, you are far better adding the UK countys as zones via the BO, and they just appear as the Sames as the states in the US, then its only a matter of rearrranging a few lines of coderegardsChris Link to comment Share on other sites More sharing options...
yebberdog Posted July 24, 2009 Author Share Posted July 24, 2009 Hi GlostickNice site by the way. I agree, I have been thinking exactly this, it was just the thought of adding all the counties to the database as you have done which put me off. However as the state is fully established throughout Prestashop and it is a simple matter of changing the code to get the correct format, i finally agree and will be updating the code to reflect this. However I will need to create an SQL file to update the database as I certainly cannot be bothered entering every county through the BO for each client I create a ecommerce site for.Again, thank you for your input.RegardsJason Link to comment Share on other sites More sharing options...
glosticks Posted July 25, 2009 Share Posted July 25, 2009 What I do is create a new zone for the UK just called Ukthen edit the countries and move the UK to that zonethen generally create another zone called eec and move all the eec countries to that zone, I find it makes it easier for tax and shipping calculations,then import this file via phpmyadminyou might have to edit depending of the ID of your UK zone ukcounties.csv Link to comment Share on other sites More sharing options...
yebberdog Posted July 25, 2009 Author Share Posted July 25, 2009 Hi ChrisThank you very much for the file, you have saved me a lot of time, you are very kind. I am going to start from scratch and follow your approach, however along the way I will modify all code to suit the UK format, including PDF's and Email hopefully. If all is OK I will bundle all the files together and post on forum, as I feel that this may be a problem for other UK users.Again, thank you for the information and file.Best regardsJason Link to comment Share on other sites More sharing options...
glosticks Posted July 25, 2009 Share Posted July 25, 2009 what version are you working with, as I think I have done most of the work already Link to comment Share on other sites More sharing options...
yebberdog Posted July 26, 2009 Author Share Posted July 26, 2009 Hi ChrisThat would be great, thanks. I am using Prestashop 1.1.0.5, its the latest download.Thanks again.RegardsJason Link to comment Share on other sites More sharing options...
jhnstcks Posted July 28, 2009 Share Posted July 28, 2009 The problem with doing this is that when you offer worldwide delivery like I do, you would have to go through and add states/counties for every country in the world, which is a lot of work.Adding the new sql field for counties is a lot quicker. Link to comment Share on other sites More sharing options...
yebberdog Posted July 28, 2009 Author Share Posted July 28, 2009 Hi jhnstcksYou are correct, I guess it depends on your own circumstances. My company mainly deal in Europe, so I have created states for the UK and grouped all EEC countries into one zone for shipping. I like the idea and proceeded with the additional SQL field, however I was getting bogged down with changing all the other files and email html. Unfortinately my php leaves a lot to be desired.Best regardsJason Link to comment Share on other sites More sharing options...
jhnstcks Posted July 29, 2009 Share Posted July 29, 2009 My company mainly deal in Europe, so I have created states for the UK and grouped all EEC countries into one zone for shipping. What happens for all the european states and counties? Link to comment Share on other sites More sharing options...
yebberdog Posted July 29, 2009 Author Share Posted July 29, 2009 All the EU countries are grouped into the zone "Europe" and the states are turned off for all EU countries. I find that customers not presented with a state field just simple add the state onto the city field, not ideal I know. However I have always in the past used Zencart and never had this problem before, so with this new site I am really just evaluating a live site as I really like Prestashop and really want to solve this. Looking at Zen Cart it addresses the problem by leaving the state field empty if the country has no states set, while if it does then it populates this field with a drop down. It may therefore be worthwhile looking to have the state field active even if there are no states defined in the country, however I am not sure how to do this currently. I do however agree that the thought of adding states to every country is a real pain and if I could code better I would deffinetly run with your option and add a county to the mysql database. However trying to pass the county field through mailalert.php and to the html files has given me problems and I have already had a customer who on receiving the email thought that she had entered the address wrong.Best regardsJason Link to comment Share on other sites More sharing options...
glosticks Posted July 29, 2009 Share Posted July 29, 2009 I must be missing something here, why to you have to add states for all european countries,, The USA is already prepopulated, all I have done is populate the UK Link to comment Share on other sites More sharing options...
glosticks Posted July 29, 2009 Share Posted July 29, 2009 I remember something eles I have always altered on Carts, I always move the country fields to the top, making it the first field to be completed,Have a look at the authenticion.php on safety-glow.co.uk, doing it this way means that once the country field is populated the state field either disappears or is populated Link to comment Share on other sites More sharing options...
jhnstcks Posted July 29, 2009 Share Posted July 29, 2009 Because european countries also have states/counties not just USA and UK Link to comment Share on other sites More sharing options...
yebberdog Posted August 4, 2009 Author Share Posted August 4, 2009 I guess it would be great if like Zen Cart the state field could be completed by the customer should the countries states have not been added to the database. Unfortinately in Presta shop the state field vanishes if the country has no states and the customer does not have the opertunity to add something to this field. Then there is the problem of address format, which unfortinately is not the same as UK format. I know this can be changed by altering the associated files, but then this means that European customers then have the wrong address format.For testing Prestashop I am going to just consider the UK, but I know clients will like to open up other markets. Link to comment Share on other sites More sharing options...
Recommended Posts