Builds a list of sort criteria for auction listings. Has no effect until SortAuctionApplySort(type) is called; thus, this function can be called repeatedly to build a complex set of sort criteria. Sort criteria are applied server-side, affecting not only the order of items within one "page" of listings but the order in which items are collected into pages.

Criteria are applied in the order set by this function; i.e. the last criterion set becomes the primary sort criterion (see example).


See also Auction functions.

Signature:

SortAuctionSetSort("list", "sort", reversed)

Arguments:

  • list - Type of auction listing (string)

    • bidder - Auctions the player has bid on
    • list - Auctions the player can browse and bid on or buy out
    • owner - Auctions the player placed

  • sort - Criterion to add to the sort (string)

    • bid - Amount of the current or minimum bid on the item
    • buyout - Buyout price of the item
    • duration - Time remaining before the auction expires
    • level - Required character level to use or equip the item
    • minbidbuyout - Buyout price, or minimum bid if no buyout price is available
    • name - Name of the item
    • quality - itemQuality of the item
    • quantity - Number of stacked items in the auction
    • seller - Name of the character who created of the auction (or in the owner listing, the current high bidder)
    • status - Status of the auction (e.g. in the bidder listing, whether the player has been outbid)

  • reversed - True to sort in reverse order; otherwise false. "Reverse" here is relative to the default order, not to absolute value: e.g. the default order for quality is descending (Epic, Rare, Uncommon, etc), but the default order for level is ascending (1-80) (boolean)

Examples:

-- clear any existing criteria
SortAuctionClearSort("list")

-- then, apply some criteria of our own
SortAuctionSetSort("list", "name")
SortAuctionSetSort("list", "level", 1)
SortAuctionSetSort("list", "quality")

-- apply the criteria to the server query
SortAuctionApplySort("list")

-- results are now sorted by quality, level and name:
--   higher quality items are listed before lower (e.g. Epic, Rare, Uncommon)
--   items with the same quality are sorted descending by level (e.g. 80, 75, 30, 1)
--   items with the same quality and level are sorted alphabetically by name