This repository was archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
[Cart Operations] Update Cart Items validation messages #530
Copy link
Copy link
Closed
Description
Issue is reproduce-able in GraphQl - https://github.com/magento/graphql-ce
Preconditions (*)
- Create a simple product with SKU
my-simple-product
- Advanced Inventory > Qty:
100
- Advanced Inventory > Minimum Qty Allowed in Shopping Cart:
1
- Advanced Inventory > Qty Uses Decimals:
No
Steps to reproduce (*)
- Create an empty cart through
mutation {
createEmptyCart
}
- Try to add
0.5
xmy-simple-product
into shopping cart
mutation {
addSimpleProductsToCart(
input: {
cart_id: "d4viG4wIYOorhYCOxGsxd3GTjn8DnBqc"
cartItems: {
data: {
qty: 0.5
sku: "my-simple-product"
}
}
}
) {
cart {
items {
id
qty
}
}
}
}
-
You will get
Could not add the product with SKU my-simple-product to the shopping cart: The fewest you may purchase is 1.
error. This is the expected result. -
Now, please add
1
xmy-simple-product
into shopping cart
mutation {
addSimpleProductsToCart(
input: {
cart_id: "d4viG4wIYOorhYCOxGsxd3GTjn8DnBqc"
cartItems: {
data: {
qty: 1
sku: "my-simple-product"
}
}
}
) {
cart {
items {
id
qty
}
}
}
}
- You will get
{
"data": {
"addSimpleProductsToCart": {
"cart": {
"items": [
{
"id": "131",
"qty": 1
}
]
}
}
}
}
- Let's update
my-simple-product
quantity throughupdateCartItems
mutation query
mutation {
updateCartItems(input: {
cart_id: "d4viG4wIYOorhYCOxGsxd3GTjn8DnBqc"
cart_items: [
{
cart_item_id: 131
quantity: 0.5
}
]
}) {
cart {
items {
id
qty
}
}
}
}
Expected result (*)
updateCartItems
should return The fewest you may purchase is 1.
error:
Actual result (*)
updateCartItems
returns Invalid value of "0" provided for the qty field.
:
@TomashKhamlai , could you please review this issue and let me know if the expected result is correct?
Thank you!!
CC: @galaoleksandr