DARKF3D3 Posted September 7, 2021 Share Posted September 7, 2021 I'm trying to add a custom block showing text "ORDER COMPLETED" into the order detail page, just after the last product of the list. This because somethime could happen that the warehouse miss last product of the list. So with a block with a background of different color I think we could reduce these errors. I looked into this file, but I'm unable to do add the block there: /src/Adapter/Order/QueryHandler/GetOrderProductsForViewingHandler.php Any help? Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 8, 2021 Author Share Posted September 8, 2021 I found the correct file to for PS1.7.7.7: /httpdocs/src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/product_list.html.twig So I added this code into the for cycle: {% if loop.last == true %} <tr><td colspan="8" style="background:#3c8f41;color:white;font-size:1.4rem;font-weight:bold;text-align:center;padding:.6rem;width:100%;">ORDER COMPLETED</td></tr> {% endif %} The problem it's that when products are paginated, the block it's showed at the end of each page, instead of showing it only at the last one. Link to comment Share on other sites More sharing options...
Janett Posted September 9, 2021 Share Posted September 9, 2021 Can you make a screenshot and annotate it in order to understand what you want Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 13, 2021 Author Share Posted September 13, 2021 (edited) You can see an example in the screenshot below (it's the green bar showed at the end of product list into the order detail). With the code i wrote in my previous post It is already working correctly, but only when products are not paginated. Because when they're paginated the block it's showed at the end of each page, intead of only at the last one. It might be fine for me also to disable the pagination and showing always products on a single list, regardless of number or products. But I don't know how to do that. Edited February 24, 2023 by DARKF3D3 (see edit history) Link to comment Share on other sites More sharing options...
DARKF3D3 Posted February 24, 2023 Author Share Posted February 24, 2023 The solution was to add the code into the file "product.html.twig" instead of "product_list.html.twig". This customization works also on PS8, but please note that on each upgrade you will loose it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now