Page 1 of 1

Delivery e-mail

Posted: 06 Apr 2010, 00:11
by kamstrup
I would like to add the costumers note to the delivery e-mail.

We forward the e-mail to our warehouse and would like to automatically add the costumer's note to the e-mail.

I tried adding some code in order.order_email.php so I could call it from the language file. But I couldn't figure out the right code.

Say I wanted to be able to call {CustomerNote} from english.php like the Footer:

'VM_DELIVERY_EMAIL_RECEIPT_MESSAGE' => 'To the warehouse,
Enclosed you will find PDF receipt to send to customer.
The customer has this comment: {CostumerNote}.
blahblah.
Yours sincerely{Footer}',

How do I do this?

Re: Delivery e-mail

Posted: 08 Apr 2010, 11:31
by Jan
Hi, I think it will be not so easy, you need to create some new database column (maybe table) to store it there and then you need to load it from database and paste it to the code. But no experiences there :-( :( :idea:

Jan

Re: Delivery e-mail

Posted: 17 Sep 2010, 11:33
by kamstrup
Hi

It is actually already in the database....
in jos_vm_orders there is a customer_note

We pull all other kind of data from the order into the pdf, why should we not be able to pull this?

It would really help me a lot to get this to work.

Re: Delivery e-mail

Posted: 20 Sep 2010, 15:39
by Jan
Hi, if the item is stored in the database, then just load it and paste it to the output (which will be delivered in the email)

Jan

Re: Delivery e-mail

Posted: 20 Sep 2010, 16:03
by kamstrup
Yes, that's my problem. How do I load it?
Which file(s) do I edit?
How do I pull it from the DB?

My php-skills are no good.

If it was written on the delivery-note-pdf that would be ok.

Re: Delivery e-mail

Posted: 20 Sep 2010, 17:56
by Jan
Hi, I know the php but the problem of me, is I don't have any experiences with such modification, so cannot give any advice here except that the code for rendering the PDF is here:


administrator/components/com_virtuemart/pdf/delivery.pdf.php
administrator/components/com_virtuemart/pdf/phoca.tcpdf.php

for displaying it you need to copy other tcpdf method used in the code and modify it and add the coordinates where you need
for loading you need to see other database queries and find the column and load it to some variable then you should paste this variable to the tcpdf method ... but if you don't know php, maybe you need to find someone who will do this for you :-(

:(

Re: Delivery e-mail

Posted: 11 Oct 2010, 14:18
by kamstrup
Ok I finally figured out how to. And it was as easy as I originally thought!

in order.order_email.php
line 156-160 I added one line

$message = $VM_LANG->_('VM_DELIVERY_EMAIL_DELIVERY_NOTE_MESSAGE');
$message = str_replace('{OrderDate}', $dbo->f('order_date'), $message);
$message = str_replace('{Custumernote}', $dbo->f('customer_note'), $message);
$message = str_replace('{Footer}', $emailFooter, $message);
$attachmentDeliveryNoteChecked = 'checked="checked"';

and Customernote is added to the language file

'VM_DELIVERY_EMAIL_RECEIPT_MESSAGE' => 'To the warehouse,
Enclosed you will find PDF receipt to send to customer.
The customer has this comment: {Costumernote}.
blahblah.
Yours sincerely{Footer}',

Re: Delivery e-mail

Posted: 03 Jan 2011, 01:26
by twixraider
were do i find the file order.order_email.php? Didnt find such file.

Regards Ivan

Re: Delivery e-mail

Posted: 03 Jan 2011, 23:41
by Jan
Hi, there is no such file in new addon. In old you should find it here:
administrator\components\com_virtuemart\html\order.order_email.php

Jan