VM IDnR addon is a "package" of components, plugins and small hacks which allow creating PDF Invoice, PDF Delivery Note, PDF Receipt and sending them through email to customers (Email feauture is available for users who are regularly active in Phoca Forum, are regularly translating Phoca Extensions or have donated to Phoca Project - get more info about how to contribute and get the Email feature on info[at]phoca[dot]cz).

1. Install Phoca PDF component (1.0.8 or later version, Phoca PDF component download link) in Joomla! Extension Manager. It is good to test, if you are able to create PDF documents on your site (e.g. with help of Phoca PDF Content plugin).
2. Install Phoca PDF VirtueMart plugin (or Phoca PDF VirtueMart Email plugin) in Joomla! Extension Manager. Enable this plugin in Joomla! Plugin Manager (Phoca PDF VirtueMart plugin download site).
3. Install Phoca Install - VirtueMart component (Phoca Install - VirtueMart component download link) in Joomla! Extension Manager. Check "Ignore SQL query" in case, on your site there is installed previously version of VM IDnR addon (to not lose data). Before you install files and data with help of this component, VirtueMart must allready be installed on your site.
(4). If you are using Phoca PDF VirtueMart Email plugin, install Phoca Email Component (it must be installed before making following modifications - Phoca Email component download link).
1. Displaying Delivery tab in detail of an order
Modify the following file:
administrator/components/com_virtuemart/html/order.order_print.php
FROM (line cca 191):
$tab->endTab();
$tab->endPane();
TO:
$tab->endTab();
// Delivery
$lang =& JFactory::getLanguage();
$lang->load('plg_phocapdf_virtuemart', JPATH_ADMINISTRATOR, null, true);
$tab->startTab( JText::_('PLG_PHOCAPDF_VM_DELIVERY_TAB_LBL'), "delivery_pane" );
require_once(CLASSPATH.'ps_order_delivery.php');
$tab->endTab();
// End Delivery
$tab->endPane();
Now the basic addon is installed. Go to "Order List" in your VirtueMart and click on some order (to edit it). Now the "Delivery" tab will be displayed in detail of an order.

If you click on "New delivery" button, you will be able to create new delivery.

You can create Invoice or Receipt. Delivery Note will be created automatically. After saving delivery, you will be able to display Invoice or Receipt and Delivery Note as PDF.

If you are using Phoca PDF VirtueMart Email plugin, you can send emails to your customers.

1. Displaying Invoice, Delivery Note or Receipt in frontend, in Account Maintenance
Modify the following file:
administrator/components/com_virtuemart/classes/ps_order.php
FROM (line cca 23)
class vm_ps_order {
TO:
jimport('joomla.filesystem.file');
if (JFile::exists(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php')) {
require_once(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php');
} else {
return JError::raiseError('Include Error', 'Plugin: Phoca PDF VirtueMart Helper class not found');
}
class vm_ps_order {
FROM (line cca 729):
$listObj->addCell( $tmp_cell );
TO:
$listObj->addCell( $tmp_cell );
$delivery = PhocaPDFVirtueMartHelper::renderPDFIconAccount($sess, URL, $db->f("order_id"));
$listObj->addCell($delivery);
Then your customers will see PDF icon to Invoice, Delivery Note or Receipt (if created) in Account Maintenance view.

2. Fixing tab bug in detail window of an order (if you click on e.g. "New delivery" in delivery tab, the site is redirecting but not the delivery tab will be displayed - the first tab is displayed instead). The site should be redirecting back to delivery tab
Modify the following file:
administrator/components/com_virtuemart/classes/htmlTools.class.php
FROM (line cca 407):
function endPane() {
echo "</div>";
TO:
function endPane() {
echo "</div>";
$d = JRequest::get('request');
if(isset($d['delivery_pane']) && $d['delivery_pane'] == 1) {
$activeTab = 2;
} else {
$activeTab = 0;
}
FROM: (line cca 421):
activeTab: 0,
TO:
activeTab: {$activeTab},
1. Creating Delivery, Creating PDF of Invoice, Delivery Note or Receipt, Sending email with the Invoice, Delivery Note or Receipt automatically after changing Order status
E.g. if you will change the order status from pending to confirmed, then the delivery will be automatically created, PDF document (Invoice, Delivery Note or Receipt) will be created and sent through email to customer.
Modify:
administrator/components/com_virtuemart/classes/ps_order.php,
If you didn't do with some previous hack, then you should paste the following code:
FROM (line cca 23)
class vm_ps_order {
TO:
jimport('joomla.filesystem.file');
if (JFile::exists(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php')) {
require_once(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php');
} else {
return JError::raiseError('Include Error', 'Plugin: Phoca PDF VirtueMart Helper class not found');
}
class vm_ps_order {
and then:
FROM (line cca 281):
if( !empty($notify_customer) ) {
$this->notify_customer( $d );
}
TO:
$PhocaSend = 0;
if( $curr_order_status=="P" && $d["order_status"]=="C" && $notify_customer == 1) {PhocaPDFVirtueMartHelper::createDeliveryAndPDFandSendEmail($vmLogger, $VM_LANG, CLASSPATH);
$PhocaSend = 1;
}
if( !empty($notify_customer) ) {
if ($PhocaSend != 1) {
$this->notify_customer( $d );
}
}
![]()
PDF templates are created in HTML and CSS so they can be stylized in Phoca PDF VirtueMart (Email) plugin parameters or they can be modified directly in template files which are located in the follwing folder:
plugins/phocapdf/virtuemart/ (in your Joomla! site root folder)

You can set default settings for creating of a delivery:


Translation files can be translated to other languages and used on Joomla! site. See article: How to create translation for Joomla! extensions
Phoca Install VirtueMart component is specific file needed for installation only (designed for developers or administrators), so it does not include translation (it is only in English available).
|
|