In this expression, the noun poke denotes a bag, a small sack. It is from Anglo-Norman and Old Northern French forms such as poke and pouque, variants of the Old French forms poche and pouche — the last of which is the origin of English pouch. (Incidentally, English pocket is from Anglo-Norman poket, pokete, diminutive forms of poke.)
The expression to buy a pig in a poke simply cautions against buying or accepting something without first seeing or assessing it: if you don’t want to end up with something of less value than expected, you must ‘look in the bag’, that is to say inspect the merchandise carefully. It is similar to Latin caveat emptor, literally let the buyer beware.
The metaphor is recorded as early as around 1275 in the poem called The Proverbs of Hendyng:
Wan man ȝevit þe a pig, opin þe powch (= When a man gives thee a pig, open the pouch).
A manuscript dating from around 1450 has:
When me[n] profereth þe pigge, opon þe pogh,
For when he is an olde swyn, thow tyte hym nowȝt.
When a man proffers the pig, open the pough [= bag],
For when it is an old swine, thou do not take it.
Produced during the years 1503-36, the commonplace book of Richard Hill, a London grocer, contains
When ye proffer the pigge open the poke.
together with such proverbs as “Better yt ys late than never.” and “A gode begynnyng makyth a gode endyng.”
In Two hundred epigrammes, vpon two hundred prouerbes with a thyrde hundred newely added and made by Iohn Heywood (1555), the English playwright and epigrammatist John Heywood (1496?-1578?) wrote:
Bying a Pyg:
I wyll neuer bye the pyg in the poke:
Thers many a foule pyg in a feyre cloke [= a fair cloak].
A variant of to buy a pig in a poke, to buy a cat in the sack seems to have been used only once; it is found in De Blasphemia, contra Fratres (around 1380), by the English religious reformer John Wycliffe (circa 1330-84):
To bye a catte in þo sakke is bot litel charge : to bye chirchis by symonye semes sumwhat siker : bot for to bye þus heven and broþerhed of Crist, hit semes chaffere of Lucifer, and withouten grounde.
To buy a cat in the sack is but little charge; to buy churches by simony seems somewhat safe; but as for buying thus heaven and brotherhood of Christ, it seems chaffer [= trade] of Lucifer, and without ground.
This corresponds to the obsolete French expression acheter chat en poche, or en sac, literally to buy cat in poke, or in sack. The following is from A Dictionarie of the French and English Tongues (1611), by Randle Cotgrave:
Acheter chat en poche, ou en sac. We say, to buy a pig in a poke.
French also had vendre chat en poche, literally to sell cat in poke, and acheter le chat pour le lièvre, to buy the cat for the hare.
A popular but erroneous theory, of which many variants exist, establishes a connection between to buy a pig in a poke and to let the cat out of the bag.
According to this theory, a dishonest farmer, claiming to be selling a young pig, might substitute a cat in a tied bag. A circumspect buyer would examine the purchase on the spot; an unwary one would not do so until it was too late. Either way, the cat would then be out of the bag and the truth would be known.
This theory makes little sense, because a live cat in a bag can hardly be mistaken for a piglet.
Additionally, the phrase to let the cat out of the bag, which is only recorded in the second half of the 18th century, about five centuries after the metaphor a pig in a poke, has only been associated with the latter within the context of this erroneous theory.
The existence, prior to that of to let the cat out of the bag, of the English and French phrases to buy a cat in the sack and acheter/vendre chat en poche is not a counterargument, as the latter phrases have never appeared in contrast to the metaphor conveyed by the former. As for acheter le chat pour le lièvre, it refers to a dead cat substituted for a dead hare in a hunter’s game bag.