  A generalization of a beautiful $q$-series identity found in the unorganized
portion of Ramanujan's second and third notebooks is obtained. As a
consequence, we derive a new three-parameter identity which is a rich source of
partition-theoretic information. In particular, we use this identity to obtain
a generalization of a recent result of Andrews, Garvan and Liang, which itself
generalizes the famous result of Fokkink, Fokkink and Wang. This
three-parameter identity also leads to several new weighted partition
identities as well as a natural proof of a recent result of Garvan. This
natural proof gives interesting number-theoretic information along the way. We
also obtain a new result consisting of an infinite series involving a special
case of Fine's function $F(a,b;t)$, namely, $F(0,q^n;cq^n)$. For $c=1$, this
gives Andrews' famous identity for $\mathrm{spt}(n)$ whereas for $c=-1, 0$ and
$q$, it unravels new relations that the divisor function $d(n)$ has with other
partition-theoretic functions such as the largest parts function
$\mathrm{lpt}(n)$.
