||Large datasets containing the purchasing information of thousands of consumers are difficult to analyze because the possible number of different combinations of products is huge. Thus, market baskets analysis to obtain useful information and find interesting pattern of buying behavior could be a daunting task. Based on the maximum entropy principle, we build a probabilistic model that explains the probability of occurrence of market baskets which is equivalent to Ising models. This type of model allows us to understand and to explore the functional interactions among products that make up the market offer. Additionally, the parameters of the model inferred using Boltzmann learning, allow us to suggest that the buying behavior is very similar to the spin-glass physical system. Moreover, we show that the resulting parameters of the model could be useful to describe the hierarchical structure of the system which leads to interesting information about the different market baskets.