There's a popular curse "Gey kakn oyfn yam" (גײ קאַקן אױפֿן ים) which literally means go take a crap on the sea. It could be used in that situation, but emphasizes where the peddler can go as oppose to the actual act of peddling.
It's possible that you're thinking of a euphemism, dialectical variation, or perhaps something completely different.
I think that's the curse we were looking for. Change קאַקן ("kakn") to פײַפן ("fayfn") and we have a version fit for "mixed company". (I imagine "kakn" changed to "pisn" - cleaner I suppose - and then to "fayfn" through a minor spelling change, and voilà.)
It makes sense. Even as a German speaker with limited Yiddish knowledge I would immediately recognise ahfn and oyfn as variants (German aufm). Pissn isn't really cleaner than kakn but your surmise that fayfn be a euphemism for kakn is intuitively very plausible. In German, geh pfeifen is not really used as a euphemism for geh scheißen but every native speaker would immediately know what is meant.
You asked how it would be written in Yiddish. גיי פײפן ויפן יאם. I believe the word often pronounced as afn is spelled ויפן in "standard" Yiddish.
פּייפּן (fayfn) means to whistle (cognate with Engish pipe and fife, two forms of whistles). It is indeed a euphemistic "polite company" version of גיי קאקן ויפן יאם, "go shit in the ocean," "buzz off," "go screw yourself." Perhaps פייפן may also be taken to mean פּישן (pishn), as Forero suggests in his second post, but I think his first suggestion, "Go whistle in the sea" is correct. "Go peddle your fish elsewhere" is an English equivalent, but not a translation. Other equivalents might be "Go fry ice," or as they say in Spanish, "Go fry asparagus."
"Triflakh" in transliteration (sorry, my 'j' comes from Spanish and not Yiddish). It's a light mixture made out of eggs and flour that you pour trickling down into a pot of boiling chicken broth (Want the recipe?). It's quite good. Presumably, the consistency will resemble what happens if you go 'kakn afn yam.'
(Try not to imagine it. Was I disgustingly clear enough?)