Post by endlessxpressions » Sun Sep 11, 2016 11:56 pm

So I have opencrt 2.2.0.. and I have integrated Jrox JAM affiliate program. Right now it is tracking sales correctly, however its paying commissions on shipping and not deducting coupon codes.
I contacted Jrox, and they are awful at giving any answers. so Im reaching out here.

- Im hoping someone can see the incorrect database value.. and let me know where the lmistake might be

They gave me a secondary code to use, however it doesnt work. they are telling me I need to pay them to go in and find the correct database tables. so here is what I have so far. Hoping someone can shed light so I dont have to pay them all this money for some database table values. (I think they should have this info already since they advertise it as opencart 2.2) But NOPE.

Code they gave me that tracks (but adds commissions on shipping) - It DOES track.. But I dont pay on shipping too!

//START AFFILIATE INTEGRATION
$sql = 'SELECT * FROM `' . DB_PREFIX . 'order` WHERE order_id = ' . (int)$this->session->data['order_id'];
$jrox = mysqli_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
$jrox2 = mysqli_query($jrox, $sql);
$aff_data = mysqli_fetch_assoc($jrox2);

//$query = $this->db->query('SELECT * FROM `' . DB_PREFIX . 'order` WHERE order_id = \'' . $this->session->data['order_id'] . '\'');
//$aff_data = $query->row;

$aff_integrate = file_get_contents('http://www.domain.com/affiliates/sale/amount/' . $aff_data['total'] . '/trans_id/' . $this->session->data['order_id'] . '/tracking_code/' . $_COOKIE['jamcom']);
//END AFFILIATE INTEGRATION


The NEW code they gave me (which produces errors and doesnt track at ALL)

//START AFFILIATE INTEGRATION
$sql = 'SELECT * FROM `' . DB_PREFIX . 'order` WHERE order_id = ' . (int)$this->session->data['order_id'];
$jrox = mysqli_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
$jrox2 = mysqli_query($jrox, $sql);
$aff_data = mysqli_fetch_assoc($jrox2);

$sql = 'SELECT * FROM `' . DB_PREFIX . 'order_total WHERE order_id = ' . (int)$this->session->data['order_id'] . ' AND code = \'sub_total\'';
$jrox2 = mysqli_query($jrox, $sql);
$sub_total = mysqli_fetch_assoc($jrox2);

$aff_integrate = file_get_contents('http://www.domain.com/affiliates/sale/amount/' . $aff_data['value'] . '/trans_id/' . $this->session->data['order_id'] . '/tracking_code/' . $_COOKIE['jamcom']);
//END AFFILIATE INTEGRATION

Error I see when the above code is added to checkout success:

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
boolean given in
/home/streetkt/public_html/shophodgepodge.com/catalog/controller/checkout/success.php
on line 15Notice: Undefined index: value in
/home/streetkt/public_html/shophodgepodge.com/catalog/controller/checkout/success.php
on line 17


What I need and want:
Affiliate earns a commission on the SUBTOTAL after coupons entered. NO commissions on shipping or tax.

New member

Posts

Joined
Mon Jan 27, 2014 9:41 am

Post by OSWorX » Mon Sep 12, 2016 2:23 am

I have made several modules for affiliate tracking the last years, e.g. Lyoness to name the biggest.

But I have never seen such a lousy code!
And this is orginal from them?
And they argue that their code shall work with Opencart 2.2.x?

From where the hell are these lines?
Guess from this here: https://jam.jrox.com/kb/article/93/comm ... encart.php

And what for shall this be her:

Code: Select all

$aff_integrate = ...
Hope their solution is better than this piece of code!
If you need more help, you contact me per PM or Email.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by endlessxpressions » Mon Sep 12, 2016 7:38 am

Yeah thats what I was given... their customer service is TERRIBLE.
Im in so far now with affiliates, im stuck on this stupid program.

The forst code does track sales, but it pays out commissions on everything.. these programs shouldnt pay on shipping.. so Im having to edit every single sale and its driving me crazy.

placed on checkout_success

NO idea how to fix it.. they want me to PAY them more $$ to fix opencart database tables which I think is bull.. was hoping to find it myself and fix..

*nightmare*

New member

Posts

Joined
Mon Jan 27, 2014 9:41 am

Post by endlessxpressions » Fri Sep 16, 2016 1:26 am

Still no answer or solution to find which database tables to add in the code for subtotal

Paying monthly for a system I have to manually do commissions. Ugh!

New member

Posts

Joined
Mon Jan 27, 2014 9:41 am
Who is online

Users browsing this forum: No registered users and 2 guests