Home Integration Methods Virtue Mart 2

Virtue Mart 2

This integration method is for Virtue Mart version 2. If you have lower version, please navigate to the integration method named "Virtue Mart".
1
Virtue Mart with PayPal in Joomla
First step is to edit file /plugins/vmpayment/paypal/paypal.php of your Joomla installation. Find function plgVmConfirmedOrder($cart, $order) and in the function find line
$html.= '</form>';

It can also be like this:
$html .= '</form></div>';

Now add this code right after the above:

2
Virtue Mart with PayPal in Joomla
Now one more change is needed - find the line
$html.= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
and replace it with this:
Now save your work, there is another step to be done.
3
Virtue Mart with PayPal in Joomla
Final step is to resend response from PayPal to Post Affiliate Pro. To do this, find this line in the same file:
function _processIPN($paypal_data, $method) {
Add this code right below this line (create a new blank line) and past the code there:
This is it. Now save your file and upload it back to the server. Do not forget to enable PayPal plugin in your Post Affiliate Pro.
10
Virtue Mart with COD in Joomla
In case of Cash on delivery (COD) you have to modify the file /plugins/vmpayment/standard/standard.php and insert the sale tracking code there.
Find the line:
$cart->emptyCart ();
and paste this code above that line:
That's it. Save your work and upload it back to the server.

Here is a list of all variables you can use:
$order['details']['BT']->order_total
$order['details']['BT']->order_subtotal
$order['details']['BT']->tax
$order['details']['BT']->coupon_discount
$order['details']['BT']->coupon_code
$order['details']['BT']->order_status

11
Virtue Mart with Cheque in Joomla
In case of Cheque payment method you have to modify the file /plugins/vmpayment/standard/standard.php and insert the sale tracking code there.
Find the line:
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
and paste this code below that line:
Save your work and you are done. You can use the same extra variables described in step 10.
20
Virtue Mart with GoogleCheckout in Joomla
The first step is to edit file /plugins/vmpayment/osegooglecheckout/osegooglecheckout.php and to find function plgVmConfirmedOrder. Now, find line (in the end of the function):
$html.= '</form>';

Now change this line to these lines instead:
Additionally, change line:
$html.= ' document.vm_google_form.submit();';
to this line:
$html.= ' setTimeout("document.vm_google_form.submit()",3600);';

This will ensure the tracking will work with GoogleCheckout buttons.
21
Virtue Mart with GoogleCheckout in Joomla
The second and the last step of GoogleCheckout integration is to place cURL code to its correct place - find the function plgVmOnPaymentResponseReceived and place the following code to the start of the function:
Note: URL https://URL_TO_PostAffiliatePro/plugins/GoogleCheckout/googlecheckout.php must be on secure domain (More on Google documentation).
Do not forget to integrate the click tracking code, to make the sale tracking work correctly.