Problem/Motivation

Stock 2 is currently provided with a very basic rule set and when Stock 2 is close to a full release I will probably ship it with one or more comprehensive rule sets.

The nature of rules is such that it is difficult to update rules as they are configuration based and not in code so unlikely to do this before an RC version.
So this issue is to help identify the best UX and the ideal text for messages covering all use cases.
Meanwhile you can create a sandbox module with alternative rule sets and I will be happy to add a link from the project page and possibly include it in a later version.

Completed Create a Stock Rules admin screen
Button should disable when stock level combined with the cart line item level is zero
Improve messages on cart validation

Proposed resolution

Use cases

These are all the use cases I can think of, please let me know if I missed any.
All you UX experts we need your help: please comment with what you think the messages should say and any notes you may have.

Add to cart

These are messages a user will get when using the "add to cart" button and the stock level for the product can't fulfill the request.

A1) Requested 1, In basket 0, Stock 0
Current msg: The maximum quantity for PRODUCT that can be ordered is 0.
notes: This will happen if between the time you loaded a product page and the time you clicked the add to cart the stock level dropped to zero

A2) Requested 10, In basket 0, Stock 5
Current msg: The maximum quantity for PRODUCT that can be ordered is 5.

A3) Requested 10, In basket 2, Stock 5
Current msg: The maximum quantity for PRODUCT that can be ordered is 5.

A4) Requested 1, In basket 5, Stock 5
Current msg: The maximum quantity for PRODUCT that can be ordered is 5.

A5) Requested 1, In basket 5, Stock 2
Current msg: The maximum quantity for PRODUCT that can be ordered is 2.

Cart / Checkout validation

These are messages a user will get when checking out or updating the quantity of a product on the cart form and the stock level for one or more of the products can't fulfill the request.
User will get one message per product followed by the message: "Please adjust quantities before continuing to checkout."

C1) In basket 10, Stock 5
Current msg: The maximum quantity for PRODUCT that can be ordered is 5.

C2) In basket 10, Stock 0
Current msg: The maximum quantity for PRODUCT that can be ordered is 5.

Comments

guy_schneerson’s picture

Issue summary: View changes

update relate issues

guy_schneerson’s picture

Issue summary: View changes

updated

guy_schneerson’s picture

Issue summary: View changes

added use cases

guy_schneerson’s picture

Issue summary: View changes

updated

guy_schneerson’s picture

Issue summary: View changes

update

guy_schneerson’s picture

example of proposed rule set:

A1) Sorry PRODUCT is out of stock.
A2) Sorry we only have 5 of PRODUCT. You can add 5 to your basket.
A3) Sorry we only have 5 of PRODUCT and you already have 2 in your basket. You can add 3 more to your basket.
A4) Sorry we only have 5 of PRODUCT and you already have 5 in your your basket.
A5) Sorry we only have 2 of PRODUCT in stock.

C1) Sorry we only have 5 of PRODUCT
C2) Sorry PRODUCT is out of stock.

Notes:
We will need to add functionality to support "add 5 to your basket."
A5- we should consider adjusting the basket level for the user but this may be an edge case

guy_schneerson’s picture

Issue summary: View changes

Updated issue summary.

guy_schneerson’s picture

Title: Rule sets for commerce stock » Improved messages and UI for Version 2
guy_schneerson’s picture

Issue summary: View changes

Updated issue summary.

guy_schneerson’s picture

Issue summary: View changes

add issue: Create a Stock Rules admin screen

guy_schneerson’s picture

Issue summary: View changes

added issue #1976850 to related issues

guy_schneerson’s picture

Issue summary: View changes

add progress info

guy_schneerson’s picture

Priority: Normal » Major
guy_schneerson’s picture

Issue summary: View changes

Updated issue summary.

iaugur’s picture

Issue summary: View changes

Fixed a few typos

guy_schneerson’s picture

Category: Support request » Feature request
Issue summary: View changes