4.3 ww.dll API Reference : API descriptions : Functions with database access : getitemtree : Example:
 
Example:
IF(DATE(SUB(RANGE1)) AND DCI(,,ONE),SETPRICE(10))
IF(DATE(SUB(RANGE1)) AND DCI(,,TWO),SETPRICE(15))
IF(DATE(SUB(RANGE1)) AND DCI(,,THREE),SETPRICE(20))
 
Previously, this would get the RANGE1 rule three times from the database during a getitemexpanded or getitemtree call. Now, it only gets retrieved once. This can lead to a substantial speed improvement with complicated Dynamic Pricing Rules.
 
 
<calcprice> uses the current date or the date passed in the <date_time> tag to calculate the price. The prices are included in the return string in the price_info field, including final price, tax and fee information. These are all included in each <item> section when passed to the processsale function. If <max4sale> is sent as true (<max4sale>1</max4sale>), then information is sent back in the qty_rem field with the number left to sell at that <datetime>. Otherwise, a “-” be returned in that field.
With regard to the <pass_no> field, if the corresponding pass template contains a special macro (e.g., SELECTLAST()ITEMSPECIAL ("ONLINE ")), then a discounted price is returned in price_xml in the [ext] field. The specials can be any of the following in the macro for the pass template: selectivespecial, globalspecial, itemspecial or special. If the pass is voided or expired, then the discounted price is not returned. For example, the following shows a sample call containing a pass number and what is returned in price_xml:
 
<func>getitem</func><department>TEST</department><category>TEST</
category><item>MAIN</item><pass_no>321003010</pass_no><calcprice>1</calcprice>

price_xml='[ext]98.00[/ext][tax]0.00[/tax][fee]0.00[/fee][txa]0.00[/txa]
[txb]0.00[/txb][dwp]0.00[/dwp][in]100.00[/in]'
 
Input fields
 
XML tag
Description
<qty>
Optional. Quantity. Price returned is for specified quantity instead of per unit. If no <qty></qty> tags are passed, then ww.dll assumes the quantity is 1 and returns the price for a quantity of 1. See How ww.dll reacts to quantity tags for more information.
<head> (or <headdesc>)
Head node or 0 for the root.
<date_time>
Date/time of interest.
<datetime>
ww.dll allows <datetime>*</datetime> to be passed in the getitemtree call. This causes all date checks to be ignored and return any item or node which has ever been available. Inactive elements are still removed.
<account>
Optional. An account nickname. When used, item price information is returned based on any Dynamic Pricing Rule associated with the account. If a user is logged into a group (which is really an account), that group name is passed to ww.dll when getting product prices and any Dynamic Pricing Rule assigned to that account is applied to the prices.
 
Note: In order for Dynamic Pricing Rules assigned to accounts to work correctly in E-Commerce module, you must add the following settings to the [Preferences] section of the Sales32c.INI file for the Sales Host and the salespoint where you recall these sales:
[Preferences]
ApplyAccountRulesOnRecall=FALSE
RecalculatePriceOnRecall=FALSE
 
Without these settings in place, you see incorrect pricing on recall of these sales.
<pass_no>
Optional. Pass number. If the corresponding pass template contains a special macro (e.g., SELECTLAST()ITEMSPECIAL ("ONLINE ")), then a discounted price is returned in price_xml in the [ext] field. The specials can be any of the following in the macro for the pass template: selectivespecial, globalspecial, itemspecial or special. If the pass is voided or expired, then the discounted price is not returned. For an example, see getitem.
<calcprice>
Boolean. 1 = calculate the price. 0 = don’t calculate the price.
<max4sale>
Optional. Boolean. If Max4Sale is sent as true (<max4sale>1</max4sale>), then a tag is returned in the qty_rem field with the number left to sell at that <date>. Otherwise, a - is returned in that field.
<calcpoints>
Optional. Boolean. If 1, a point cost of each item (at qty=1) is returned as <pts_cost>.
Note: The ckpts4sale (is Points4Sale enforced) and pts4saledp (Dynamic Pricing Rule to use to calculate Points4Sale points to deduct) fields from the items table must be obtained in the field list from the item record (e.g., <fields>it.department, it.category, it.item, i.ckmax4sale, ckpts4sale, pts4saledp</fields>). Also note that all item reservation functionality works the same for Points4Sale as it does for Max4Sale capability except that the total point cost is stored in the item_res.pts4qty field.
<avail>
Optional. Returns information on whether a particular item is available based on Max4Sale or Points4Sale restrictions for a certain date or date range. If the tag is absent or is specified as <avail>0</avail>, nothing is calculated. See Note on the <avail> tag.
<getchildnodes>
Optional. Returns all child items and groups as well. Boolean.
<fields>
Optional. Fields to be returned. Note on the <fields> tag.
<type_?>
Optional. Boolean for the type_1 to type_10 fields. Any fields that need to be matched can be specified. For example, if you only want matches where the type_10 is set to TRUE, use <type_10>1</type_10>. If you wanted only matches where all types are 0 except for type 10, specify:
<type_1>0</type_1><type_2>0</type_2>
<type_3>0</type_3><type_4>0</type_4>
<type_5>0</type_5><type_6>0</type_6>
<type_7>0</type_7><type_8>0</type_8>
<type_9>0</type_9><type_10>1</type_10>
<mktgcode>
Optional. Marketing code. See ww.dll now supports specials.
<node_id>
The ww.dll function getitemtree allows specifying what to get by node_id. Either an individual
node_id or a comma delimited list is allowed.
 
Example:
 
<func>getItemTree</func><node_id>70783</node_id> or
<func>getItemTree</func><node_id>70783, 70784, 621</node_id>
 
Getitemtree, allows specifying what to return by <head>, <headdesc>, <salespoint>, and now <node_id>.
 
<srcecode>
Optional. Source code. See ww.dll now supports specials.
 
Return fields
XML recordset of a join between the itemtree table and the items table.
 
Note: For more information on the price_info, qty_rem and price_xml fields that are returned, see getitem, getitemexpanded and getmods.
 
Example
 
Example invocation:
<head>0</head><datetime>12-19-2006 07:00:00</datetime>
 
Example return string:
OK :…recordset
<rs:data>
<z:row descrip='**MISC** ' department=' '
category=' ' item=' ' node_id='621'
parent_id='0' sort_order='1'/>
<z:row descrip='**TIPS** ' department=' '
category=' ' item=' ' node_id='651'
parent_id='0' sort_order='2'/>
<z:row descrip='Golf - Tee Time Sched. ' department=' '
category=' ' item=' ' node_id='925'
parent_id='0' sort_order='3'/>
<z:row descrip='Retail ' department=' '
category=' ' item=' ' node_id='1112'
parent_id='0' sort_order='4'/>
<z:row descrip='Food Service - Bar ' department=' '
category=' ' item=' ' node_id='9015'
parent_id='0' sort_order='5'/>
<z:row descrip='Food Service - Cafe/Coffe' department=' '
category=' ' item=' ' node_id='1301'
parent_id='0' sort_order='6'/>
<z:row descrip='Food Service - Table Serv' department=' '
category=' ' item=' ' node_id='1300'
parent_id='0' sort_order='7'/>
<z:row descrip='Admissions ' department=' '
category=' ' item=' ' node_id='1450'
parent_id='0' sort_order='8'/>
<z:row descrip='Kiosk ' department=' '
category=' ' item=' ' node_id='1853'
parent_id='0' sort_order='9'/>
<z:row descrip='WEB ' department=' '
category=' ' item=' ' node_id='1170'
parent_id='0' sort_order='10'/>
<z:row descrip='Rentals ' department=' '
category=' ' item=' ' node_id='7521'
parent_id='0' sort_order='11'/>
<z:row descrip='Call Center ' department=' '
category=' ' item=' ' node_id='8350'
parent_id='0' sort_order='12'/>
<z:row descrip='TEST VISTA ' department=' '
category=' ' item=' ' node_id='18443'
parent_id='0' sort_order='13'/>
</rs:data>
 
See also
getitem
getitemexpanded
getmods
processsale