Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

& in firm name when & is pressent


stClem

Recommended Posts

One simple way to fix the problem is to activate html emails.

 

Open admin control panel > configuration > e-mail options...

Use MIME HTML When Sending Emails set to "true".

 

also make the following change

in catalog/checkout_process.php

 

find:

 

EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .

 

change to:

 

EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL') . "'>Click Here</a> (Requires Login)\n" .

Link to comment
Share on other sites

The issues are different, it is how the information is handled. The issue with invoice pdf is located within the file catalog/admin/invoice_pdf.php

 

but I am not familiar enough with what needs changing in that file to give you advise. Perhaps someone else will know here.

Link to comment
Share on other sites

Obviously, at some point the "&" is changed to "&" in anticipation of this string (the company name) being displayed on a web page. Probably an htmlspecialchars() call. This is of course unnecessary for non-HTML emails, PDF invoices, etc.

 

The first thing would be to determine whether the name is stored in the database with & or with &. Go into phpMyAdmin and browse various customer-related tables, such as "customers" and "orders", to see if & has already been changed there. If not, knowing which table(s) and field(s) it is, we will need to track down what code is calling htmlspecialchars() on it, unnecessarily for email and invoices. Then figure out whether this call can be removed, or needs a "guard" such that it only converts if the data is to be displayed in HTML.

 

If the data comes out of the database already converted to &, or it's too difficult to guard the htmlspecialchars() call, we could wait until we're within the (non-HTML) email and PDF invoice routines, and then do a simple string replace (str_replace() call) to change & back to &. At the same time, <, >, ", and other entities could be replaced by regular text. There is a call htmlspecialchars_decode() to do this, but it requires PHP 5.1 or higher.

Link to comment
Share on other sites

hi, thanks. Checked the database in phpmyadmin. Stored as & in both address_book and orders.

 

Remember that the original Packing slip is correct with &.

Its the confirmation mails and the pdf invoice/packing slip who is with &

Link to comment
Share on other sites

I gave you the fix for the confirmation emails, which I tested myself and it works. If you follow that information I posted, you will have fixed at least one of the issues. The pdf invoice file is different I do not know what it would take to fix that.

Link to comment
Share on other sites

One simple way to fix the problem is to activate html emails.

 

Open admin control panel > configuration > e-mail options...

Use MIME HTML When Sending Emails set to "true".

 

 

 

Yes, i know, this works for the mail. Didnt even need to change the catalog/checkout_process.php

Link to comment
Share on other sites

You should make the changes in catalog/checkout_process.php so that your customer can click the link provided in the email confirmation to view their order. The way the file is by default will only allow the link to be clickable if the email is plain text. In html emails, the link needs to be an html link. The changes that I posted will resolve that issue as well for you. As for the pdf invoice, I wish that I could help, but I am not familiar with that contibution or how it functions. Best of luck.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...