An integral domain whose every nonzero prime ideal contains a nonzero principal ideal that is prime is UFD. [duplicate]

This is an exercise from hungerford p.140 and I am totally stuck at it. I denote $$S$$ to be the collection of all units and all products of primes in the given integral domain $$R$$. And I showed that $$S$$ is closed under multiplication and division. Now I assume there is an element in $$R-S$$. Then the ideal generated by the element is disjoint from $$S$$. Now I think of a collection of ideals disjoint from $$S$$. Then by Zorn's lemma there is a maximal element in the collection. Now I want to show that the maximal element is a prime ideal. But I cannot proceed from this point at all and am totally stuck.... Could anyone help me? Or is there some completely different solution?

• This is true for any (adequately defined) multiplicative set $S$... are you sure you haven't previously seen this fact, and are just expected to cite it without proof to prove something about domains in which not all elements are all products of primes and units? – rschwieb Apr 29 '19 at 13:07
• search for Kaplanky's theorem for UFDs – Γιάννης Παπαβασιλείου Apr 29 '19 at 13:09
• See here for Kaplansky's theorem (I also added it to the dupe list, along with another thread). – Bill Dubuque Apr 29 '19 at 15:45