A stock level manager working with uc_stock, that takes into account the different sku of a product, according to the attribute selected.
Tests are made in -
* add to cart form
* cart view form
* final checkout
Error messages are themeable.
This module borrows freely (i.e - copies) some code from the Inventory API & Simple Stock Levels - (http://www.ubercart.org/contrib/132), by CpILL (http://www.ubercart.org/user/29), but is meant to be used with the uc_stock module.
according to user experience (http://www.ubercart.org/comment/20036/Re_I_noticed_contribution):
Be sure to disable uc_stockstub and Inventory API (from the modules menu) before installing uc_multi_stock.
see comparison of different stock managers : http://www.ubercart.org/docs/user/5181/out_stock_solutions
enhanced out of stock indication to go with this module - Ubercart Out of stock AJAX Notification



few minor issues
Thank you very much for this very much needed contribution, great work! As I will heavily rely on it I tested it intensively and founded few minor issues, sure fast to fix.
In all 3 tests of the stock level you test against the threshold. But the threshold is for informing admin that only few pieces are left, so you should test against 0. See patch.
Second is about your use of the t()-function which is not ok. See the patch how to get variables into the message.
Thanks again for this important contrib,
Al
few minor issues
thanks for the comments, Al.
regarding the t() function - i will fix it.
regarding checking vs the threshold and not 0, i am actually not sure which is better. maybe I'll add it as a configuration option.
cheers,
tal
Threshold
Thanks for your answer. Just wanted to PM you. If you read the leading comment in uc_stock.module you find:
* the stock levels on a product edit page and a threshold for each SKU value
* When that threshold is reached admins can be optionally notified about the
* current stock level...
So I am sure it is meant like this: We sell until stock is zero, but the admin can get a notification at threshold.
Threshold
Wow Al, thanks for the quick reply - and of course the improvements.
i am comparing to the threshold on purpose, not bu chance - it is more convenient if you also take phone orders, and want to set aside a bit of stock, and still use only one stock management.
BUT - i can see that using it the "right" way will be better in most cases, one of them is my current project, so i will add this as an option.
Re: Threshold
Configurable option sounds good. Regarding your "second outlet": I am sure my Multiple stock edit module is exactly what you need. It is running already a week on my customer's site and as they have about 30 stores they love it. If you have ideas to improve usability let me know,
Al
Re: Threshold
i'll be sure to give it a try.
Tal
Re: Re: Threshold
Is the patch now applied to the module? Thanks.
Re: Re: Re: Threshold
i afraid not yet.
Re: Re: Re: Threshold
it is now.
Hide Out of Stock Options Instead of Message
Is there anyway to setup this module to just hide the product options that are out of stock instead of providing the post selection error message?
Example:
Small - 12
Medium - 10
Large - 0
I choose "Large" and get what appears to be an error message, at least until I read it.
Suggestion/Request:
Small - 12
Medium - 10
Large just doesn't show up in the list.
Re: Hide Out of Stock Options Instead of Message
Bump.
Bump and where to handle hiding out of stock items
Great mod, Thanks!!
I'm bumping b/c i agree that hiding out of stock attributes (or graying out) is preferable to doing it after submit.
Where would that be in the event chain, code-wise. Would be glad to take a look, but a starting point would help.
Thanks again!
m
Re: Hide Out of Stock Options Instead of Message
there is more to it than that - a product can have more than one attribute (size AND color), and only specific combinations can be out of stock.
in that case, disabling one option just does not cover it.
i am not sure that dynamically disabling/enabling the options is the best solution - i tend more to the availability table solution. it is much simpler.
tal
Where are the settings
I have been looking for something like this module, and just installed it. It seems to be working ok, but I can't find any settings page to configure it. Are there any options to change and if so, where do I look?
Thank you.
a feature request
Is it possible to have this module also provide different weight, price and cost for each combination?
I'm working on a website for a jewelery store and being able to price rings based on the combination of size and its metal type would be a great boon, the problem is that no other module makes the combinations that this module makes. So if this module could just add the weight, cost and price adjustments for each combination that would be awesome.
Granville
granville [at] kirkhamsystems [dot] com
collaborating
I am about to use and test this module. I will probably contribute any modification to it. One question though, I chose to use the one with the applied patch, however, having two attachments confuses me.. are you planning on mainting two different branches or your code, or just one?
Thanks,
a.=
very small comment
I just noticed after a few tests that the legend:
We're sorry. The @product in your selected size/color combination is out of stock. Please consider another size/color in this style.
Includes the size/color combination as a fix one. Now I know that this is a theme function and can be overriden in the theme, but noticing that the theme function only does a few calls to the t() function which can be easily tweaked using the locate module I am just thinking that it might be a good idea to try to improve that legend a little bit more, by retrieving the combination of attributes selected from the actual product. Thus, if a product have a size/length combination instead of size/color it would display the legend properly.
This is hardy a priority for me now but If I get a chance to do this I'll post the patch. Just thought worth mentioning the idea and leave it here.
Thanks,
a.=
small bug
When removing out of stock items, the error still occurs and the validation fails not letting me remove the actual out of stock items from the cart.
I looked in the code and I noticed that was looked for, but by just looking at the quantity of the items and not also the remove checkbox.
Here is what I changed:
Line: 167
<?php// dont test the removal of out of stock products
if($item['qty']>0){
?>
by
<?php// dont test the removal of out of stock products
if(!$item['remove'] && $item['qty']>0){
?>
Re: uc_multi_stock (stock manager with attributes)
I've been using this module for awhile and overall I'm very happy with it. I've noticed one thing I can seem to figure out. Occasionally I will get a stock value of -1, what does this mean?
Set error message to show which attribute is out of stock
Is there a way to set the error message to display which attribute is out of stock? I am opening a skateboard shop and when a customer orders a custom deck they will have multiple attributes (wheels, trucks, grip tape, etc) to choose from and if just one is out of stock, I don't want them to have to guess which option is returning the error.
dynamically disabling/enabing the options is the best solution
the current solution *is* much simpler, but it's a huge pain in the ass for customers, many of whom would rather shop elsewhere than try over and over again to add out of stock items to your cart.
it's not okay to consider the current implementation finished. there are no popular ecommerce systems that don't have a method of telling customers what is out of stock before they try to add it to the cart.
yes, the complexity is in multiple attributes, and javascript is required to make things work correctly in this case.
it might be helpful to use workflow to disable attributes when stock reaches zero, but some logic and javascript on the product page will still be necessary to make sure that only valid options are presented to the customer.
Amen. @firebus I would be
Amen. @firebus
I would be willing to post a $50 bounty to get this functionality added.
Re: Where are the settings
there is only one setting - how to use the thresh hold - only for notification, or for stock management as well.
all the rest is done with the regular stock management.
anyway, the setting page is under your-site-url/admin/store/settings/multi_stock
cheers,
tal
Re: a feature request
this is just a humble stock manager. it does not change the product attributes at all.
i think you will have better luck with the attributes management - mimic the way the system modify the sku for the ther qualities, too. i think that cost is already available.
Re: collaboratingno
sorry for the confusion.
no two branches - use the later one. it is backward compatible.
will make this a drupal project as soon as i manage to login to the cvs.
Re: small bug
you are correct.
i will update the code.
thanks
Re: uc_multi_stock (stock manager with attributes)
it meas a bug.
could you provide some more details of the context of this happening ? what were the stock levels of the products, and such ? anything you think is relevant.
Re: Set error message to show which attribute is out of stock
yes, there is in fact such a way.
the module come with theme-able functions - theme_uc_multi_stock_out_of_stock_error(),theme_uc_multi_stock_too_many_in_order_error().
both receive the attributes as parameters.
so - you can theme your error messages to reflect the actual attribute that is missing.
Re: dynamically disabling/enabing the options is the best soluti
implementation of open source projects is never finished. but it is very democratic - when someone has the need, he will write it. feel free to do so. i will be more than happy to use any improvements.
cheers,
tal
Now Posted On Drupal Org
I noticed that this is now posted on Drupal Org.
http://drupal.org/project/uc_multi_stock
Wondering if any of these features requests have now been implemented?
Also, how does this module compare to http://www.ubercart.org/contrib/4792 which changes the text on the add to cart button to read 'not available' when a customer selects a product attribute that is out of stock.
Is there any way of combining the two modules?
Thanks.
Re: Now Posted On Drupal Org
yep, i am pleased that i have finally managed to post the module to www.drupal.org.
none of the feature requests are implemented.
there is a comparison between the different stock managers - http://www.ubercart.org/docs/user/5181/out_stock_solutions. it also address the issue of combining them together.
great work
Great to see this on drupal.org It does exactly what I need.
I have provided a patch for it http://drupal.org/node/304226 which will help make it more "standardized".
Also, this page lists the status as "Complete and working." If you feel that is the case you should create an official release as 5.x-1.0 on drupal.org
Greggles Drupal Articles
another module
Hi,
I just want to poing out a new module I just contrib tu drupal.org as well which is related to this one. I am actually using mine and this one together.
I am doing some Jquery and Ajax to fetch from the server if a combination of attributes is currently of stock, and if not, I am replacing the Add To Cart button with a configurable HTML snippet.
It's in a beta state, certainly working on a live site (DEMO available on drupal.org project's page) but I only tested on one ubercart site, other sites are welcome to try it out.
http://drupal.org/project/uc_out_of_stock
Thanks,
a.=
Re: another module
that's great.
a lot of people have been asking for this kind of functionality.
i have added a reference for it in the drupal project page and here.
stock won't decrement with this installed
I think I may have found a possible bug.
With this module installed, stock will no longer decrement (via Workflow-ng) whenever a product with attributes is purchased. And I have noticed that when this happens, the model field in the table uc_order_products remains empty.
If I disable multi_stock, then it will decrement properly again.
Products without attributes will decrement properly with multi_stock installed.
I have tried everything i can think of, including deleting all data including products and then reinstalling all of ubercart and Workflow-ng but this error remains.
Hope you can help as apart from this problem, this module is great and is exactly what I need for my site.