View Full Version : Need some order tokens
Below are two order confirmation emails from some test orders, the following questions refer to the order details.
I need to get some tokens for specific order data. The five tokens I'm looking for are listed below, each with an example of the value from the examples orders at the bottom of the post.
Order Placed Date -- example: 10/10/2006 -- in my order number 1011
Coupon Code -- example: CU-0106 -- in my order number 1011
Coupon Value -- example: $2.00 -- in my order number 1011
Shipping Amount -- example: $10.00 -- in my order number 1012
Sales Tax Amount -- example: $2.72 -- in my order number 1012
Thank you for help.
The following order was placed with Miva Merchant:
Order Number: 1011
Placed : 10/10/2006 16:45:24 CDT
Ship To: Bill To:
Wes Plate Wes Plate
wesp@automaticduck.com wesp@automaticduck.com
360-568-6805 360-568-6805
Automatic Duck, Inc. Automatic Duck, Inc.
323 2nd Street, Suite 1 323 2nd Street, Suite 1
Snohomish WA 98290 Snohomish WA 98290
US US
Code Name Quantity Price/Ea. Total
-------------------------------------------------------------------------------------------
AD125 Pro Export FCP 3.0 1 $5.00 $5.00
AD136 Pro Import AE 3.0 (Mac) 1 $5.00 $5.00
Coupon - CU-0106: ($2.00)
Shipping: Download Only: $0.00
Sales Tax: $0.85
-------------------------------------------------------------------------------------------
Total: $8.85
The following order was placed with Miva Merchant:
Order Number: 1012
Placed : 10/10/2006 16:54:06 CDT
Ship To: Bill To:
Wes Plate Wes Plate
wesp@automaticduck.com wesp@automaticduck.com
360-568-6805 360-568-6805
Automatic Duck, Inc. Automatic Duck, Inc.
323 2nd Street, Suite 1 323 2nd Street, Suite 1
Snohomish WA 98290 Snohomish WA 98290
US US
Code Name Quantity Price/Ea. Total
-------------------------------------------------------------------------------------------
FULLSuite "Full Suite" Bundle 2 $11.00 $22.00
Shipping: Download + FedEx Ground (inside U.S.): $10.00
Sales Tax: $2.72
-------------------------------------------------------------------------------------------
Total: $34.72
nevadamet
10-29-06, 12:17 AM
I assume you have OUI?
If so, a good list of tokens is here:
http://www.flyinghands.com/OUI_designer/openui_tokens.htm
I think
%VAR(s.time_t|date)%
will return the current date- not necessarily the order date depending on how it is used.
The coupon code tokens would probably be a function of the coupon module- something like:
%module|couponrd|xxxxx%
But, you might see what others suggest.
Vic - WolfPaw Computers
10-29-06, 12:25 AM
Actually you can find all that you need here:
http://smallbusiness.miva.com/support/docs/api/db_HTML/ch2.html#523672
except for the Coupon stuff. You would have to use the token specific for that module. Contact the module developer for the that information.
Syntax in OUI Tokens would be:
%VAR(Orders.d.field)%
Below are two order confirmation emails from some test orders, the following questions refer to the order details.
I need to get some tokens for specific order data. The five tokens I'm looking for are listed below, each with an example of the value from the examples orders at the bottom of the post.
Order Placed Date -- example: 10/10/2006 -- in my order number 1011
Coupon Code -- example: CU-0106 -- in my order number 1011
Coupon Value -- example: $2.00 -- in my order number 1011
Shipping Amount -- example: $10.00 -- in my order number 1012
Sales Tax Amount -- example: $2.72 -- in my order number 1012
Thank you for help.
I searched for "shipping" on the page you suggested but I didn't see the token that would help me get the shipping amount. Can you help direct me?
I tried %VAR(Orders.d.tax)% for the Sales tax, but it returned 0.00 (the tax should have been 1.28 in this test case. Again, what is the token I should use?
I tried %VAR(Orders.d.date)% for the transaction date, it returned 1162057484. This looks like time in seconds, that's cool, I think I can deal with that.
I have emailed Viking Coders, the makers of the coupon module I use, asking for the coupon-related tokens I need.
Thank you everyone.
Vic - WolfPaw Computers
10-30-06, 07:49 PM
The link I posted should have taken you directly to the fields in the Orders.dbf.
The data is in Unix t-time.
Where are you trying to use these tokens? References to the orders database will only work in the INVC screen and order notification.
The link I posted should have taken you directly to the fields in the Orders.dbf.
I don't know what this means. :)
The data is in Unix t-time.
Can you help me with a Mivascript or something that would convert the time to a Date in form MM/DD/YYYY ?
Where are you trying to use these tokens? References to the orders database will only work in the INVC screen and order notification.
I am using Truxoft's XML fulfillment module to send the order as XML to our database, but I need to modify the XML so that I get all the data I need.
Vic - WolfPaw Computers
10-30-06, 08:05 PM
There are several conversion formulas available on Google for converting t-time.
Have you contacted Truxoft for support?
I don't know what this means. :)
Can you help me with a Mivascript or something that would convert the time to a Date in form MM/DD/YYYY ?
I am using Truxoft's XML fulfillment module to send the order as XML to our database, but I need to modify the XML so that I get all the data I need.
There are several conversion formulas available on Google for converting t-time.
Have you contacted Truxoft for support?
Yes, there were problems with the plug-in and they fixed that.
But getting the tokens I need, that's not the job of truxoft, I thought, I just need the data that Miva obviously has.
I can tell you're not willing to provide direct answers to my questions. Can I hire you to quickly get this done for me?
Success!
Thank you to WolfPaw Computers and to Ivo at Truxoft for help and patience.
Here is what I did to get the data I needed into MmXML:
<TxLOOP NAME="OrderCharges" FILTER="external">
<MvIF EXPR="{'Coupon' IN '%desc%'}">
<MvASSIGN NAME="CouponCode" VALUE=%desc%>
</MvIF>
<MvIF EXPR="{'Coupon' IN '%desc%'}">
<MvASSIGN NAME="CouponAmount" VALUE=%disp_amt%>
</MvIF>
<MvIF EXPR="{'Tax' IN '%desc%'}">
<MvASSIGN NAME="SalesTaxAmount" VALUE=%disp_amt%>
</MvIF>
<MvIF EXPR="{'Shipping' IN '%desc%'}">
<MvASSIGN NAME="ShippingAmount" VALUE=%disp_amt%>
</MvIF>
</TxLOOP>
Then I put the variables I defined into my XML. I'm happy!
Thanks.
klassic
12-15-06, 12:21 AM
Thank you very much for posting that code. It had a snippet i needed to edit our Ultra Batch Invoices. Gotta love all the help you get here.
Here is what I did to get the data I needed into MmXML:
-snip-
Then I put the variables I defined into my XML. I'm happy!
I'm resurrecting this old old thread because I need to make a change and I need help. The script above worked great for extracting the coupon code and the coupon amount that was in the order when I was using Viking Coders' Coupon Manager module by itself. But now I wish to use BOTH Coupon Manager and also Emporium Plus' Coupon Redemption module.
I need to modify my script so it finds both sets of coupon codes and coupon amounts, right now I'm guessing it finds one module's set then overwrites the variable with what it finds from the other module.
I was thinking it would be cool to see the raw data that the script is looping through to parse out the variables. Then I could see the difference between what the two modules put into their %desc% fields.
Is there a variable I can use to print the entire raw data from the basket charges?
That data is retrieved with the standard API. Both records are in the order charges database. All email modules should be displaying all the records in the order charges database without using tokens. You need to contact truxoft if there is a problem in their specific module and not in other email modules. Since merchant can have multiple coupons, all email modules should display them all not using tokens.
I am sorry I never followed up with my solution to this most-recent question.
I was able to retrieve the second coupon data by modifying the script that runs at the head of my XML module...
<TxLOOP NAME="OrderCharges" FILTER="external">
<MvIF EXPR="{'Coupon - ' IN '%desc%'}">
<MvASSIGN NAME="CouponCode" VALUE=%desc%>
</MvIF>
<MvIF EXPR="{'Coupon - ' IN '%desc%'}">
<MvASSIGN NAME="CouponAmount" VALUE=%disp_amt% ROUND 2>
</MvIF>
<MvIF EXPR="{'Coupon: ' IN '%desc%'}">
<MvASSIGN NAME="CouponCode2" VALUE=%desc%>
</MvIF>
<MvIF EXPR="{'Coupon: ' IN '%desc%'}">
<MvASSIGN NAME="CouponAmount2" VALUE=%disp_amt% ROUND 2>
</MvIF>
<MvIF EXPR="{'Tax' IN '%desc%'}">
<MvASSIGN NAME="SalesTaxAmount" VALUE=%disp_amt% ROUND 2>
</MvIF>
<MvIF EXPR="{'Shipping' IN '%desc%'}">
<MvASSIGN NAME="ShippingAmount" VALUE=%disp_amt%>
</MvIF>
</TxLOOP>
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.