Closed benjibee closed 9 years ago
@benjibee thanks for your suggestion, we'll look at bringing more focus to that point.
Dugway will still indicate if a product (or options) are actually sold out using real data from the store you're using, and you can check products using the product.status
variable - it'll return sold-out
if the entire product is sold out. You can check whether particular options are sold out like so:
{% if option.sold_out %}Sold Out{% else %}{{ option.quantity }} in stock{% endif %}
If the quantity is greater than 0, it'll display a random number for the quantity.
@deadformat thanks for getting back to me so quickly. I did realize shortly after posting this issue that it will show a product as sold out as that is publicly available information, anyway.
As for sold out options, I'm not able to reproduce this behavior on my machine. Using the following code, options that have a stock of 0 in my shop are still being assigned random quantities:
{% for option in product.options %}
<option value="{{ option.id }}" {% if option.sold_out %} disabled {% endif %}>
{{ option.name }} ({{option.inventory}})
</option>
{% endfor %}
Here's a screenshot taken from the admin section of my shop:
And here's the result on my local server using the above code:
@benjibee hmm that should still be working properly, if you recently made that change in your admin you'll need to restart dugway so it can reload the inventory level. if you've done that, can you post the subdomain for your store so i can test it out?
Hmm, it looks like a co worker turned on product overselling recently without my knowledge! With this disabled, options with 0 inventory are now shown as sold out in Dugway (after a server restart).
Thanks for your time, @deadformat, I hope this issue can be helpful to someone else in the future.
I've noticed inventory levels fluctuate back and forth seemingly randomly.
After carefully going over the read me, I spotted this line:
This may also be a relevant security concern, but I imagine a few other developers might get tripped up by these ever changing numbers. I'd like to suggest making this caveat a bit more prominent in the documentation.
That being said, is there a way to test functionality and design for out of stock items or options?