amigos affiliate system integration

12 years 5 months ago #184381 by squiant
amigos affiliate system integration was created by squiant
In dioscouri site they have this integration instructions for amigos with any shopping cart.

There are two parts to integration

keeping track of the affiliate that referred the shopper and
sending AMIGOS information about every sale


Part 1: Keeping Track of the Affiliate that Referred the Shopper

If you're not using the Amigos system plugin (which will be true of all non-Joomla sites), then this code should be inserted at the top/bottom of your index.php page (if you have one) or whichever page serves as your website's entry point (index.html or whatever). If you don't have a single entry point, then insert this code at the top/bottom of your homepage.
$amigosid = $_REQUEST['amigosid'];
$lifetime = time() + 365*24*60*60;
setcookie( 'amigosid', $amigosid, $lifetime, '/' );
?>

Part 2: Sending Amigos Information about Every Sale

There are two methods for sending Amigos information about every sale. One is to use a hidden image and the other is to use CURL (or the equivalent). If your shopping cart has a checkout 'success' page or some kind of post-checkout landing page where an order summary is displayed, that is the best place to put these.

OPTION 1: Hidden Image
img src="http://www.youramigosdomain.com/index.php?option=com_amigos&task=sale&amigosid=$GGG&amigos_ordertype=$XXX&amigos_orderid=$YYY&amigos_orderamount=$ZZZ&amigos_ipaddress=$NNN" width="1" border="0" height="1"

OPTION 2: CURL or the equivalent
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.youramigosdomain.com/index.php?option=com_amigos&task=sale&amigosid=$GGG&amigos_ordertype=$XXX&amigos_orderid=$YYY&amigos_orderamount=$ZZZ&amigos_ipaddress=$NNN");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
?>

Note

In both cases, you will need to provide information in the url. Depending on the shopping cart you use, the variable names will change.

$GGG = the affiliate ID that referred the shopper. You could use $_REQUEST in php.
$XXX = the name of the shopping cart ('com_virtumart', or 'zencart', or 'magento', etc)
$YYY = the order number
$ZZZ = the order amount
$NNN = the IP address of the user. You could use $_SERVER in php.

Sample configuration
$GGG = $_REQUEST['amigosid'];
$XXX = 'shopping_cart_name';
$YYY = '1234';
$ZZZ = '99.99';
$NNN = $_SERVER['REMOTE_ADDR'];


img src="http://www.youramigosdomain.com/index.php?option=com_amigos&task=sale&amigosid=$GGG&amigos_ordertype=$XXX&amigos_orderid=$YYY&amigos_orderamount=$ZZZ&amigos_ipaddress=$NNN" width="1" border="0" height="1"

So i need your guideness in how to replace the tags
$XXX
$YYY
$ZZZ
$NNN

to give a try and check if it can work with cbsubs

looking forward for your answer

Please Log in to join the conversation.

12 years 5 months ago #184467 by krileon
Replied by krileon on topic Re: amigos affiliate system integration
You should be able to use CBSubs URL and supply the img src as the URL using GET method. Can't guarantee this will work, but should do the trick. It won't be based off the basket, but would be based off the individual plan it self.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 5 months ago #184484 by squiant
Replied by squiant on topic Re: amigos affiliate system integration
so where do i have to insert the code??
do i need to do once per membership??

and what would be the right substitutions??

$GGG = $_REQUEST
$XXX = would this be 'com_comprofiler';?
$YYY = what should i use for the order number?
$ZZZ = what should i use for the order amount?
$NNN = $_SERVER

Please Log in to join the conversation.

12 years 5 months ago #184505 by krileon
Replied by krileon on topic Re: amigos affiliate system integration

so where do i have to insert the code??

I guess you put it in the top of your Joomla templates index file.

and what would be the right substitutions??

CBSubs URL supports all user substitutions plus a couple custom CBSubs substitutions. Price however you'd just put as the plans price and it'd be static (no substitution). Example as follows.
http://www.youramigosdomain.com/index.php?option=com_amigos&task=sale&amigosid=$GGG&amigos_ordertype=[plan_id]&amigos_orderid=[subscription_id]&amigos_orderamount=9.99&amigos_ipaddress=[registeripaddr]

Not sure how you'd get the amigosid unless you stored it to a user field then substituted in that field.

There's really no way to elegantly integrate what you're wanting as CBSubs is encoded. Once the source opens more to Developer subscribers perhaps one of them would be able to develop it for you.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.198 seconds

Facebook Twitter LinkedIn