Closed (duplicate)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
21 Aug 2017 at 08:12 UTC
Updated:
28 Jan 2020 at 16:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
edurenye commentedThis affects the commerce stock module, but should be fixed in the commerce using the availability manager.
Comment #3
edurenye commentedComment #4
edurenye commentedDone.
Comment #5
drugan commentedThe #4 is worked for me. Great addition!
Comment #6
joachim commentedA few minor problems:
This should be injected.
'This amount' is singular, but 'are not' is plural...
Comment #7
joachim commentedFixed the problems in #6, and also changed the message to mention the product variation name, so it's clearer.
Comment #8
drugan commentedThis functionality is now implemented in the Commerce Extended Quantity module:
https://www.drupal.org/project/commerce_xquantity
Thanks to @edurenye and @joachim for the changes made in the EditQuantity.php file. Though in the AddToCartForm.php file I've done this a little differently:
http://cgit.drupalcode.org/commerce_xquantity/tree/src/Form/XquantityAdd...
Comment #9
mglamanI'm going to close this as a duplicate of #3088597: Add a constraint to purchased_entity which checks the availability manager (even though it's newer!)
The linked issue puts the validation at the data layer level, so it'll work anywhere.
Feel free to comment if you try it out and find out I'm incorrect!
Comment #10
mglamanCart Form entity validation is being handled in #3109312: Validate order items modified on the cart form