Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is a need for unique item selling : a better stock support with actions
if threshold is hit, maybe a trigger/predicate could hide product (unpublish it's node) so product won't be visible for visitors anymore
Thank you by avance, this lack of feature stoped me for weeks in drupal/ubercart progress
Comments
Comment #1
hedac CreditAttribution: hedac commentedyes.. or change the add to cart button with a text explaining that there are no units left.
Comment #2
chourmovs CreditAttribution: chourmovs commentedThank you for your answer, but i take the risk that 2 customers buy the same product before i change the button, what is not acceptable for me
Comment #3
hedac CreditAttribution: hedac commentedI mean it has to do it automatically. when stock is 0... remove the add to cart button automatically and put a "item sold" text instead.
Comment #4
chourmovs CreditAttribution: chourmovs commentedSorry
you're right, it can be a nice way to do this
Comment #5
dgitman CreditAttribution: dgitman commentedI'd like a "Sold" picture overlay and/or an item title change.
Comment #6
Passionate_Lass CreditAttribution: Passionate_Lass commentedI have been hunting for a similar function that disables buying when stock is empty.
I have found a lot of 5.x solutions but none for 6.x. I did find this thread - http://drupal.org/node/335010 but when I checked on the module it was only for 5.x. If I was a stronger coder I would probably just port the thing myself, unfortunately I'm not a strong coder and don't trust my abilities to create modules.
Maybe someone could take said existing module and port it.
Also, would a potential solution be to theme a product page and where the cart button is to throw in an if else statement?
If stock = 0
( change button to "Out of stock" and do not link to add to cart)
Else
(usual cart button and add to cart)
o.o
Comment #7
rszrama CreditAttribution: rszrama commentedThis ultimately needs to happen in contrib space w/ other stock related modules. At the very least, an issue should only be opened with a proposal and some patch development. : )
Comment #8
autopoietic CreditAttribution: autopoietic commentedI have also been searching for an out of stock solution for ubercart 2.0. I found this module, which I intend to try:
http://drupal.org/project/uc_out_of_stock
Comment #9
joachim CreditAttribution: joachim commentedI think at least some basic stock support needs to be in UC core.
I've had a look at the various stock control / stock display modules, and they are forced into some truly hacky solutions in order to implement what's a basic requirement:
- if product is not available for sale, don't show the add to cart button.
Currently, site developers either have to hack about in the theme layer, or do some wacky stuff like uc_out_of_stock using ajax (!!!!) to replace the add to cart button. This suggests that core needs to do something.
What I would suggest is a switch uc_product_for_sale() in core, alongside uc_product_is_product(). This would control whether any purchasing UI is shown.
By default this would always return TRUE -- let contrib modules supply information to this switch.
It would also be up to contrib modules to alter price display -- I can't find docs on the hook_uc_price_handler formatter callbacks, but I assume one could change the price entirely to say "out of stock" or "more expected in X days".
This would allow contrib to cover the many use cases:
- products merely out of stock -- show price but prevent buying
- products discontinued but shown for archive reasons -- probably want a flag for this; prevent buying AND don't show price.
Comment #10
fenstrat+1 to joachim's idea. uc core needs to have beter support for stock control. The idea of a uc_product_for_sale() controlling if the add to cart is shown seems relatively straight forward.
The multi stock module has an interesting method for preventing buying out of stock items (as well as supporting stock levels for attributes).
Comment #11
Passionate_Lass CreditAttribution: Passionate_Lass commentedA good module that blocks users from purchasing out of stock products.
Ubercart Out of stock Notification
http://drupal.org/project/uc_out_of_stock
It works really well and I recommend it!
Comment #12
brisath CreditAttribution: brisath commentedSubscribing
Comment #13
ikeigenwijs CreditAttribution: ikeigenwijs commentedIt prevents the buying of the object
But it does not change the button,with the custom text.
Comment #14
TR CreditAttribution: TR commentedFixing all the problems with uc_stock will take some major API changes, so it's not something I'm prepared to do in Ubercart 2.x at this point.
I encourage you to start working with Drupal 7 / Ubercart 3.x to develop better stock handling for this next major revision of Ubercart. Now is the time to start proposing changes and working on new implementations to fix this.
Comment #15
TR CreditAttribution: TR commentedComment #16
TR CreditAttribution: TR commentedI've gathered up all the open stock-related issues and tagged them with the uc_stock tag. Anyone working on improving stock in Ubercart should make sure to consider all those other issues when developing a solution.
Comment #17
jasonabc CreditAttribution: jasonabc commentedsubscribing
Comment #18
mo6subscribe
Comment #19
spylvas CreditAttribution: spylvas commentedsubscribe
Comment #20
TR CreditAttribution: TR commentedConsolidating issues: Marked #323703: Prevent selling of items with stock of zero as duplicate.
Comment #21
TR CreditAttribution: TR commentedComment #22
Edy Gorbacev CreditAttribution: Edy Gorbacev commentedthis what i really want .. fyuh.. but then.. i want to put stock level in the front, i mean, to inform ppl for the left stock. how to do that?
Comment #23
keithm CreditAttribution: keithm commented+ on http://drupal.org/project/uc_multi_stock
Changing the button can be handled at the theme level. For example,
I have also implemented a decrement stock action when a user checks out with Paypal WPS. Works great.
Comment #24
armin1980 CreditAttribution: armin1980 commentedHello
I have a problem and I want to see if someone can write a patch or module for me. I use Ubercart marketplace and items that are being sold on my web site are unique. When a seller lists a product on my web site, the default stock and threshold value is 0 (unlimited) and it should be manually overridden after listing a product. most of the times, sellers forget to do this simple thing and you know the rest better.
I want to define a default stock value for any product that is being listed on my web site. for example if seller X lists product X, the stock and threshold by default should be 1, not 0.
If you can help me out as soon as possible I'll be more than happy to donate money to ubercart project. just this simple thing has messed up all my operations and has made things very complicated. I use Drupal 6 and I can not upgrade to 7 right now because of lack of support from so many modules so I need it to be done with Ubercart 2.4 or anything compatible with drupal 6
thanks
Comment #25
podaroksubscribe
Comment #26
TR CreditAttribution: TR commentedComment #27
mirocow CreditAttribution: mirocow commentedsubscribe
Comment #28
Anonymous (not verified) CreditAttribution: Anonymous commentedSubscribe. I'm using a customised version of http://drupal.org/project/uc_out_of_stock but there is no stable D7 release, and it's a messy way around the problem.
Good stock keeping is so essential to businesses that I am really surprised decent stock controls are not part of Ubercart's core.
Comment #29
TR CreditAttribution: TR commented@TechNic: Is it important enough to you that you're willing to spend your own time and/or money developing it? Proper stock control can be done, but it really *doesn't* seem like the user community cares enough about it to expend the necessary effort or funds to do it properly. If you're making money by using this free software and you think it's lacking something, perhaps you can consider funding some specific improvements as a way of giving back to the community of volunteers who have made this all possible.
Comment #30
2faroffroad CreditAttribution: 2faroffroad commented@TechNic - Good stock keeping is so essential to businesses that I am really surprised decent stock controls are not part of Ubercart's core
I agree, there is no point for even having stock if it can not be controlled... Should rename the stock module to "Sale Counter". lol..
I too am working on something to block the "add to cart" button when a stock level hits 0... All we need is a rule for (when item is added to cart) or (when item is updated in cart) and it be able to check stock levels. But I am lost with this Rules thing for now... I will be reading more into it later.... Until then I continue to port the core hack I did in D6 U2.
Thanks.
Comment #31
Anonymous (not verified) CreditAttribution: Anonymous commented@TR: I do get where you're coming from, but I'm afraid that my lack of money and coding skills mean that really the only option I personally have to contribute to the community is to try and feedback and engage in discussions with it. You have to give back the community in whatever way your means allow - but does lack of money mean you should have less of a voice?
Having said that, my organisation have recently paid a significant amount of money to a Drupal development company to help us implement Ubercart on our site. As part of this project, they contributed new modules and helped improve others. Sadly, the time we paid our developers for was not enough to solve the fundamental stock issues in Ubercart's core. Instead, like so many others, we have ended up with a system that required lots of custom coding and hacking about.
@2faroffroad: Thanks for the support. ;-)
Comment #32
TR CreditAttribution: TR commented@TechNic: What I'm saying is that this is a well-known, long-standing problem, as evidenced by the above thread and other threads here in the issue queue and on ubercart.org. And it's going nowhere precisely because no-one seems to think it's important enough to spend their own time or money on, not because the maintainers are unaware of the problem or because we like it how it is. Of course your voice counts, but there's really nothing more to say on the stock issue that hasn't been said already - the only thing necessary right now is someone who can throw some resources at it.
*I* do not need the changes proposed here, so I feel no obligation to personally donate the many weeks of time it will take to properly re-architect stock handling and build the testing framework needed to ensure it works in a concurrent environment. And again, despite what all the "me too's" are saying, there's essentially no serious community interest. Compare stock to payment gateways - lots of people want support for their favorite payment gateway, so much so that there are hundreds of contributed payment gateways for Ubercart. This is clear evidence of a community that has spent time and money to make things happen that they really want. There is no such community effort with stock control. No contributed module correctly handles unique items in D6 or D7, which is the real test of the system. To do this properly requires transactions and architectural changes in Ubercart.
Comment #33
djh007 CreditAttribution: djh007 commentedSince "out of stock" issues are not handled by the stock module, what's the best way to achieve this in D7 / UC3?
I'm trying to get this to work:
1) I found a great module that only allows a limited number of items to be added to cart: http://drupal.org/project/uc_product_minmax.
(This is great for unique items, since stock numbers are not changed until a sale is complete, so any stock-check code would be futile at the pre-checkout stage.)
2) I've also been trying to get this to work in my themes/template.php:
I just get this error:
Has anyone successfully had this working in D7 / UC3? Any ideas why it shouldn't?
I would be grateful for any clues as to how to implement this, or any other solution :)
Comment #34
djh007 CreditAttribution: djh007 commentedDoes anyone know if there is a solution for automated stock control (out of stock when stock level reaches 0), or am I wasting my time trying?
Comment #35
longwave@djh007: Have you tried the uc_out_of_stock patch at #1201310: RFE: Update module to Drupal 7 and Ubercart 3.0?
Comment #36
conan_payne CreditAttribution: conan_payne commentedIt works if you replace the line:
$stocklevel = uc_stock_level($node->model);
with:
$stocklevel = uc_stock_level($node['form']['node']['#value']->model);
Comment #37
tkasis CreditAttribution: tkasis commentedI think this will be the correct thread to post this to. Kind of an old thread so probably everyone has already stumbled upon this.
Today I did this on my development site, http://cccoindevel.com/. This is Drupal 7 with Ubercart 3.
Problem: Since the majority of the client's products are one off collectors items they wanted the products to not be displayed when the stock level dropped to zero. This is the behavior on the existing osCommerce site, http://www.cccoinandcurrency.com/. I could do this with a view that filtered product nodes as published and stock level >= 1, but the client also wanted the product count shown per category (using Taxonomy Menu for this.) The Taxonomy Menu uses published nodes to create its values. I thought maybe seeing if there was a tweak to list only nodes in a view for the Taxonomy Menu count but that sounded like custom module time and more complexity than necessary. So I used the awesome Rules and Views Bulk Operations modules.
The client was not concerned about concurrent purchases of the same product. The rare instance of this can be handled administratively by giving a refund to one of the customers.
I love Drupal. This could not have been done in WordPress or Joomla. Extensions of this power are just not available.
Thanks to Johan Falk (itangelo) for this series, http://nodeone.se/sv/node/32
Comment #38
Dalvtor CreditAttribution: Dalvtor commentedHi tkasis. Thank you for your post, it was very useful.
I am stuck in this point: Added an action to "Unpublish content" for each entity in the loop
How do I do it? When i add a new action, unpublish content, then i can choose between: product-list:1 product-list:2, and so on.
Any help?
Thanks.
Comment #39
doppel CreditAttribution: doppel commentedsubscribing!
Comment #40
BigMike CreditAttribution: BigMike commentedGuys, this topic is from early 2009. There are many contrib modules available that satisfy the original poster's question, such as https://drupal.org/project/uc_out_of_stock, https://drupal.org/project/uc_multi_stock.
EDIT: Sorry just realized this is for UC 3.x. The UC Out of Stock module does have a Drupal 7.x version that has become available since this thread was created so check it-
BigMike
Comment #41
TR CreditAttribution: TR commentedNew features need to go into 8.x-4.x first at this point, then get backported as needed.