
Virtue Mart
Would you like to improve your affiliate software even more? Check out the Virtue Mart integration for Post Affiliate Pro.

Would you like to improve your affiliate software even more? Check out the Virtue Mart 3 integration for Post Affiliate Pro.
VirtueMart 3 is a free, open-source e-commerce extension for Joomla, allowing you to sell products online with a flexible store system. Post Affiliate Pro can be integrated with VirtueMart 3 to track affiliate sales, whether orders are paid online or offline.
This integration method is for Virtue Mart version 3. If you have a lower version, please navigate to the integration method named “Virtue Mart 2”.
Before you begin, you need:
Post Affiliate Pro Account ID – used in the tracking snippet.
URL to PAP tracking script – usually something like: https://YOUR_POSTAFFILIATE_DOMAIN/scripts/trackjs.js
Access to your Joomla / VirtueMart 3 installation – you will need to edit PHP files. Always backup files before making changes.
Below are the steps you should follow, based on the official VirtueMart 3 integration guide by Post Affiliate Pro. All code snippets come with their file locations.
For offline payment methods, the tracking code should be added to the VirtueMart plugin that handles “standard” (offline) payments. Locate the file:
Open file plugins/vmpayment/standard/standard.php and find function plgVmConfirmedOrder.
At the end of it, there is a line $cart- >emptyCart – place the following code above it:
/* [Post Affiliate Pro](/ "Post Affiliate Pro offers a comprehensive affiliate software platform to manage multiple affiliate programs with ease. Enjoy no setup fees, 24/7 customer support, and a free 1-month trial. Ideal for small and large businesses, it features precise tracking, automated workflows, and customizable tools to boost your affiliate marketing success. Try it now and streamline your affiliate operations effortlessly!") integration snippet */
$html .= '<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">'."{$SetAccountJs}
{$CreateSaleJs}
sale.setTotalCost('".$order['details']['BT']->order_subtotal."');
sale.setOrderID('".$order['details']['BT']->order_number."');
sale.setData1('".$order['details']['BT']->email."');
PostAffTracker.register();
</script>";
/* [Post Affiliate](/ "Post Affiliate Pro offers a comprehensive affiliate software platform to manage multiple affiliate programs with ease. Enjoy no setup fees, 24/7 customer support, and a free 1-month trial. Ideal for small and large businesses, it features precise tracking, automated workflows, and customizable tools to boost your affiliate marketing success. Try it now and streamline your affiliate operations effortlessly!") Pro integration snippet */
Save your changes.
Online payments are handled differently, particularly in the VirtueMart plugin responsible for confirmed order payment responses.
Open file administrator/components/com_virtuemart/plugins/vmpsplugin.php and find function processConfirmedOrderPaymentResponse.
Add the following code to its beginning:
/* Post [Affiliate](/ "Post Affiliate Pro offers a comprehensive affiliate software platform to manage multiple affiliate programs with ease. Enjoy no setup fees, 24/7 customer support, and a free 1-month trial. Ideal for small and large businesses, it features precise tracking, automated workflows, and customizable tools to boost your affiliate marketing success. Try it now and streamline your affiliate operations effortlessly!") Pro integration snippet */
$html .= '<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">'."{$SetAccountJs}
{$CreateSaleJs}
sale.setTotalCost('".$order['details']['BT']->order_subtotal."');
sale.setOrderID('".$order['details']['BT']->order_number."');
sale.setData1('".$order['details']['BT']->email."');
PostAffTracker.register();
</script>";
/* Post Affiliate Pro integration snippet */
Save the file and test with a real online payment method to ensure the tracking fires correctly after payment is confirmed.
After implementing sale tracking (via the snippets above), you must also integrate click tracking, so that when an affiliate link is clicked, the click is recorded. Without click tracking, sales may not be properly attributed to affiliates.
Testing & Verification Once you’ve added the snippets:
Troubleshooting
Here’s a simplified combined snippet (offline payments example):
// in plugins/vmpayment/standard/standard.php, inside plgVmConfirmedOrder function
// … prior code
/* Post Affiliate Pro integration snippet */
$html .= '<script id="pap_x2s6df8d" src="https://YOUR_POSTAFFILIATE_DOMAIN/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">' . "PostAffTracker.setAccountId('YOUR_ACCOUNT_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('" . $order['details']['BT']->order_subtotal . "');
sale.setOrderID('" . $order['details']['BT']->order_number . "');
sale.setData1('" . $order['details']['BT']->email . "');
PostAffTracker.register();
</script>";
/* End of snippet */
// Proceed to empty the cart
$cart->emptyCart();
If you are considering alternatives to VirtueMart 3, these platforms are also compatible with Post Affiliate Pro:
| Platform | Notes on integration |
|---|---|
| HikaShop (Joomla) | Supports inserting PAP tracking in checkout templates. Tracks order totals, IDs, and emails. |
| WooCommerce (WordPress) | PAP offers a plugin module for WooCommerce. Supports click tracking, per-product sales, coupons, and order confirmation. |
| Shopify | Integrates via official PAP app or manual tracking script in order confirmation page. Supports full sale and click tracking. |
| Magento 2 | PAP provides a free plugin. Tracks per-product sales, coupons, custom fields, and integrates via JS or API. |
| OpenCart 3 | Insert tracking scripts in confirm.php and success.php. Tracks per-product or whole-cart commissions. |
Virtue Mart 3 integration lets you connect your Virtue Mart e-commerce store with Post Affiliate Pro, enabling seamless affiliate tracking and management for your online shop.
You can integrate Virtue Mart 3 by adding provided tracking code snippets to the appropriate PHP files handling offline and online payments as described in the integration guide.
This integration method is specifically for Virtue Mart version 3. For earlier versions, refer to the 'Virtue Mart 2' integration method.
Yes, it is important to integrate the click tracking code to ensure the sale tracking works correctly with Post Affiliate Pro.
Discover how Post Affiliate Pro can benefit your business. Get personalized guidance on integrating Virtue Mart 3 and maximizing your affiliate marketing potential.
Would you like to improve your affiliate software even more? Check out the Virtue Mart integration for Post Affiliate Pro.
Discover how to seamlessly integrate Virtue Mart 2 with Post Affiliate Pro for advanced affiliate tracking in your Joomla e-commerce store. Step-by-step guides ...
Learn how to seamlessly integrate CommerceV3 (CV3) with Post Affiliate Pro to enhance your e-commerce operations. Add click and sale tracking codes, enable life...
Cookie Consent
We use cookies to enhance your browsing experience and analyze our traffic. See our privacy policy.