Post by newhauschka » Sat Apr 25, 2020 2:18 pm

Most of the literature online regarding this concerns older pre-twig versions of OpenCart.

I need to add a line to each order email to each customer, notifying him that the charge that will appear on his credit card will be
Such and Such
because the dba I use for my credit card processing account is a generic company name.

1) Where may I edit the order confirmation email?
2) Is there a way to test receive this email, short of running my own authorization-only order through my site and having that email sent to myself?

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am

Post by straightlight » Sat Apr 25, 2020 7:01 pm

1) Where may I edit the order confirmation email?
While the OC version has not been posted, there sure is. In your catalog/controller/mail/order.php file, you can edit your emails when adding, editing and when receiving alerted orders as well as in your catalog/language/<your_language>/mail/order_x.php files and your catalog/view/theme/<your_theme>/template/mail/order_x.twig files.
2) Is there a way to test receive this email, short of running my own authorization-only order through my site and having that email sent to myself?
More information required on that one.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by newhauschka » Sun Apr 26, 2020 4:28 am

I couldn't find those files in my OpenCart 3.0.3.2 or did you mean by "x" that that is a variable representing various file names? Like edit, etc.?
order_add.php
order_alert.php
order_edit.php
?

Once I make the change, is there a way to test to see what the email looks like at the receiving end? (Other than - entering a dummy order into the system I mean and making myself the customer.)
Last edited by newhauschka on Sun Apr 26, 2020 4:42 am, edited 2 times in total.

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am

Post by straightlight » Sun Apr 26, 2020 4:29 am

newhauschka wrote:
Sun Apr 26, 2020 4:28 am
I couldn't find those files in my OpenCart 3.0.3.2

Once I make the change, is there a way to test to see what the email looks like at the receiving end? (Other than - entering a dummy order into the system I mean and making myself the customer.)
Unless using an extension to test the order emails separately, you need to create an order to test the email.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by newhauschka » Sun Apr 26, 2020 1:46 pm

In the following:

catalog/language/en-gb/mail/order_add
I added ' The charge on your credit card will appear as XXXXX.' as follows:

Code: Select all

$_['text_greeting']         = 'Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed. The charge on your credit card will appear as XXXXX.';
catalog/language/en-gb/checkout/success.php
I added as follows:

Code: Select all

$_['text_customer']        = '<p>Your order has been successfully processed!</p><p>You can view your order history by going to the <a href="%s">my account</a> page and by clicking on <a href="%s">history</a>.</p><p>If your purchase has an associated download, you can go to the account <a href="%s">downloads</a> page to view them.</p><p>Please direct any questions you have to the <a href="%s">store owner</a>.</p><p>The charge on your credit card will appear as XXXXX. Thanks for shopping with us online!</p>';
$_['text_guest']           = '<p>Your order has been successfully processed!</p><p>Please direct any questions you have to the <a href="%s">store owner</a>.</p><p>[b][u]The charge on your credit card will appear as XXXXX. Thanks for shopping with us online!</p>';
I haven't done a test order to email to myself to see how it will look on the receiving end.
Last edited by newhauschka on Mon Apr 27, 2020 1:20 am, edited 3 times in total.

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am

Post by straightlight » Sun Apr 26, 2020 7:02 pm

I haven't done a test order to email to myself to see how it will look on the receiving end.
Is the code addition working as expected when testing an order, however?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by newhauschka » Mon Apr 27, 2020 2:00 am

To test this, first I set my authorize.net AIM
Extensions/Payments/Authorize AIM
to Authorization and not to Capture any orders.

Then I went through the system and placed the order. It went through and I saw the authorization on my own credit card online.

The messages went through fine!

Within the website the customer would see this:
Image
and the first confirmation email ("Auto-Receipt") received would be this:
Image
and then the second email received, would be this:
Image

and yes! all three include the intended phrase of 'The charge on your credit card will appear as XXXXX.'

---

However this brought to my intention two additional issues. The second email shows the order status as Canceled.

1)
So I went in to first
Systems>Settings>Options>Order Status
and that did show Pending
but within my Authorize.net AIM
Extensions>Payments>Authorize.net
that showed as Canceled for the default setting. I changed that to Pending also.
I hope this resolves that issue. (I think it is rather sloppy that the default order status is Canceled - anywhere! in the setup.)

2)
The logo in the second email is HUGE. I am wondering how I make that smaller? I guess the image itself that I uploaded is too big? I would have thought that the system would make it smaller.
I am thinking I need to do this? What do you think?
Catalog > View> theme> default> template> mail> order_add.twig
Remove:

Code: Select all

<a href="{{ store_url }}" title="{{ store_name }}"><img src="{{ logo }}" alt="{{ store_name }}" style="margin-bottom: 20px; border: none;" /></a>
Replace with:

Code: Select all

<a href="{{ store_url }}" title="{{ store_name }}"><img src="{{ logo }}" alt="{{ store_name }}" style="margin-bottom: 20px; border: none; max-width: 250px;" /></a>
Where max-width should be the value I need.
Will this do it?

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am

Post by newhauschka » Thu Apr 30, 2020 12:31 am

Will the above work to make the logo not huge?

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am

Post by straightlight » Thu Apr 30, 2020 12:34 am

Reducing the logo size on the email template would definitely be a start.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by newhauschka » Fri May 01, 2020 1:14 am

No, that didn't work. Changing to

Code: Select all

<a href="{{ store_url }}" title="{{ store_name }}"><img src="{{ logo }}" alt="{{ store_name }}" style="margin-bottom: 20px; border: none; max-width: 250px;" /></a>
had no effect and logo appeared just as huge in the confirmation email.

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am

Post by straightlight » Fri May 01, 2020 1:24 am

newhauschka wrote:
Fri May 01, 2020 1:14 am
No, that didn't work. Changing to

Code: Select all

<a href="{{ store_url }}" title="{{ store_name }}"><img src="{{ logo }}" alt="{{ store_name }}" style="margin-bottom: 20px; border: none; max-width: 250px;" /></a>
had no effect and logo appeared just as huge in the confirmation email.
Ensure to clear the OC cache by following these steps: viewtopic.php?f=134&t=215776#p718325

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by newhauschka » Fri May 01, 2020 2:50 am

Okay I solved the issue. There were two additional steps:

1 - Yes, clearing the template and SASS cache that is always needed.

2 - In addition to removing this Catalog > View> theme> default> template> mail> order_add.twig

Code: Select all

<a href="{{ store_url }}" title="{{ store_name }}"><img src="{{ logo }}" alt="{{ store_name }}" style="margin-bottom: 20px; border: none;" /></a>
and replacing with this

Code: Select all

<a href="{{ store_url }}" title="{{ store_name }}"><img src="{{ logo }}" alt="{{ store_name }}" style="margin-bottom: 20px; border: none; max-width: 250px;" /></a>
seems like I also needed to remove these two pieces of code:
remove from line 8

Code: Select all

div style="width: 680px;">
remove from line 114

Code: Select all

</div>
3 - An additional issue arose. I noticed that the emails being sent to admin email do not even reference the size options.

So I did this as well:
catalog/view/theme/default/template/mail/order_alert.twig file
Find:

Code: Select all

{% if option %}
Replace:

Code: Select all

{% if product.option %}

New member

Posts

Joined
Mon Apr 06, 2020 3:23 am
Who is online

Users browsing this forum: Semrush [Bot] and 19 guests