AddToCart function that determines whether or not to enable the "ADD TO CART" button
Hi guys!. Here again with the aim of learning. I have a question regarding the canAddToCart function. Analyzing the code and displaying the product parameter in the console, I see that it does not have the stock_status or only_x_left_in_stock keys, which is why the function returns false. Then in SimpreProduct.vue, specifically in the button (addTocart), said function is consulted, denying it, resulting in true... I'm slowly understanding all this. I would appreciate it if you could understand what is happening.
5 Replies
@rohrig
hi @jeanpier92 π , can you elobrate on what you're confused about? π I'm happy to help
hi @rohrig.I think I solved it. It goes more to the product configuration side.
Hello I found out that the there is a problem in the
productDetails
Query. The canAddToCart
Method is never true because the two attributes in_stock
and only_x_left_in_stock
are not mentioned in the query. @rohrig @skirianov Could one of you look into this problem and fix the productDetails
query.Hi @jeanpier92 , I'm having the same problem as you, can you tell me how to configure the product properly? Thank you!