A
Alokaiβ€’14mo ago
jeanpier92

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.
No description
No description
5 Replies
jeanpier92
jeanpier92OPβ€’14mo ago
@rohrig
rohrig
rohrigβ€’13mo ago
hi @jeanpier92 πŸ‘‹ , can you elobrate on what you're confused about? πŸ˜„ I'm happy to help
jeanpier92
jeanpier92OPβ€’13mo ago
hi @rohrig.I think I solved it. It goes more to the product configuration side.
Ritcha
Ritchaβ€’12mo ago
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.
alice
aliceβ€’10mo ago
Hi @jeanpier92 , I'm having the same problem as you, can you tell me how to configure the product properly? Thank you!
Want results from more Discord servers?
Add your server