What tokens can I use to export data about coupons, gift certificates, and other "charges"?
Q (2004/10/04): What tokens can I use to export data about coupons, gift certificates, and other "charges"?
A: You can access these "charges" by using the tokens:
%order_chargedescription#%: the desription of the charge as saved by that module
%order_chargeamount#%: the raw amount of the charge
where # is a number. Number 1 will be the first charge stored by Merchant; 2 will be the second, etc. If there is no charge corresponding with a number, nothing will be export.
In addition, there is a conditional token:
%begin_if_ordercharge|#|%
....
%end_if%
will display it's contents only if there is an order charge #.
So, to add coupon data (for example) to your export and you typically have only 1 charge (eg. you have the Coupon module installed), then you could add a "column" to your exported information. For example, in the "Merchant Flat File Default" template (which is the format used by Merchant's own "order export to flat file" module) you could add a field to the header:
ORDER_ID|PROCESSED|ORDER_DATE|ORDER_TIME|ORDER_ID|PROCESSED|ORDER_DATE|ORDER_TIME|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_FAX|BILL_ADDR|BILL_CITY|
BILL_STATE|BILL_ZIP|BILL_CNTRY|PROD_CODE|PROD_NAME|PROD_UPSLD|PROD_PRICE|PROD_QUANT|PROD_ATTR|
PROD_OPT|OPT_PRICE|ORDER_TAX|ORDER_SHIP|ORDER_TOTL|CHARGE_DESC|CHARGE_AMOUNT
and then add it to the "order area":
%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%|%charge_description1%|%charge_amount1%
You should probably also add some "dummy" columns to the "product area" so that there are the same number of columns:
%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%||
and the "attributes area" for the same reason:
%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%||
Last update: 2006-02-13 20:59
Author: Support
Revision: 1.0
You cannot comment on this entry
Most Recent FAQ Entries: 
- I have the module configured to add the key ... (2008-08-13 14:50)
- What is the format for the htaccess file if ... (2008-08-12 14:50)
- Is there any way to look up a customer's ... (2008-08-06 18:04)
- I am looking for a module that will allow ... (2008-08-06 18:00)
- Is it possible to display a link in Phone ... (2008-08-06 12:05)
Top 10 
- 2754 views:
Adding Tokens to Evaluate Expressions - 2697 views:
Is there a way to "Limit" the number of ... - 2654 views:
Why won't you call me for technical support? I ... - 2549 views:
Are license keys valid for more than one store? ... - 2447 views:
I'm trying to enter a license key and get ... - 2425 views:
How do I install a module? - 2286 views:
How do I check for a module upgrade? - 2254 views:
How can display and change the parameters of an ... - 2097 views:
The total on my checkout pages are not correct. ... - 1932 views:
I have select and radio type attributes in my ...
















