This paper presents an affective algorithm to support purchasing decisions in e-commerce environments. The literature associated with decision-making theory includes the affective dimension as a clear human decision factor. In the same sense, several models and proposals of consumer behavior consider both affective and social dimensions as very important factors that influence each human decision. However, the related work associated with electronic commerce proposes strongly the use of rational dimension as the main decision factor. Our approach proposes the incorporation of the affective dimension as a central component within an integrated decision schema. The proposed algorithm considers three different decision factors: an objective dimension, which represents the rational decision factors; an individual subjective dimension, which represents the affective decision factors; and a social subjective dimension, which represents the social decision factors. The study case explains how the proposal algorithm can be implemented in a real scenario.