Jump to content

Add custom block just after product list into b.o. order detail page (PS1.7.7)


DARKF3D3

Recommended Posts

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

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

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 by DARKF3D3 (see edit history)
Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...