Hello there! I know the 6.x version is under development atm, but maybe you can help me solve this one issue.
I'm working on updating a 5.x site to 6.x and dropping ecommerce for Ubercart. My final hurdle is listing products in the store that are sold out. Basically I want to keep the product listed so that visitors can see it is a product we sell and see the price for when it does come back into stock. I just need to remove the "add to cart" button for items that are sold out. How do I do that?
I enabled the Stock module, but when I set the stock value to zero then it seems I can still add it to a shopping cart and try to pay for it. How is this supposed to work, is there a config I am looking for?
Thanks in advance for the help!
Comments
Comment #1
rszrama commentedWe're actually not handling support requests through this issue tracker. You'll probably get better feedback in our support forums, although there most people are still on Drupal 5 while the Drupal 6 version is in development. ; )
The short answer is people have been doing this through one of several contributed modules like UC Multi Stock. None of these have been ported to D6 yet, but you might be able to do it yourself for now through a small contributed module. You might even find the code in one of these other modules.
I'm going to won't fix this for now, as it's not within the scope of the current stock module.
Comment #2
seaneffel commentedIs this really out of scope for a module that manages stock levels? Would a stock module not indicate that a product was out of stock?
I'll look at the other modules, but I'm sure I'll be back here. And to the Ubercart forums, thanks for pointing me there.
Comment #3
rszrama commentedI certainly agree that it's not out of scope for a stock module, it's just that the stock module in core was no more than a stock tracker with an API designed to be used by other developers to do things like prevent checkout. Ideally the core stock module will be revamped, so it might be more postponed than a won't fix... but as a quick support request here I didn't think it was the place to address it. Sorry for the confusion.
Comment #4
seaneffel commentedI'll flip this to postponed so it doesn't get forgotten. I've started a thread on the Ubercart forums, but for the moment the link escapes me.
Comment #5
Passionate_Lass commentedHello.
I am setting up drupal 6.x for a client and he is asking for this functionality. I was checking your forums but haven't seen anything about this on your website. Figured I would drop a note here since this is listed as a really old issue that never got closed.
Thanks.
Comment #6
seaneffel commentedGood time maybe to get this back on the active list. Let's see if there has been any movement on this.
Comment #7
rszrama commentedThere still hasn't been any movement here in core, but contributed options continue to be discussed in the forums. There's no way we'll get this into 2.0, as it's already way overdue.
Comment #8
tr commentedFixing stock handing is going to require lots of changes which will be incompatible with the existing system and with existing contributed modules, and it's not appropriate to introduce these changes in a minor point release of Ubercart 2.x. I'm moving this to the 7.x-3.x issue queue with the hope that as we overhaul everything during the port to D7 we can address some of these issues. However, this is going to be a *lot* of work - I've estimated it will take 3-4 weeks to rip it all apart and put it back together correctly - so if you really want this to be fixed I suggest you consider contributing to the effort either by working on it yourself or by paying someone to work on it for you. So far, no one has thought it important enough to do that.
Comment #9
seaneffel commentedClearly it is important because someone made a module to do it and about 900 websites have it in use right now. That's a huge adoption rate since my last post in April so it's not so small a need, as you suggest.
You don't need to admonish my suggestion that a fairly trivial feature such as preventing sales of items with zero stock level get included in your stock monitoring system - and you don't need to spend 3-4 weeks tearing apart your code. I mean, it's not like "I really want to get this fixed" - it's your code. Shortcomings in your code usually end up as headaches on your issue queue.
I would suggest you work with that module's developer to integrate that work into Ubercart core. It's a thoughtful feature that a thousand sites already use.
Comment #10
tr commentedSure it's important (why do you think I re-opened the issue?) but uc_out_of_stock, and indeed *all* the contributed stock modules suffer from a major problem due to the underlying stock architecture on which they're dependent. Specifically, stock control in Ubercart is not thread-safe, and uc_out_of_stock *cannot* prevent you from selling out-of-stock items nor can it prevent you from selling more than one of a "unique" item. The main benefit of modules like uc_out_of_stock are they *reduce* the chances of this happening. But that's just a band-aid on the problem. And this is not the only fundamental problem with the stock architecture either.
Saying it's a "trivial" feature simply means you haven't thought about it enough. What if a dozen people are viewing your product page, then one of them buys the last item? Hiding the "add-to-cart" button like you requested in your original post won't affect anyone currently viewing the pages, and won't stop them from also trying to buy the last item. Nor will it prevent them from increasing the quantity in their cart to exceed the available stock.
Sorry if it sounded like chastising, it was meant as a *plea* for help here. It's not *my* system and it's not *my* code - I had no hand in writing it or (until recently) maintaining it. The original author is long-gone from the Drupal world. This is open source code and the responsibility for developing it and fixing it lies with the community, not me. So the fact of the matter, the reality of open source, is that the only way this or anything in Drupal gets fixed is if someone is willing to devote the time and/or money that it will take to fix it. It's particularly hard when the fix requires a lot of work - then it needs someone who *really* needs it to step up and contribute. That's not going to be me in this case.
Comment #11
seaneffel commentedI am on board with the way Drupal is collectively and collaboratively developed. I'm not a developer and I certainly don't have the chops to contribute code on any meaningful level - but I can test and report when the time comes.
I realize that a trivial feature may very well be an enormous amount of work and it's a shame the original developer didn't build this in in the first place. The people who wrote those many contrib stock-oriented modules have good material and great insight to how UC works and I bet you could rally them together to contribute to completing this feature. I am sure they would love to kick the maintenance of this feature back into UC core rather than their own custom module issue queues, and one could leverage that incentive to get their help.
Comment #12
tr commentedI agree. It's going to be a challenge to get that organized. Part of my baby steps towards that was to re-open this and some other stock-related issues and tag all the stock issues so that people interested in getting this done could easily find the previous discussions and get an overview of the current problems. Now is a good time to start on this project because the port to D7 allows us to make radical changes without fear of breaking a site that's already working. Once there's a release it gets much harder to fix things without breaking other things. D7 also has features like support for database transactions which will make doing stock "right" much easier.
What I'm really hoping for is that someone will get a client who needs these features bad enough to pay for the development, otherwise overhauling stock is going to be competing for attention with a lot of other big, sexier tasks and will probably take a long time to accomplish.
Comment #13
jasonabc commentedsubscribing
Comment #14
koyama commented+1 subscribe
Comment #15
bmagalhaes commented+2 subscribe
Comment #16
tr commentedI'm going to mark this as a duplicate of #384996: Better stock support, which is a more general issue of improving stock support in Ubercart 3.x.
Comment #17
ikeigenwijs commentedsubscribe