When displaying products in e.g. Commerce Kickstart with Stock enabled, it seems to me it is kind of negative UX for the visitor to see the Out of Stock message when the first variation in the list is out of stock.
A customer may abandon the purchase if they think the product is totally out of stock, whereas some other size / color combination may be in stock.
It would be handy to have a setting in the preferences for this module to always show the first variation (size / color / other attribute combo) that IS in stock.
This way they will not be immediately discouraged and if they do manually select a combo that happens to not be in stock, that's much better than not even bothering because they think it's unavailable.
Comments
Comment #1
guy_schneerson CreditAttribution: guy_schneerson commentedyes I agree this would be a great addition but not the easiest to implement, we get around this issue by setting an out of stock msg "out of stock - try another size or colour'
Comment #2
marktheshark CreditAttribution: marktheshark commentedI assume the logic to implement would be to query for the stock level of each choice to populate in the combo box and set the 'selected' attribute on the first non-zero stock level, right?
As for the message to display, is this already configurable?
Comment #3
marktheshark CreditAttribution: marktheshark commentedAny progress on this? Thanks in advance
Comment #4
guy_schneerson CreditAttribution: guy_schneerson commentedI had another look at this and all indications are that the core commerce product add to cart from dosen't support a 'selected' product, even when I managed to change it, in the combo box it showed the details for the wrong product.
Comment #5
marktheshark CreditAttribution: marktheshark commentedThanks for looking into this.
This is a potential cause for driving away customers because they think there is no availability.
An informational message would be most helpful, though as a workaround I could probably add a block that says: "if the currently selected variation is out of stock, please try a different combination".
Comment #6
guy_schneerson CreditAttribution: guy_schneerson commentedIt is also possible to add the msg only if out of stock.
Comment #7
marktheshark CreditAttribution: marktheshark commentedIn the current module, or in the custom block?
Do you advise this is checked via JS?
Comment #8
guy_schneerson CreditAttribution: guy_schneerson commentedA few options are available:
And my favorite:
You can use the new "Commerce Stock Decimal formatter" (you will need to enable the module under the commerce stock section)
To configure:
If stock <= 0 Message: "Currently out of stock - try a different variation"
make sure the stock field is positioned above or below your cart form
Comment #9
guy_schneerson CreditAttribution: guy_schneerson commentedThanks @MrPaulDriver to pointing the following #2084869: Option to direct buy button to 'in-stock' variations. :
In the following post, https://drupal.org/node/1637786#comment-7551813 Ryan suggests that the stock module could be modified to point the buy button to a variation that is in stock and I ask whether this improvement could be incorporated into the stock module
Comment #10
marktheshark CreditAttribution: marktheshark commented+1
Comment #11
MrPaulDriver CreditAttribution: MrPaulDriver commentedThe stock message formatter is a very good tool in it's own right and helps somewhat with this problem.
Ideally, Commerce should not default to the first variation but instead should have a normal select function with a prompt saying 'Please select an option' or whatever.
As an interim workaround, if the stock module could be made to point the buy button at the first variation in stock I think this would be really positive move forward.
Comment #12
marktheshark CreditAttribution: marktheshark commentedCome to think of it, I don't know if the stock module is the place to do this.
Stock probably doesn't know how the products are presented in order to default to an available variation.
Comment #13
MrPaulDriver CreditAttribution: MrPaulDriver commentedAbove my paygrade I'm affraid, just listening to Ryan at https://drupal.org/node/1637786#comment-7551813
Comment #14
guy_schneerson CreditAttribution: guy_schneerson commentedmarktheshark, MrPaulDriver
If this hook works than its perfect for the Stock module, will look into it when I get a chance.
Comment #15
Neo13 CreditAttribution: Neo13 commentedFor anyone trying to solve this. Here is a nice little module - https://www.drupal.org/project/commerce_stocked_default
Comment #16
John Pitcairn CreditAttribution: John Pitcairn commentedWe're using the hook mentioned. Something like this: