Hi opencart support,
Opencart version: Version 1.4.9.1 (upgraded)
The store name I'm working with is 'D & T Health', which works fine almost everywhere in Opencart.
However the ampersand is getting displayed as & in the subject and the from section of any emails being sent. The content in the email is fine, and displays the ampersand correctly.
I noticed there was a fix for this a while ago, and it seems to be in the new version of opencart, which I have.
Any hint on what I should be doing to get it to display correctly?
Thanks for you help.
Cheers,
Louise
Opencart version: Version 1.4.9.1 (upgraded)
The store name I'm working with is 'D & T Health', which works fine almost everywhere in Opencart.
However the ampersand is getting displayed as & in the subject and the from section of any emails being sent. The content in the email is fine, and displays the ampersand correctly.
I noticed there was a fix for this a while ago, and it seems to be in the new version of opencart, which I have.
Any hint on what I should be doing to get it to display correctly?
Thanks for you help.
Cheers,
Louise
This is an old post, I know, but I was trying to find a solution to this problem through search and couldn't, not on these forums or searching Google for "opencart, ampersand", etc. There are plenty of companies out there that have ampersands in their names, and so this could be of help.
Note: I am not a programmer, and I figured out a fix for this on my own through quick experimentation and logic. I am fairly positive it isn't the BEST one, but, since I don't know how to really code PHP, I can't offer a better one. I just know it works.
The hackish fix is to use str_replace to convert the "& amp ;" to just &.
Open:
catalog/model/checkout/order.php
Scroll to around line 356, or do a Find for $mail->setSender
change this line to:
I did the same thing for the Subject, on the very next line, since it was doing the amp thing there too:
This may be fixed in the latest version of OpenCart, I dunno. Just thought I'd throw it out there.
Note: I am not a programmer, and I figured out a fix for this on my own through quick experimentation and logic. I am fairly positive it isn't the BEST one, but, since I don't know how to really code PHP, I can't offer a better one. I just know it works.
The hackish fix is to use str_replace to convert the "& amp ;" to just &.
Open:
catalog/model/checkout/order.php
Scroll to around line 356, or do a Find for $mail->setSender
change this line to:
Code: Select all
$mail->setSender(str_replace("&","&",$order_query->row['store_name']));
Code: Select all
$mail->setSubject(str_replace("&","&",$subject));
hi,
sorry to open up an old tread. my issue is for 1.5.1.3. where my welcome email show my storename with & instead of "&" for the main message where storename is used. it happens on the first line as well as after thanks.
For the order email it turns out okay.
i see this using gmail account. have not tried other email account yet.
any help will be greatly appreciated.
sorry to open up an old tread. my issue is for 1.5.1.3. where my welcome email show my storename with & instead of "&" for the main message where storename is used. it happens on the first line as well as after thanks.
For the order email it turns out okay.
i see this using gmail account. have not tried other email account yet.
any help will be greatly appreciated.
Same here.
It seems to be a bug that should be addressed.
I attached a vqmod that fixes it.
if want to do it manually
edit system/library/mail.php
Search
Replace with
It seems to be a bug that should be addressed.
I attached a vqmod that fixes it.
if want to do it manually
edit system/library/mail.php
Search
Code: Select all
$this->text = $text;
Code: Select all
$this->text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
Attachments
Fix email body to show ampersand instead of &
Guntis
Partneris.lv - opencart web site development and support
That didn't work for me so I updated the vQmod. Tested on v1.5.3.1.
Anyone had any joy with this?
Tried the fixes for latest OC and no joy
Tried the fixes for latest OC and no joy
Professional UK Based eCommerce - Our Free Opencart Mods - Our Premium Opencart Mods
Kashflow Integration
Concept211 wrote:That didn't work for me so I updated the vQmod. Tested on v1.5.3.1.
Can confirm that vQmod code provided by Concept211 on Fri July 13th works a treat on OpenCart v1.5.6
Thanks for the xml file!
This replaces '&' seen in email 'subject line' and 'from' field with correct '&' symbol popular in Store names (e.g. B&Q)
Who is online
Users browsing this forum: No registered users and 18 guests