Post by waynegrappler » Tue Mar 08, 2016 1:51 am

Hi
Going round in circles on this one.

I'm making my own order confirmation email by editing the .tpl file it uses.

I'm trying to put a line in at line 50 that attempts to insert the total into the BACs details

Here's the bit before and after the line (the line with $totals in)


<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">
Please follow these instructions carefully<P ...>
Make your payment for £ <?php echo $totals['text']; ?> to the following bank account:<P ...>
Bank: TSB<BR ...>


It all appears in the email except the total. I just a pound sign - I'm working on the assumption that $totals is a variable. My knowledge of PHP is almost zero so It's vary likely I'm doing something really stupid.

Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by abxweb » Wed Mar 09, 2016 4:05 am

Which file are you trying to change and please explain lil more what are you trying to achieve. I will write simple vqmod for you to achieve what u want.

Check my FREE extension - Frontend Admin Toolbar
http://www.opencart.com/index.php?route ... n_id=26059

For any inquiry or questions contact me at: abxweb[at]outlook[dot]com


User avatar
New member

Posts

Joined
Fri Mar 04, 2016 5:47 pm
Location - Serbia

Post by waynegrappler » Wed Mar 09, 2016 8:07 pm

file is www/catalog/view/theme/default/template/mail/order.tpl

I want to place the total order cost that is displayed on the confirmation email as detailed

<td style="font-size: 12px; border-right: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD; text-align: left; padding: 7px;">
Please follow these instructions carefully<P ...>
Make your payment for £ORDER TOTAL HERE to the following bank account:<P ...>
Bank: TSB<BR ...>
Account Name: <BR ...>
Sort Code: <BR ...>
Account Number: <BR ...>
Payment Referance: <?php echo $order_id; ?><P ...>
Once you have made your payment reply to this email so that we can confirm your payment has been made, as soon as we confirm your payment your goods will be shipped
</td>

Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by artcore » Wed Mar 09, 2016 8:56 pm


Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by waynegrappler » Wed Mar 09, 2016 9:35 pm

Will this include the currency symbol? Can't test until later.

Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by artcore » Wed Mar 09, 2016 10:41 pm

Code: Select all

$data['bank'] = nl2br(str_replace('{total}',$this->currency->format(max(0, $this->cart->getTotal())),$this->config->get('bank_transfer_bank_' . $this->config->get('config_language_id'))));
It does and above is adjusted for OC2

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by ocart777 » Wed Mar 09, 2016 10:59 pm

artcore wrote:

Code: Select all

$data['bank'] = nl2br(str_replace('{total}',$this->currency->format(max(0, $this->cart->getTotal())),$this->config->get('bank_transfer_bank_' . $this->config->get('config_language_id'))));
It does and above is adjusted for OC2
nice there :D but..instead of

Code: Select all

bank_transfer_bank_
should be

Code: Select all

bank_transfer_bank
for OC2.X

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by waynegrappler » Wed Mar 09, 2016 11:08 pm

Using OC 2.1.0.2 cant find this

In admin open up the bank transfer module and change your text to include the {total} at a strategic spot.
Something like:

Pay {total} immediately to:
Bankaccount number...
Thank you!

I dont want to display the total in the bank transfer window in open cart only in a second location in the confirmation email received by the customer

Does this make sense?

Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by artcore » Thu Mar 10, 2016 12:28 am

In the admin side change the banktransfer instructions description to include the {total} somewhere. It's in payments modules > bank transfer

@ocart777: thanks! ;D

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by waynegrappler » Thu Mar 10, 2016 2:03 am

Im trying to get the total from the confirmation email bottom right into the part indicated with the red arrow, see attachment

Attachments

Capture.PNG

Capture.PNG (31.53 KiB) Viewed 2308 times


Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by ocart777 » Thu Mar 10, 2016 2:16 am

waynegrappler wrote:Im trying to get the total from the confirmation email bottom right into the part indicated with the red arrow, see attachment
use the same method. search for

Code: Select all

$comment .= $this->config->get('bank_transfer_bank' . $this->config->get('config_language_id')) . "\n\n";
replace with

Code: Select all

$comment .= str_replace('{total}', $this->currency->format($this->cart->getTotal()), $this->config->get('bank_transfer_bank' . $this->config->get('config_language_id'))) . "\n\n";

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by waynegrappler » Thu Mar 10, 2016 2:42 am

It still not working, is this the right file /www/catalog/controller/payment/bank_transfer.php

I dont understand how this will alter the order.tpl file to display the info im want

Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by ocart777 » Thu Mar 10, 2016 3:01 am

waynegrappler wrote:It still not working, is this the right file /www/catalog/controller/payment/bank_transfer.php

I dont understand how this will alter the order.tpl file to display the info im want
all the edit was made only for "catalog/controller/payment/bank_transfer.php"
the mail was sent out because once payment confirm button clicked it will call the confirm function from this file then trigger the "addOrderHistory" function from "catalog/model/checkout/order.php" which will send the email using the order.tpl template(somebody please correct me if i am wrong)

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by artcore » Thu Mar 10, 2016 3:30 am

Correct ocart777!

The text from the admin bank transfer module - the instructions for customers to pay - is sent upon confirming.
All my mod does is add the current total by replacing the place holder {total} which you have to add to the description, with the cart total.

/admin/index.php?route=payment/bank_transfer
add the {total} placeholder in the text.

/catalog/controller/payment/bank_transfer.php
Change $data['bank...etc with ocart777's modified version for oc2.

Rrefresh modification cache maybe and it should work.

I'll write an ocmod for this tomorrow ;)

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by artcore » Thu Mar 10, 2016 7:54 pm

Here you go. Tested on 2.1.0.2
I'll add it to the market for free later on

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by waynegrappler » Fri Mar 11, 2016 4:40 pm

Thanks for that any chance you could tell me how to implement it

Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by artcore » Fri Mar 11, 2016 5:37 pm

Sure.
Use the extension installer to upload the ocmod.xml and hit refresh 9n the modification page.
Done.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by waynegrappler » Fri Mar 11, 2016 6:12 pm

Ok have installed the the file and added the place holder {total} to the bank transfer instruction but (see attached pic) i still have no total in the instruction line on the confirmation email

This is the actual email received by the customer

Attachments

Capture.JPG

Capture.JPG (57.63 KiB) Viewed 2254 times


Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am

Post by artcore » Fri Mar 11, 2016 6:52 pm

It will only be for new orders.
Tested and confirmed working on 2102

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by waynegrappler » Fri Mar 11, 2016 7:05 pm

In order to add the line to the email confirmation i addd "Payment Referance: <?php echo $order_id; ?><P ...>" to order.tpl to give the details in capture1.jpg attached and this works fine.

Now i want to copy the total order amount to the line indicated in capture.jpg

I have installed the extension and placed the {total} in the bank transfer instruction and it does show the total with open cart on my site but still does not display in the line i want it to on the confirmation email received by the customer

what am i doing wrong, the ID mod i made was so simple

Attachments

Capture.JPG

Capture.JPG (57.63 KiB) Viewed 2249 times

Capture1.JPG

Capture1.JPG (56.64 KiB) Viewed 2249 times


Newbie

Posts

Joined
Tue Mar 08, 2016 1:42 am
Who is online

Users browsing this forum: No registered users and 58 guests