Miva Merchant 5 Module FAQs » Affiliate Manager 5.x (BROK_AFFILIATES5)


{docurl}

How do I display data from Affiliate Manager in the orders exported by Generic Orders Export?

The Affiliate Manager can now provide information about the referring  affiliate and the resulting order for the Generic Orders Export module.

At the top of the field in the Generic Orders Export template that you want to dispaly the affiliate data add the item/token:

<mvt:item name="BROK_AFFILIATES" param="define_variables" />

when that token is processed it defines certain global variables:

g.AffiliateData:code
g.AffiliateData:id
g.AffiliateData:fname
g.AffiliateData:lname
g.AffiliateData:email
g.AffiliateData:company
g.AffiliateData:phone1
g.AffiliateData:phone2
g.AffiliateData:fax
g.AffiliateData:address    
g.AffiliateData:city                                                
g.AffiliateData:state                                                
g.AffiliateData:country                                                                                                
g.AffiliateData:payout
g.AffiliateData:referredby

These can then be displayed in the Generic Orders Export module with the %var|expression|% token.  For example,

%var|g.AffiliateData:code|%

will display that order's referring affiliate code (if there one).

As an example, the Generic Orders Export template for the "Merchant Flat File Default"'s Order area has the contents:

%orderid%|%processed%|%orderdate%|%ordertime%|%ship_fname%|%ship_lname%|%ship_email%|%ship_comp%|
%ship_phone%|%ship_fax%|%ship_addr%|%ship_city%|%ship_state%|%ship_zip%|%ship_cntry%|%bill_fname%|
%bill_lname%|%bill_email%|%bill_comp%|%bill_phone%|%bill_phone%|%bill_fax%|%bill_addr%|%bill_city%|%bill_state%|
%bill_zip%|%bill_cntry%|%prodcode%|%prodname%|%produpsold%|%prodprice%|%prodquantity%|%attrcode%|%optcode%|%attrprice%|
%totaltax%|%totalshipping%|%ordertotal%|

To display the affiliate's code at the end of that template you would add the <mvt:item at the beginning and the %var|g.AffiliateData:code|% to the end. So you would have:

<mvt:item name="BROK_AFFILIATES" param="define_variables" />
%orderid%|%processed%|%orderdate%|%ordertime%|%ship_fname%|%ship_lname%|%ship_email%|%ship_comp%|
%ship_phone%|%ship_fax%|%ship_addr%|%ship_city%|%ship_state%|%ship_zip%|%ship_cntry%|%bill_fname%|
%bill_lname%|%bill_email%|%bill_comp%|%bill_phone%|%bill_phone%|%bill_fax%|%bill_addr%|%bill_city%|%bill_state%|
%bill_zip%|%bill_cntry%|%prodcode%|%prodname%|%produpsold%|%prodprice%|%prodquantity%|%attrcode%|%optcode%|%attrprice%|
%totaltax%|%totalshipping%|%ordertotal%|%var|g.AffiliateData:code|%

Note, this will also work in other modules besides Generic Orders Export. It requires only that the l.settings variable has the order's data stored in l.settings:order.



Last update: 2008-03-31 21:42
Author: Thor
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry