Edit mysql code in www/components/com_affiliate/controller.php

Started by fruitvlieg, February 09, 2014, 20:03:26 PM

Previous topic - Next topic

fruitvlieg

Hello,

Im using Joomla 2.5.14 with Virtuemart 2, and VM affiliates.

I want to edit the following rule in controller.php:
(line 1433) $query   = "UPDATE #__vm_affiliate SET `commissions` = `commissions` " . $operation . " " . $payment->amount . " WHERE `affiliate_id` = '" . $affiliateID . "'";

When a customer uses a coupon code trough an affiliate, I want this to be deducted from the commission of the affiliate. How do I change this rule, am I looking at the correct file? I was thinking of changing to something like:

         $commissie = " . $payment->amount . "-final_discount;
         $query   = "UPDATE #__vm_affiliate SET `commissions` = `commissions` " . $operation . " " . $commissie . " WHERE `affiliate_id` = '" . $affiliateID . "'";

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum