Page 1 of 1

How do I integrate Affiliate Manager with AbanteCart Ecommerce software

Posted: Mon Mar 02, 2015 3:23 pm
by gidnus
I have checked the Affiliate Manager Software documentation. there is 'how to integrate the system with other eCommerce softwares,' but no information for 'AbanteCart.' Please can someone help me check 'AbanteCart.com', and paste the Affiliate Integration code here. I would be very very grateful.Thanks.

Re: How do I integrate Affiliate Manager with AbanteCart Ecommerce software

Posted: Fri Mar 13, 2015 9:38 am
by forumadmin
does abanteCart post the sale and transaction values to a thank you page after payment is made?

Re: How do I integrate Affiliate Manager with AbanteCart Ecommerce software

Posted: Mon Mar 16, 2015 10:01 pm
by gidnus
Yes, abanteCart post the sale and transaction values to a success.php page. here is a copy of the code in the success.php page:

<?php

if (! defined ( 'DIR_CORE' )) {
header ( 'Location: static_pages/' );
}
class ControllerPagesCheckoutSuccess extends AController {
public function main() {

//init controller data
$this->extensions->hk_InitData($this,__FUNCTION__);

if (isset($this->session->data['order_id'])) {

$amount = $this->session->data['used_balance']; // in default currency
if($amount){
$transaction_data = array(
'order_id'=>(int)$this->session->data['order_id'],
'amount' => $amount,
'transaction_type'=>'order',
'created_by' => $this->customer->getId(),
'description' => sprintf($this->language->get('text_applied_balance_to_order'),
$this->currency->format($this->currency->convert($amount,$this->config->get('config_currency'), $this->session->data['currency']),$this->session->data['currency'],1),
(int)$this->session->data['order_id']));
$this->customer->debitTransaction($transaction_data);
}

// google analytics data for js-script in footer.tpl

$order = new AOrder( $this->registry );
$order_data = $order->buildOrderData( $this->session->data );
$order_tax = $order_total = $order_shipping = 0.0;
foreach($order_data['totals'] as $total ){
if($total['total_type']=='total'){
$order_total += $total['value'];
}elseif($total['total_type']=='tax'){
$order_tax += $total['value'];
}elseif($total['total_type']=='shipping'){
$order_shipping += $total['value'];
}
}

$this->registry->set('google_analytics_data',
array('transaction_id' => (int)$this->session->data['order_id'],
'store_name' => $this->config->get('store_name'),
'currency_code' => $order_data['currency'],
'total' => $order_total,
'tax' => $order_tax,
'shipping'=> $order_shipping,
'city'=>$order_data['shipping_city'],
'state'=>$order_data['shipping_zone'],
'country'=> $order_data['shipping_country'] ));



$this->cart->clear();

unset( $this->session->data['shipping_method'],
$this->session->data['shipping_methods'],
$this->session->data['payment_method'],
$this->session->data['payment_methods'],
$this->session->data['guest'],
$this->session->data['comment'],
$this->session->data['order_id'],
$this->session->data['coupon'],
$this->session->data['used_balance']);

//Redirect back. Fix for clearing shopping cart content
$this->redirect($this->html->getSecureURL('checkout/success'));
}

$this->document->setTitle( $this->language->get('heading_title') );

$this->document->resetBreadcrumbs();

$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('index/home'),
'text' => $this->language->get('text_home'),
'separator' => FALSE
));


$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/cart'),
'text' => $this->language->get('text_basket'),
'separator' => $this->language->get('text_separator')
));

if ($this->customer->isLogged()) {
$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/shipping'),
'text' => $this->language->get('text_shipping'),
'separator' => $this->language->get('text_separator')
));

$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/payment'),
'text' => $this->language->get('text_payment'),
'separator' => $this->language->get('text_separator')
));

$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/confirm'),
'text' => $this->language->get('text_confirm'),
'separator' => $this->language->get('text_separator')
));
} else {
$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/guest'),
'text' => $this->language->get('text_guest'),
'separator' => $this->language->get('text_separator')
));

$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/guest/confirm'),
'text' => $this->language->get('text_confirm'),
'separator' => $this->language->get('text_separator')
));
}

$this->document->addBreadcrumb( array (
'href' => $this->html->getURL('checkout/success'),
'text' => $this->language->get('text_success'),
'separator' => $this->language->get('text_separator')
));

$this->view->assign('heading_title', $this->language->get('heading_title'));
if($this->session->data['account']=='guest'){

$this->view->assign('text_message',
sprintf( $this->language->get('text_message_guest'),$this->html->getURL('content/contact')));
}else{
$this->view->assign('text_message',
sprintf( $this->language->get('text_message'),
$this->html->getSecureURL('account/account'),
$this->html->getSecureURL('account/history'),
$this->html->getURL('content/contact')));
}
$this->view->assign('button_continue', $this->language->get('button_continue'));
$this->view->assign('continue', $this->html->getURL('index/home'));
$continue = HtmlElementFactory::create( array ('type' => 'button',
'name' => 'continue_button',
'text'=> $this->language->get('button_continue'),
'style' => 'button'));
$this->view->assign('continue_button', $continue);

$this->processTemplate('common/success.tpl' );

//init controller data
$this->extensions->hk_UpdateData($this,__FUNCTION__);
}
}

Re: How do I integrate Affiliate Manager with AbanteCart Ecommerce software

Posted: Fri Mar 27, 2015 7:27 am
by forumadmin
you can add the highlighted code like this under the section below:

if (isset($this->session->data['order_id'])) {

$amount = $this->session->data['used_balance']; // in default currency
if($amount){
$transaction_data = array(
'order_id'=>(int)$this->session->data['order_id'],
'amount' => $amount,
'transaction_type'=>'order',
'created_by' => $this->customer->getId(),
'description' => sprintf($this->language->get('text_applied_balance_to_order'),
$this->currency->format($this->currency->convert($amount,$this->config->get('config_currency'), $this->session->data['currency']),$this->session->data['currency'],1),
(int)$this->session->data['order_id']));
$this->customer->debitTransaction($transaction_data);

file_get_contents('http://www.domain.com/affiliates/sale/amount/' . $amount . '/trans_id/' . (int)$this->session->data['order_id'] . '/tracking_code/' . $_COOKIE['jamcom']);
}

Re: How do I integrate Affiliate Manager with AbanteCart Ecommerce software

Posted: Thu Jun 21, 2018 7:34 am
by jamesrhenry
I see this post is two years old, is there any update as to Integrating this Affiliate Manager with Abantecart? Thanks!

Re: How do I integrate Affiliate Manager with AbanteCart Ecommerce software

Posted: Wed Jun 27, 2018 6:03 am
by forumadmin
jamesrhenry wrote:
Thu Jun 21, 2018 7:34 am
I see this post is two years old, is there any update as to Integrating this Affiliate Manager with Abantecart? Thanks!
First, check if that code is still the same and add the JAM integration code in the same place.