VirtueMart 1.1.0 - Sending Invoice, Delivery Note, Receipt via Email

Category: VirtueMart

 

This extension is not more maintained. Try to see Phoca Cart extension instead - e-commerce solution for Joomla! CMS. (See demo)
This article is obsolete. check out the updated article:
VirtueMart Invoice, Delivery Note and Receipt

Guide and files used on this site are not more supported.

 

This article describes how to install 'Sending Invoice, Delivery Note, Receipt via email' addon for VirtueMart 1.1.0.

'Sending Invoice, Delivery Note, Receipt via Email' addon is based on PDF Invoices, Delivery notes and Receipts addon (For getting more information see: VirtueMart 1.1.0 - Invoice, Delivery Note, Receipt). After creating Invoice or Receipt or Delivery note, PDF button and Email button will be created.

alt

 

If you click on PDF button, PDF document (Invoice, Receipt or Delivery PDF) will be created and displayed in browser. If you click on Email button, the the following Popup Window will be displayed:

alt

Input form fields From (Name), From(Email), To, Subject, Message will be automatically filled. Values are taken from 'administrator/components/com_virtuemart/languages/common/english.php' and can be edited in form or in english.php file. After clicking Send button, email with attachment(s) will be sent to customer (PDF files will be automatically created and attached).

EMAIL TEST script - THIS GUIDE IS OBSOLETE - DON'T USE THIS ADDON (it was not removed because of backward compatibility) - see: VirtueMart Invoice, Delivery Note and Receipt

 

Before installing this addon, download, install and try the EMAIL TEST script. If you have installed Joomla!1.5 and VirtueMart 1.1 on your server, do following steps...

1. Download EMAIL TEST script from this server:

Download VirtueMart Invoice, Delivery Note, Receipt Email TEST Addon 

2. Copy 'admin.test_email.php':

  • FROM 'com_virtuemart_IDnR_Email_TEST_addon.zip/administrator/components/com_virtuemart/html/admin.test_email.php'
  • TO your server: 'administrator/components/com_virtuemart/html/admin.test_email.php'

3. Copy 'test.pdf':

  • FROM 'com_virtuemart_IDnR_Email_TEST_addon.zip/tmp/test.pdf'
  • TO your server (into the Joomla! tmp/ folder): 'tmp/test.pdf'

4. Login as administrator into your site in administrator area. Copy the following URL link (change the [your-site] to your own site), paste it into the address bar of your browser and click enter on your keyboard:

  • [your-site]/administrator/index2.php?option=com_virtuemart&page=admin.test_email.php

You get the following form:

alt

Add the e-mail address, where you want to send the test e-mail with test attachment (attachment 'test.pdf' should be saved in tmp/ folder) and click on Send button. If mail will be sent, you get the following message:

alt

Then check the email box, whether the email with attachment was delivered or not. In case, you get some error message while sending email, you can set or change the email settings here: Site » Global Configuration » Mail Settings.

'Sending Invoice, Delivery Note, Receipt via Email' addon

Before installing this addon be sure that:

  • you have installed Joomla!1.5 and VirtueMart 1.1 on your server,
  • the PDF creating is working on your site, you have installed VirtueMart 1.1.0 - Invoice, Delivery Note, Receipt addon and this addon works and all neccessary functions are istalled (with help of admin.install_delivery_sql.php),
  • you have installed the EMAIL TEST script and the sending of emails with attachments works on your site.
  • Joomla! tmp/ folder is writable.

Checking the VMIDnR functions

You can check whether all 5 necessary VMIDnR function are installed in VirtueMart or not. If you have installed VirtueMart 1.1.0 - Invoice, Delivery Note, Receipt addon and didn't delete the file 'admin.install_delivery_sql.php', login as administrator into your site in administrator area. Copy the following URL link (change the [your-site] to your own site), paste it into the address bar of your browser and click enter on your keyboard:

  • [your-site]/administrator/index2.php?option=com_virtuemart&page=admin.install_delivery_sql.php

There should be listed 5 VMIDnR functions.

alt

If yes, do following steps...

 

1. Send email to info[at]phoca[dot]cz. You get the 'com_virtuemart_IDnR_Email_addon.zip'.

2. Copy the following files into your server:

  • FROM 'com_virtuemart_IDnR_addon.zip/administrator/components/com_virtuemart/classes/ps_delivery.php'
  • TO your server: 'administrator/components/com_virtuemart/classes/ps_delivery.php'
  • FROM 'com_virtuemart_IDnR_addon.zip/administrator/components/com_virtuemart/classes/ps_order_delivery.php'
  • TO your server: 'administrator/components/com_virtuemart/classes/ps_order_delivery.php'
  • FROM 'com_virtuemart_IDnR_addon.zip/administrator/components/com_virtuemart/html/order.order_email.php.php'
  • TO your server: 'administrator/components/com_virtuemart/html/order.order_email.php'
  • FROM 'com_virtuemart_IDnR_addon.zip/administrator/components/com_virtuemart/pdf/delivery.pdf.php'
  • TO your server: 'administrator/components/com_virtuemart/pdf/delivery.pdf.php'
  • FROM 'com_virtuemart_IDnR_addon.zip/administrator/components/com_virtuemart/pdf/phoca.tcpdf.php'
  • TO your server: 'administrator/components/com_virtuemart/pdf/phoca.tcpdf.php'
  • FROM 'com_virtuemart_IDnR_addon.zip/libraries/joomla/document/printpdf/index.html'
  • TO your server: 'libraries/joomla/document/printpdf/index.html'
  • FROM 'com_virtuemart_IDnR_addon.zip/libraries/joomla/document/printpdf/printpdf.php'
  • TO your server: 'libraries/joomla/document/printpdf/printpdf.php'
Notice:

The 'com_virtuemart_IDnR_addon.zip' includes the standard Joomla! 1.5 folder structure, so you can copy whole folders into your server (If you do it, don't forget that the 'admin.install_delivery_sql.php' is included and will be copied too. It should be removed after successful database data intsallation.)

 

3. Modify (edit in text editor) the following files (before you do it, please backup your files) on your server:

File: 'administrator/components/com_virtuemart/languages/common/english.php'
Paste the following code (without php tags) into this file (don't forget to add the comma (,) after the last item before these new items)

 
// Email Delivery
'VM_DELIVERY_EMAIL_FROM_NAME' => 'From (Name)',
'VM_DELIVERY_EMAIL_FROM' => 'From (Email)',
'VM_DELIVERY_EMAIL_TO' => 'To',
'VM_DELIVERY_EMAIL_CC' => 'Cc',
'VM_DELIVERY_EMAIL_BCC' => 'Bcc',
'VM_DELIVERY_EMAIL_SUBJECT' => 'Subject',
'VM_DELIVERY_EMAIL_MESSAGE' => 'Message',
'VM_DELIVERY_EMAIL_ATTACHMENT' => 'Attachment',
'VM_DELIVERY_EMAIL_SEND' => 'Send',
'VM_DELIVERY_EMAIL_ERRORFROM' => 'Please, fill the From field',
'VM_DELIVERY_EMAIL_ERRORFROMNAME' => 'Please, fill the From Name field',
'VM_DELIVERY_EMAIL_ERRORTO' => 'Please, fill the To field',
'VM_DELIVERY_EMAIL_ERRORSUBJECT' => 'Please, fill the Subject field',
'VM_DELIVERY_EMAIL_NOTSENT' => 'Email was not sent (see your Mail function settings)',
'VM_DELIVERY_EMAIL_SENT' => 'Email was sent',
'VM_DELIVERY_EMAIL_ATTACHMENTNOTEXIST' => 'The attachment file doesn\'t
 exist on the server (in tmp folder)'
,
'VM_DELIVERY_EMAIL_WINDOWCLOSE' => 'Close window',
'VM_DELIVERY_EMAIL_POSSIBLEERROREMAIL' => 'If you see this error message
 and the site is not working (site is not loading),
 it looks as if your mail function was not able to send
 the email with attachment
 (mostly the Maximum execution time of PHP script
 is exceeded because of sending attachment)'
,
'VM_DELIVERY_EMAIL_INVOICE_SUBJECT' => 'Invoice Nr.: ',
'VM_DELIVERY_EMAIL_INVOICE_MESSAGE' => 'Dear Customer, 
 Thank you for your order dated {OrderDate}. 
 Enclosed you will find PDF invoice. 
 The items you ordered will be shipped within a week.
 We assure you that your order
 will be performed to your entire satisfaction.
 Yours sincerely{Footer}'
,
'VM_DELIVERY_EMAIL_DELIVERY_NOTE_SUBJECT' => 'Delivery Note Nr.: ',
'VM_DELIVERY_EMAIL_DELIVERY_NOTE_MESSAGE' => 'Dear Customer, 
 Thank you for your order dated {OrderDate}.
 Enclosed you will find PDF delivery note.
 The items you ordered will be shipped within a week.
 We assure you that your order will be performed to your entire satisfaction.
 Yours sincerely{Footer}'
,
'VM_DELIVERY_EMAIL_RECEIPT_SUBJECT' => 'Receipt Nr.: ',
'VM_DELIVERY_EMAIL_RECEIPT_MESSAGE' => 'Dear Customer, 
 Thank you for your order dated {OrderDate}. 
 Enclosed you will find PDF receipt. 
 The items you ordered will be shipped within a week.
 We assure you that your order will be performed to your entire satisfaction.
 Yours sincerely{Footer}'
,
'VM_DELIVERY_EMAIL_ORDER' => 'Your order Nr.: {OrderId} from {OrderDate}',
'VM_DELIVERY_EMAIL_FOOTER' => '{ContactTitle} {ContactFirstName}
 {ContactMiddleName} {ContactLastName}
 Tel.: {ContactPhone1}Tel.: {ContactPhone2}
 Fax: {ContactFax}Email: {ContactEmail}{VendorStoreName}
 {VendorAddress1}{VendorAddress2}{VendorZIP} {VendorCity}
 {VendorState}, {VendorCountry}Tel.: {VendorPhone}'
,
'VM_DELIVERY_VENDOR_VAT_NR1_LABEL'     =>     '',
'VM_DELIVERY_VENDOR_VAT_NR1_VALUE'     =>    '',
'VM_DELIVERY_VENDOR_VAT_NR2_LABEL'     =>     '',
'VM_DELIVERY_VENDOR_VAT_NR2_VALUE'     =>    ''
// END Delivery

Other Langages: Download VirtueMart Invoice, Delivery Note, Receipt Email TEST Addon Languages

It is recommended deleting of the following files after successful installation of the addon:

  • 'administrator/components/com_virtuemart/html/admin.install_delivery_sql.php'
  • 'administrator/components/com_virtuemart/html/admin.test_email.php'
  • 'tmp/test.pdf'

 

TCPDF error: Some data has already been output, can't send PDF file

PDF document needs to have header without any error, sometimes it can happen, that some error is rendered before the document header. Then PDF cannot be displayed in browser. In such case check out your Joomla! and VirtueMart installation if it does not produce php errors.

Mostly this is caused by wrong encoding of the files - e.g. language file. Check if your langauge file is saved as UFT-8 without BOM encoding. You can check it with text editor like e.g. Notepad++ is. Open the language file (e.g. administrator/components/com_virtuemart/languages/common/english.php) in Notepad++, click on Encoding and select Encoding in UFT-8 without BOM. And save the file.

 

Powered by Phoca