Jump to content

Help customising email html files


Recommended Posts

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

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

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

Hi Chris

Having 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

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 code


regards


Chris

Link to comment
Share on other sites

Hi Glostick

Nice 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.

Regards

Jason

Link to comment
Share on other sites

What I do is create a new zone for the UK just called Uk

then edit the countries and move the UK to that zone

then 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 phpmyadmin


you might have to edit depending of the ID of your UK zone

ukcounties.csv

Link to comment
Share on other sites

Hi Chris

Thank 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 regards


Jason

Link to comment
Share on other sites

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

Hi jhnstcks

You 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 regards

Jason

Link to comment
Share on other sites

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 regards

Jason

Link to comment
Share on other sites

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

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

×
×
  • Create New...