c. 1400, "engage in business transactions, discuss or arrange terms of a transaction; to vend or sell," from Old French bargaignier "to haggle over the price" (12c., Modern French barguigner), perhaps from Frankish *borganjan "to lend" or some other Germanic source, ultimately from Proto-Germanic *borgan "to pledge, lend, borrow" (source also of Old High German borgen; Old English borgian; from PIE root *bhergh- (1) "to hide, protect;" compare borrow).
Diez and others suggest that the French word comes from Late Latin barca "a barge," because it "carries goods to and fro." There are difficulties with both suggestions. Related: Bargained; bargaining. To bargain for "arrange for beforehand" is from 1801.