4.3 ww.dll API Reference : API descriptions : Functions with database access : getitem
 
getitem
 
Note: Unless you have a good reason for not doing so, use getitemexpanded instead of getitem.
 
Description
getitem gets an item. <calcprice> uses the current date or the date passed in the <datetime> 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 all are included in each <item> section when passed to the processsale function. If <max4sale> is sent as true (<max4sale>1</max4sale>), and then information is sent back in the qty_rem field with the number left to sell at that <datetime>. Otherwise, a “-” is 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, the discounted price is not returned.
 
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.
<department>
<item> department.
<category>
<item> category.
<item>
Item.
<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. See main description of this call for an example.
<calcprice>
Optional. Boolean (1 = calculate the price, 0 = don’t calculate the price)
<max4sale>
Optional. Boolean (1 = return Max4Sale information, 0 = don’t return Max4Sale information)
<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 capbility 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.
<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.
<fields>
Optional. Fields to be returned. See Note on the <fields> tag.
<mktgcode>
Optional. Marketing code. See ww.dll now supports specials.
<srcecode>
Optional. Source code. See ww.dll now supports specials.
 
Return fields
XML recordset of the matching record from the items table.
 
Field
Description
department
Department.
category
Category.
item
Item.
descrip
Description.
price_type
Price type.
dp_set_id
The set of Dynamic Pricing Rules to apply first.
price_cols
Price columns – 1, 2 or 3.
wknd_start
Weekend start.
wknd_end
Weekend end.
rate_sched
Rate schedule.
daily_pric
Daily price.
monday_0
Default price.
monday_1
Price during special rate period 1.
monday_2
Price during special rate period 2.
monday_3
Price during special rate period 3.
monday_4
Price during special rate period 4.
monday_5
Price during special rate period 5.
tuesday_0
Default price.
tuesday_1
Price during special rate period 1.
tuesday_2
Price during special rate period 2.
tuesday_3
Price during special rate period 3.
tuesday_4
Price during special rate period 4.
tuesday_5
Price during special rate period 5.
weds_0
Default price.
weds_1
Price during special rate period 1.
weds_2
Price during special rate period 2.
weds_3
Price during special rate period 3.
weds_4
Price during special rate period 4.
weds_5
Price during special rate period 5.
thursday_0
Default price.
thursday_1
Price during special rate period 1.
thursday_2
Price during special rate period 2.
thursday_3
Price during special rate period 3.
thursday_4
Price during special rate period 4.
thursday_5
Price during special rate period 5.
friday_0
Default price.
friday_1
Price during special rate period 1.
friday_2
Price during special rate period 2.
friday_3
Price during special rate period 3.
friday_4
Price during special rate period 4.
friday_5
Price during special rate period 5.
saturday_0
Default price.
saturday_1
Price during special rate period 1.
saturday_2
Price during special rate period 2.
saturday_3
Price during special rate period 3.
saturday_4
Price during special rate period 4.
saturday_5
Price during special rate period 5.
sunday_0
Default price.
sunday_1
Price during special rate period 1.
sunday_2
Price during special rate period 2.
sunday_3
Price during special rate period 3.
sunday_4
Price during special rate period 4.
sunday_5
Price during special rate period 5.
tax_rate
Tax rate.
tax_rate_b
Tax rate is defined in defaults table.
cust_tax
Custom tax rate.
cust_tax_b
Custom tax rate is defined in defaults table.
fee_rate
Fee rate.
add_tax
Add tax.
add_tax_b
Add tax b.
time_span
Time span.
span_type
Span type.
admissions
Admissions.
split_type
Split type.
item_type
Item type.
validate
Validate.
validate2
Additional validation.
ckmax4sale
Check Max4Sale capability.
ckpts4sale
Check Points4Sale capability.
pts4saledp
Dynamic Pricing Rule to use to calculate Points4Sale points to deduct.
novalonret
When a “forced validation” item is returned, the salespoint makes sure the pass is valid prior to returning it?
set_price
Set price.
inventory
Inventory.
invent_id
Inventory ID.
barcode
Barcode.
upc
UPC.
keycode
Keycode.
keydescrip
Key description.
mod_reqd
Modifier required?
multiline
Multiline.
help_info
Help information.
price_info
Price information. Includes final price, tax and fee information.
qty_rem
If <max4sale> is sent as true (<max4sale>1</max4sale>), then information is sent back with the number left to sell at that <datetime>. Otherwise, a - is returned in that field.
pts_cost
If <calcpoints> is sent as true (<calcpoints >1</calcpoints>), then information is sent back with the points cost of each item (at qty=1).
avail_info
Values returned as a result of using the <avail> tag. See Note on the <avail> tag.
price_xml
Price information. If the <pass_no> tag is sent in and the corresponding pass template contains a specials 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. See main description of this call for an example.
 
Example
 
Example invocation:
<func>getitem</func><department>FBBAR</department><category>BEER</category><item>BTL-COORS</item><calcprice>1</calcprice>
 
Example return string:
OK :…recordset
<rs:data>
<z:row department='FBBAR ' category='BEER '
item='BTL-COORS ' descrip='Coors - Bottle '
price_type='0' dp_set_id='0' price_cols='1' wknd_start='0'
wknd_end='0' rate_sched='1' daily_pric='1' monday_0='2.5'
monday_1='0' monday_2='0' monday_3='0' monday_4='0' monday_5='0'
tuesday_0='0' tuesday_1='0' tuesday_2='0' tuesday_3='0'
tuesday_4='0' tuesday_5='0' weds_0='0' weds_1='0' weds_2='0'
weds_3='0' weds_4='0' weds_5='0' thursday_0='0' thursday_1='0'
thursday_2='0' thursday_3='0' thursday_4='0' thursday_5='0'
friday_0='0' friday_1='0' friday_2='0' friday_3='0' friday_4='0'
friday_5='0' saturday_0='0' saturday_1='0' saturday_2='0'
saturday_3='0' saturday_4='0' saturday_5='0' sunday_0='0'
sunday_1='0' sunday_2='0' sunday_3='0' sunday_4='0' sunday_5='0'
tax_rate='2' tax_rate_b='1' cust_tax='.0000' cust_tax_b='.0000'
fee_rate='1' add_tax='False' add_tax_b='False' time_span='0'
span_type='1' admissions='.00' split_type='1' item_type='1'
validate='1' validate2='False' ckmax4sale='False' ckpts4sale='False'
pts4saledp='0' novalonret='False' set_price='False' inventory='False'
invent_id='0' barcode=' ' upc=' '
keycode='0' keydescrip=' ' mod_reqd='0' multiline='False'
help_info='' price_info='2.5000,0.1636,0.0000,0.1636,0.0000'
price_xml='[ext]2.5000[/ext][tax]0.1636[/tax][fee]0.0000[/fee][txa]0.1636[/txa][txb]0.0000[/txb][dwp]0.0000[/dwp][in]2.5000[/in][sp][/sp]'/>
</rs:data>
 
See also
getitemexpanded
getitemtree
getmods
processsale