Post by angelrose » Mon Sep 13, 2010 7:20 pm

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

Newbie

Posts

Joined
Mon Sep 13, 2010 7:11 pm

Post by Qphoria » Mon Sep 13, 2010 9:18 pm

This was actually a partial fix. Before, if you had a & in your store name the email would show with "Unknown Sender". This is a partial fix to at least show the name. There's more fixing need to prevent the &amp

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by daledude » Fri Jul 22, 2011 3:29 am

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:

Code: Select all

$mail->setSender(str_replace("&","&",$order_query->row['store_name']));
I did the same thing for the Subject, on the very next line, since it was doing the amp thing there too:

Code: Select all

$mail->setSubject(str_replace("&","&",$subject));
This may be fixed in the latest version of OpenCart, I dunno. Just thought I'd throw it out there.

New member

Posts

Joined
Thu Dec 17, 2009 1:30 am

Post by Daniel » Sat Jul 23, 2011 1:27 am

which version are you using because the latest has html_entity_decode($sender, ENT_QUOTES, 'UTF-8')

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by rfary » Tue Jan 31, 2012 12:26 am

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.

Newbie

Posts

Joined
Sun Jul 03, 2011 7:39 am

Post by guntis.e » Wed Feb 01, 2012 7:33 pm

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

Code: Select all

$this->text = $text;
Replace with

Code: Select all

$this->text =  html_entity_decode($text, ENT_QUOTES, 'UTF-8');

Attachments

Fix email body to show ampersand instead of &


Guntis
Image Partneris.lv - opencart web site development and support


Active Member

Posts

Joined
Fri Jan 28, 2011 4:20 am

Post by rfary » Wed Feb 22, 2012 11:06 pm

thanks it worked.

Newbie

Posts

Joined
Sun Jul 03, 2011 7:39 am

Post by Concept211 » Fri Jul 13, 2012 9:21 pm

That didn't work for me so I updated the vQmod. Tested on v1.5.3.1.

User avatar
New member

Posts

Joined
Fri Oct 14, 2011 1:40 am

Post by olstar » Wed Nov 28, 2012 11:01 pm

Anyone had any joy with this?

Tried the fixes for latest OC and no joy :( :( ???

Professional UK Based eCommerce - Our Free Opencart Mods - Our Premium Opencart Mods
Kashflow Integration


User avatar
New member

Posts

Joined
Tue Jul 05, 2011 3:53 pm


Post by offtrolley » Thu Nov 28, 2013 7:18 pm

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)

Newbie

Posts

Joined
Thu Nov 28, 2013 7:12 pm

Post by CanadaPleco » Wed Mar 19, 2014 4:48 am

Concept211's vqmod also worked on 1.5.5.1

Thanks!

New member

Posts

Joined
Sat Aug 20, 2011 1:06 am

Post by rtrtrt » Tue Jun 23, 2015 12:37 pm

Great! It solve my problem in OC 1.5.6

Thumb Up

Newbie

Posts

Joined
Fri Jun 19, 2015 3:59 pm
Who is online

Users browsing this forum: No registered users and 18 guests