Jump to content

Have Error - Anyone HELP? Im dead in the water!


Recommended Posts

So the coding worked fine integrating to my open cart. But I noticed that it was giving commissions ON shipping and didnt take into account coupons.

So Jrox gave me another code to add.

Added that and now Im getting errors and it wont track sales.

Can anyone advise me on what to do? Im dead in the water and I dont know how to fix this!


Erros Im getting after adding their code on checkout success page:


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


and no sales are tracked for comm now.



Im using opencart and I need it JUST to give commissions on the subtotal minus coupon codes.


If you know of a better code PLEASE let me know.


Code I have now:

//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.shophodgepodge.com/rep/sale/amount/' . $aff_data['value'] . '/trans_id/' . $this->session->data['order_id'] . '/tracking_code/' . $_COOKIE['jamcom']);

//END AFFILIATE INTEGRATION

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...