Integration logo
Virtue Mart 3

Virtue Mart 3

E-commerce Integration VirtueMart AffiliateMarketing

Virtue Mart 3 integration

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”.

Required Information

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.

Step-by-step integration

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.

Integrate offline payments (cash)

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.

Integrate online payments

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.

Additional step: Click tracking

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.

  • Usually this involves placing a click tracking script in a place that’s common to all pages (often in the header or via a site-wide template).
  • This captures all affiliate clicks before an order is placed.

Testing & Verification Once you’ve added the snippets:

  1. Place a test offline order: verify the tracking script appears in the HTML before the cart is emptied.
  2. Place a test online order: ensure after payment that the tracking code runs and sends data to your Post Affiliate Pro account.
  3. Test an affiliate referral link: click the link, complete a purchase, and verify the sale is attributed to the affiliate in PAP reports.

Troubleshooting

  • If no tracking shows up, double-check that you used the correct file paths (in your Joomla / VirtueMart installation) and correct virtuemart plugin names.
  • Ensure that URL_TO_PostAffiliatePro and Account_ID are replaced with your real Post Affiliate Pro script URL and your real account ID.
  • Be sure that caching (on server / CDN) is cleared after changes.
  • Check for syntax errors (especially quotes, concatenation) in PHP when adding the snippet.

Example code combined

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();

Alternatives to VirtueMart 3 that integrate with Post Affiliate Pro

If you are considering alternatives to VirtueMart 3, these platforms are also compatible with Post Affiliate Pro:

PlatformNotes 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.
ShopifyIntegrates via official PAP app or manual tracking script in order confirmation page. Supports full sale and click tracking.
Magento 2PAP provides a free plugin. Tracks per-product sales, coupons, custom fields, and integrates via JS or API.
OpenCart 3Insert tracking scripts in confirm.php and success.php. Tracks per-product or whole-cart commissions.

Frequently asked questions

What is Virtue Mart 3 integration with Post Affiliate Pro?

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.

How do I integrate Virtue Mart 3 with Post Affiliate Pro?

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.

Is this integration suitable for all versions of Virtue Mart?

This integration method is specifically for Virtue Mart version 3. For earlier versions, refer to the 'Virtue Mart 2' integration method.

Do I need to add click tracking code as well?

Yes, it is important to integrate the click tracking code to ensure the sale tracking works correctly with Post Affiliate Pro.

Schedule a one-on-one call

Discover how Post Affiliate Pro can benefit your business. Get personalized guidance on integrating Virtue Mart 3 and maximizing your affiliate marketing potential.

Learn more

Virtue Mart
Virtue Mart

Virtue Mart

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

5 min read
VirtueMart Integration +3
Virtue Mart 2
Virtue Mart 2

Virtue Mart 2

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 ...

4 min read
E-commerce Open-source +3
CommerceV3
CommerceV3

CommerceV3

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...

4 min read
E-commerce Integration +3

You will be in Good Hands!

Join our community of happy clients and provide excellent customer support with Post Affiliate Pro.

Capterra
G2 Crowd
GetApp
Post Affiliate Pro Dashboard - Campaign Manager Interface