XactCommerce Xact Objects
Home
News
XactCommerce
Typical Applications
Custom Development
Private Backend
XactScript Language
Performance
Deployment
Partners
Portfolio
About Us
leXml Language < Interface Modules & Commands < If_ItemBrowserV1

If_ItemBrowserV1
ItemBrowser interface provides commands to list and show items.

load
Called to load a list of items into the session.
 
Optional arguments:
owner_id = Owner ID of items to browse or 0 for all owners (default=all)
item_id = use if you just want a single item_id (default=all)
category = category:subcat:subsubcat:... (with * in any field meaning match any) (default=*)
altcat = altcat:altsubcat:... (with * in any field meaning match any) (default=*)
countaltcats = (true/false) - if true returns a count of how many instances of the passed altcat value are found (ALTCATCOUNT), if not then only finds results of where the altcat are found are greater than 0 (make sense?)
saleonly = Show only sale items? true/false (default=false)
hotonly = Show only hot items? true/false (default=false)
salefirst = Place sale items first? true/false (default=true)
hotfirst = Place hot items first? true/false (default=true)
orderby = Valid values: name,priceasc,pricedesc,id,partno,none (default=name)
item_lessprice= Item prices are less than this value
item_greaterprice= Item prices are greater than this value
item_cat= Category [LIKE] search field
search_text = Any text used to search in item name or descriptions
search_mask = A wildcard mask (* and ? allowed) to search item names
item_invtype = item inventory type.. if not given defaults to !='A' and !='R' (don't show accounts or articles)
prev_cli_id = Only show items previously ordered by this client (default=all)
prev_line_refno = Only show items previously ordered with this ref_no in the line
item_alt_pno = Only show items with this in its alternate part number list
item_upsell_pno = Only show items with this in its upsell part number list
item_accessory_pno = Only show items with this in its accessory part number list
item_alt_id = Only show items with this item id's part number in its alternate part number list
item_upsell_id = Only show items with this item id's part number in its upsell part number list
item_accessory_id = Only show items with this item id's part number in its accessory part number list
countreleases = Include a count of number of open releases left for this item
countprevlines = Include a count of how many times this item occurs in an open line item
prevlinesexist = When passed with countprevlines, only results will show if prev_line_count>0. true/false (default=false)
showlastreldate = Include the date of the last release with this is true (default=false)
pastauthreldays = How items with last release date this many days or less in the past
prevlinerefsarenull = Only include items found where the prev_line_refno's are null (default=false)
PrevLineRefsAreSameOrNull = Only include items found where the line_refno's = prev_line_refno_look or are null (default=false)
prev_line_refno_look = line_refnos to look at when looking at PrevLineRefsAreSameOrNull
prevlinesqlclause = an extra sql clause to add when looking at previous lines
showsum = show sub items (default=no)
sumid = only if showsum is yes. selects item with this sumid & shows features


resume
Resumes an existing item browse session
Optional arguments:
startat - Item counter to start at (default=-1)
Returns 'yes' or 'no' depending on whether there was a session to resume


isready
Returns 'yes' or 'no' depending on if we have any more items to view
This will also return 'no' if we've just loaded an item list but haven't called next yet!


hasnext
Returns 'yes' or 'no' depending on whether there is a next item


next
Moves to next item and returns 'yes' or 'no' like isready


prev
Moves to previous item and returns whether or not cursor is ready


rewind
Rewinds item counter


getcounter
Returns and prints the item counter


templateitemlist
This command allows a different approach to the listing of items. It loops 'itemcount' times and uses 'template' to create the HTML to list. 'template' contains HTML and can contain a series of special macros that will be replaced with specific info about the item. The item list also stops if no more items are available.
 
Here are the macros that can be included in the template:
##COUNT## - Replaced with a counter starting at 0
##NAME## - Name of item
##ESCNAME## - Name of item (URL Encoded)
##PRICE## - Item price (use the 'pricelevel' argument to select level)
##HOT## - Will be replaced with contents of 'hottmpl' argument if hot
##SALE## - Will be replaced with contents of 'saletmpl' argument if sale
##LONGDESC## - Long description
##SHORTDESC## - Short description
##TINYDESC## - Tiny description
##PHOTO## - URL to item photo
##TNPHOTO## - URL to tiny item photo
##PARTNO## - Item part no
##FEATURE## - Replaced with item feature
##FEATURE2## - Replaced with item feature 2
##DATE## - Replaced with item date (MM/DD/YYYY)
##DATEMONTH## - Replaced with item date month
##DATEMDAY## - Replaced with item date month day
##DATEYEAR## - Replaced with item date year
##ID## - Replaced with item ID
##CLI_ID## - Replaced with item owner client ID
##EMP_ID## - Replaced with item owner employee ID
##SALEPRICE## - Replaced with item sale price
##UNIT## - Item unit field
##ALT## - This will alternate between 0 and 1
##FILE## - Item File
##RELAUTHCOUNT## - number of authorized releases for this item with the associated passed ref_no in an open order (prev_line_refno has to be there in load command or else this is 0)
##REFNOCOUNT## - number of times this item occurs in an open order with the associated passed ref_no field (prev_line_refno has to be there in load command or else this is 0)
##RELEASECOUNT## - number of times this item has been released in an open release order (countreleases has to be "yes" in load command or else this is 0)
##PREVLINECOUNT## - number of times this item shows up in a previous open release order
##LASTRELDATE## - the last date this item was released in a release order
##ALTCATCOUNT## - count of alternative categories
 
Arguments:
itemcount - Number of items to display (default=10)
template - The main HTML template as described above (required)
hottmpl - Template to display for ##HOT##
saletmpl - Template to display for ##SALE##
pricelevel - Price level for ##PRICE## (default=0)
blankimage - Image to use if no photo or tinyphoto exists (default=blank.gif)
jsescape -Whether to jsEscape the results (default=no)
usefile - Whether to load the file (default=no)
filebackend - Whether to force laoding the file from the back-end location (default=no)
 
Returns how many items were actually printed or "error:..." if an error occurred.


These are commands to print/get info about the current item They do nothing if we're not ready with an item in the result cursor! All of these that print something support 'prefix' and 'postfix'.


isonsale
Returns whether item is on sale


ishot
Returns 'yes' or 'no' depending on whether item is hot


name
Prints item name


longdesc
Prints item long description


shortdesc
Prints short description


tinydesc
Prints tiny description


feature
Prints item feature


imageprefix
Prints image prefix


unit
Prints item_unit field


getcategory
Prints and returns category at depth=??? (starts at 1)


hasphoto
Returns 'yes' or 'no' depending on whether the item has a photo


hastnphoto
Returns 'yes' or 'no' depending on whether the item has tiny photo


photo
Prints item photo with imageprefix
Caller is responsible for putting image tags in prefix and postfix
The 'blankimage' attribute should be the full URL path to the image to use for blank or null image fields.


tnphoto
Same as above for tiny photo


price
Prints and returns item price


saleprice
Prints and returns item sale price


itemid
Prints and returns item ID


cli_id
Prints and returns cli_id and emp_id


totalitemcount
Prints and returns total number of items in current cursor


remainingitemcount
Prints and returns number of items remaining If 'truncateto' is set, this value will be limited to 'truncateto' (e.g. for doing 'view next ## items')


partno
Prints and returns item part #