Add stock informations on cart page#919
Conversation
|
Good start. |
|
@Touxten @tblivet PR ready - PrestaShop/PrestaShop#40653 |
Fixed by : PrestaShop/PrestaShop#40662 |
|
Hi @Hlavtox @Touxten, thanks for your work 🙏 I’ll try to have a look at this during the day. Just one thing: I believe both PRs should be pointed to 9.1.x. The one from @Hlavtox is pointed to 9.1.x, but yours @Touxten is pointed to 9.0.x. Ideally, this should be available for 9.1.0 at the same time we release Hummingbird 2.0.0 ! |
|
My PR fixes an existing issue, while Daniel's adds new features. So my fix will arrive when 9.0.x is merged into 9.1.x. |
|
@Hlavtox That’s my bad, I messed up in my PR and was using submessage instead of delivery_time. I’ve just pushed a fix 👍 |
|
@tblivet The code for delivery is actually a bit more complicated, because the core doesn't provider proper data. But, it can be simplified both in cart and on product, page, if this PR gets merged - PrestaShop/PrestaShop#40673. |
|
@Hlavtox OK, you handle all the logic on the PHP side, in fact, it would be much more cleaner in the FO 👍 |
0eb4d44 to
190bba1
Compare
Hlavtox
left a comment
There was a problem hiding this comment.
One last tweak, I will reapprove immediately 🙏
And one question @tblivet @ga-devfront - guys, why is there the condition to put hidden? Isn't the block automatically rendered and replaced as a whole? Cannot we just not render it at all if both availability and delivery message is missing?
|
@Hlavtox I pushed a fix. Is this what you were asking? I’m not 100% sure. The |
|
PR merged, well done! Message to @PrestaShop/committers: do not forget to milestone it before the merge. |



NOTE: this PR should be test with PrestaShop/PrestaShop#40653 and PrestaShop/PrestaShop#40673 and PrestaShop/PrestaShop#40662
This PR is only a POC to display stock information on the cart page. Core-side changes will be required to properly implement it.
This is a preview of what could be achieved if the core is adapted. I have identified some issues with error messages returned by the core. For example, when a product in the cart is no longer in stock, the current message is something like:
"You can only add 0 qty of this product."
A more appropriate message would be something like:
"Please remove the product (XXX) from the cart." when the available quantity is ≤ 0.