Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

sucess.phtml “add varaibles for affliate program”
 
muzziahmed
Jr. Member
 
Total Posts:  10
Joined:  2012-05-06
 

Hi,

i have this store http://www.gardenfurnitureking.co.uk/
i need to integrate this script on the success page in order to track affliate sales.

the code is as follows:
<script language="javascript\" src="http://scripts.affiliatefuture.com/AFFunctions.js"></script>
<script language="javascript\">

var merchantID = xxxx;
var orderValue = ‘ORDER_VALUE’;
var orderRef = ‘ORDER_REF’;
var payoutCodes = ‘’;
var offlineCode = ‘’;

AFProcessSaleV2(merchantID, orderValue, orderRef,payoutCodes,offlineCode);
</script>

what i need is what should be the var orderValue and var orderRef.

is it unique for every store or its universal, if its universal can any one guide me, if its unique can any one help me out here ?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

ORDER_REF probably is the Sales Order number
ORDER_VALUE probably is the total currency value of the order

You will need to ask the people who handed you off this fine piece of code as to if this really is true.

The code would look something like this. I’ll leave the implementation details to you.

<?php
$quoteId 
Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId())->getQuoteId();
$quote Mage::getModel('sales/quote')->load($quoteId);
$ordervalue $quote->getGrandTotal();
?>

<script language="javascript" src="http://scripts.affiliatefuture.com/AFFunctions.js"></script>
<script language="javascript">

var 
merchantID  xxxx;
var 
orderValue  '<?php echo $ordervalue; ?>';
var 
orderRef    '<?php echo $this->getOrderId(); ?>';
var 
payoutCodes '';
var 
offlineCode '';

AFProcessSaleV2(merchantIDorderValueorderRef,payoutCodes,offlineCode);
</script>
 
Magento Community Magento Community
Magento Community
Magento Community
 
muzziahmed
Jr. Member
 
Total Posts:  10
Joined:  2012-05-06
 

Hello friend,

You are a life savor, i have been struggling with this for like a week now and i just copied this and it worked instantly.

I am really really thankful.

Keep Rocking !!

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

You’re welcome!

And for anyone else, the basic engine to retrieve the quote is there to do a summarized printable order placement confirmation page.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top