Closed
Description
Describe the bug
On BO, when adding/updating a product on an already paid order, the message in Payment block "Warning €XX paid instead of €XX" is not added/updated immediately. A refresh is needed (on Legacy refresh wasn't needed).
Please note that when a voucher is added, the Payment block is automatically updated without refresh.
Expected behavior
Payment block should be updated each time an update is made on the order.
Steps to Reproduce
Steps to reproduce the behavior:
- Have a paid order
- Go to BO > Orders > On the paid orders
- Add or Edit a product on the order
- The "Warning" message in payment block is not displayed
- Refresh the page : Warning message is now displayed.
Screenshots
On screenrecord : I add a product, Payment block is not updated. I refresh : The "warning" message is now updated in Payment block.
https://drive.google.com/file/d/1A5gryu4jr0oSdI7B4Oy_UeulJeNVp39Z/view?usp=sharing
Additional information
- PrestaShop version: 1770rc1build1
- PHP version: N/A
Activity
prestashop-issue-bot commentedon Oct 5, 2020
Thanks for opening this issue! We will help you to keep its state consistent
sowbiba commentedon Oct 5, 2020
Fixing this issue means add a route to get order's payments. Too big to add it after RC1 release I think
@PrestaShop/prestashop-core-developers @PrestaShop/prestashop-maintainers WDYT ?
jolelievre commentedon Oct 5, 2020
Hi @Robin-Fischer-PS,
regarding your side note when a Voucher is added, it indeed works because adding a voucher performs a page request that redirects to the view page so everything is updated when the submit button is clicked.
However add/remove product manipulation happen via ajax calls and JS updates, which is why the Payment block is not updated. As @sowbiba noticed we have no JS code nor server side API to update this block dynamically for now. It would require to either create a JSON API and the js code that can interpret and replace it. Or a more simple "API" that simply returns the block html code This has been done in other refresh calls although it's far from ideal it has the advantage to be easy to implement and can withstand hooks and template overrides better.
We have a similar issue regarding the Carrier block #21267 when shipping is updated the Order details are updated but not the OrderCarrier ones.
To me it is indeed a regression from the previous behaviour, I'd be more in favor of fixing this for the next 177 version, even if it implies adding new endpoints in the OrderController. Though I don't know if it's considered a new feature (forbidden after code freeze) or a missing feature that should have been coded and could be added in the next patch version? @eternoendless what do you think?
LouiseBonnard commentedon Oct 7, 2020
For a patch version instead of 1.7.7.
12 remaining items