I also found a pattern. We go to the order, there are 4 items in its basket. If we remove for example 2 products and add up to 2 products, then everything works. If we add 3 products, there is no reaction. Those. if the number of elements in the array increases then it doesn't work. If the number of elements is the same or less, then it works.
Array in this variable:
form.value.calculations.basket
Here's an example of what an array with two products looks like.
"calculations": {
"basket": [
{
"type": "product",
"id": 77,
"name": "enim dolor",
"anonce": null,
"price": "7.00",
"quantity": 1,
"exclude_composition": [],
"picture_info": null,
"actual_price": "7.00",
"total": "7.00"
},
{
"type": "product",
"id": 77,
"name": "enim dolor",
"anonce": null,
"price": "7.00",
"quantity": 1,
"exclude_composition": [],
"picture_info": null,
"actual_price": "7.00",
"total": "7.00"
}
],
"total": "14.00"
},
The logic here is such that when adding a new product to the array, it looks like this:
{
"type": "product",
"id": 26,
"name": "cumque et",
"anonce": null,
"price": "75.00",
"quantity": 1,
"exclude_composition": []
}
Next comes a put request to update the cart calculations. After recalculating the basket, we rewrite it into a variable:
form.value.calculations = response?.data
The updated cart looks like this:
"calculations": {
"basket": [
{
"type": "product",
"id": 77,
"name": "enim dolor",
"anonce": null,
"price": "7.00",
"quantity": 1,
"exclude_composition": [],
"picture_info": null,
"actual_price": "7.00",
"total": "7.00"
},
{
"type": "product",
"id": 77,
"name": "enim dolor",
"anonce": null,
"price": "7.00",
"quantity": 1,
"exclude_composition": [],
"picture_info": null,
"actual_price": "7.00",
"total": "7.00"
},
{
"type": "product",
"id": 26,
"name": "cumque et",
"anonce": null,
"price": "75.00",
"quantity": 1,
"exclude_composition": [],
"picture_info": null,
"actual_price": "75.00",
"total": "75.00"
}
],
"total": "89.00"
I checked it many times. Really the problem is increasing the number of elements in this cart array. Why? Unclear.