Possible To Purchase Non-Available Products #4535
Replies: 7 comments
-
I think you are right, seems to be currently only related to some presentation logic. Maybe we can make this more clear in the guides? |
Beta Was this translation helpful? Give feedback.
-
That's an alright solution however my products are digital and don't have stock items, and are marked as so in the backend, so they're able to be added with no stock items.
In my opinion this is a bug & a security / confidentiality flaw, we've had customers find and ask us about unreleased products through it. Definitely okay either way, I'd hate to add more to the configurations but, If we came a consensus I'd be happy to try to patch whatever our decision is here as my first solidus contrib : ) |
Beta Was this translation helpful? Give feedback.
-
Maybe it's just a matter of making the AvailabilityValidator more configurable. So that here, it will use a configurable class (like This way anyone can easily inherit from the default and add whatever they think makes more sense for their business. Keep in mind that this class runs at the end of the checkout process, so it would allow to add things to cart but won't allow to complete the order. |
Beta Was this translation helpful? Give feedback.
-
Ohh wow I had never see that class -- that does seem like a clean solution however it would only makes sense if it ran as part of the |
Beta Was this translation helpful? Give feedback.
-
This discussion reminded me about something and I found this other issue: #2154 (comment). We've been stuck there but I think there's an easy fix suggested in the comment I linked. Do you think we should provide something out of the box for this? Maybe adding some line of documentation in the guide could be enough? |
Beta Was this translation helpful? Give feedback.
-
I think that adding At least for my case -- this isn't so much about changing frontend behavior or functionality -- but rather securing the shop from allowing users to "hack" their way into adding hidden products to the cart. |
Beta Was this translation helpful? Give feedback.
-
Let me take another look at the populate function this afternoon and have a think about any other approaches. I think adding something to the docs would be helpful -- but also I think generally -- supporting Solidus as a well documented engine which prefers configurations over overrides makes sense, just because for lesser experienced engineers, it's kind of the only approach which makes Solidus useable. |
Beta Was this translation helpful? Give feedback.
-
Users may add non-available products to cart and purchase them.
Solidus Version:
I'm on 2.11.10 but I checked master and the issue is still there.
To Reproduce
Step 1: Go to an add to cart form
Step 2: Open HTML & Edit the Cart Form Variant ID
Step 3: Add to cart
Current behavior
If the ID is for an unavailable product, it Is still added to cart and able to be purchased.
Expected behavior
Unavailable product should display a flash warning and redirect_back
Beta Was this translation helpful? Give feedback.
All reactions