I scan the tooltip for the BIND_TRADE_TIME_REMAINING string
Code:
local tip = CreateFrame("GameTooltip","Tooltip",nil,"GameTooltipTemplate")
local function isTradable(itemLocation)
local itemLink = C_Item.GetItemLink(itemLocation)
tip:SetOwner(UIParent, "ANCHOR_NONE")
tip:SetBagItem(itemLocation:GetBagAndSlot())
tip:Show()
for i = 1,tip:NumLines() do
if(string.find(_G["TooltipTextLeft"..i]:GetText(), string.format(BIND_TRADE_TIME_REMAINING, ".*"))) then
return true
end
end
tip:Hide()
return false
end