Several bug fix on cart related with products stock#501
Several bug fix on cart related with products stock#501kpodemski merged 3 commits intoPrestaShop:developfrom
Conversation
| if (productData) { | ||
| if (productData.availability === 'unavailable' | ||
| && productData.allow_oosp === 0 | ||
| && Number(productData.quantity_wanted) > Number(productData.stock_quantity)) { | ||
| const diff = Number(productData.stock_quantity) - Number(productData.quantity_wanted); | ||
| await sendUpdateCartRequest(productData.update_quantity_url as string, diff); | ||
| } | ||
| } |
There was a problem hiding this comment.
| if (productData) { | |
| if (productData.availability === 'unavailable' | |
| && productData.allow_oosp === 0 | |
| && Number(productData.quantity_wanted) > Number(productData.stock_quantity)) { | |
| const diff = Number(productData.stock_quantity) - Number(productData.quantity_wanted); | |
| await sendUpdateCartRequest(productData.update_quantity_url as string, diff); | |
| } | |
| } | |
| if (productData | |
| && productData.availability === 'unavailable' | |
| && productData.allow_oosp === 0 | |
| && Number(productData.quantity_wanted) > Number(productData.stock_quantity)) { | |
| const diff = Number(productData.stock_quantity) - Number(productData.quantity_wanted); | |
| await sendUpdateCartRequest(productData.update_quantity_url as string, diff); | |
| } |
There was a problem hiding this comment.
Thank you for the suggestion, your solution looks more readable 🔥
ga-devfront
left a comment
There was a problem hiding this comment.
all it's good for me, thank you for your contribution !
sallemiines
left a comment
There was a problem hiding this comment.
Hello @GytisZum
Thanx for this PR !
I tried to check this PR , and here is some feedback :
-
Proceed to checkout" button is not disable in the cart page if order is not available and product has not enough quantityif order is not available and product has not enough quantity ❌
-
Toast color is changed to red 🆗 but the order quantity for this product not exist ❌
You can check the attached screen recorder
Product.1789.mp4
- The amount in cart is exceeded with current stock amount you should see the toast and input value which will change back to previous. ❌
You can check the attached screen recorder
Cart.mp4
Please check & feedback !
Thank y !
sallemiines
left a comment
There was a problem hiding this comment.
Hello @GytisZum
Thanx for this PR !
I tried to check this PR , and here is some feedback :
-
Proceed to checkout" button is not disable in the cart page if order is not available and product has not enough quantityif order is not available and product has not enough quantity ❌
-
Toast color is changed to red 🆗 but the order quantity for this product not exist ❌
You can check the attached screen recorder
Product.1789.mp4
- The amount in cart is exceeded with current stock amount you should see the toast and input value which will change back to previous. ❌
You can check the attached screen recorder
Cart.mp4
Please check & feedback !
Thank y !
|
Hello, thanks you for testing the fixes. However I see that you are using PrestaShop version 1.7.8.9. Please can you check on PrestaShop 8.1.0 ?? |
Thnx for your feedback ! I re-test the PR on PS 810 as you mentioned before
You can check the attached screen recorder Mug.Today.is.a.good.day.mp4Waiting for yr feedback ! Thank you |
Hello again, Thank You for Your Feedback !! After comparison I found that real candidate version has changes in cart page which affects the behavior of the error messages. I did some communication with the core team and got answer that tests must be done on stable version which does not exist at the moment, but closest one is PrestaShop version 8.1.0-rc.1. Sorry I was not precise enough, but maybe you can test it on more stable version ?? :) Waiting for the feedback |
|
@sallemiines you can use the same build that QA tests for the final 8.1 release |
aniszr
left a comment
There was a problem hiding this comment.
Hello @GytisZum
Thanks for your PR, I tested it with 8.1.0 build 2 & Develop .
-
Proceed to checkout" button is not disable in the cart page if order is not available and product has not enough quantityif order is not available and product has not enough quantity ✔️
-
Toast color is changed to red and the order quantity for this product ✔️
-
Amount in cart is exceeded with current stock amount you should see the toast and input value which will change back to previous. ✔️
LGTM, QA ✔️
Mug.Today.is.a.good.day.mp4
Thanks!
|
Ping @Hlavtox for merge 😉 |
|
thanks @GytisZum |
|
@kpodemski hi, i want this also fixed for 8.0.X . |


How to test:
Button Disabled:
Steps:
Toast Color:
Product quantity fix:
Bonus fix:
Console error:

This error is occurred due to loading element which does not exist yet, but it's trying to initiate it on checkout pages. This error related with carrier extra content on checkout.
To test it need to check if carrier extra content works as previously.
Environment:
Hummingbird version: develop
PrestaShop version 8.1.0