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?
Delivery e-mail
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Delivery e-mail
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
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Oct 2009, 22:32
Re: Delivery e-mail
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.
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.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Delivery e-mail
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
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Oct 2009, 22:32
Re: Delivery e-mail
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.
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.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Delivery e-mail
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
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
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 5
- Joined: 07 Oct 2009, 22:32
Re: Delivery e-mail
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}',
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}',
-
- Phoca Newbie
- Posts: 5
- Joined: 18 Aug 2010, 17:32
Re: Delivery e-mail
were do i find the file order.order_email.php? Didnt find such file.
Regards Ivan
Regards Ivan
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Delivery e-mail
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
administrator\components\com_virtuemart\html\order.order_email.php
Jan
If you find Phoca extensions useful, please support the project