jmbdev Posted January 26, 2024 Share Posted January 26, 2024 Hello, I want to display additional information on the order details page in the Administrator section. Specifically, I want to display the prices excluding tax for each product line as well as for the total order, and the percentage discount applied to each product. I have already added the excluding tax price information for each product line by creating a module that modifies the file PrestaShop/Admin/Sell/Order/Order/view.html.twig. This was possible because the file src\PrestaShopBundle\Controller\Admin\Sell\Order\OrderController.php, which manages this, injects the variable $orderForViewing in which this information is already present. So, I would like to access other information and make it available to the view PrestaShop/Admin/Sell/Order/Order/view.html.twig. However, OrderController is located in the /src folder of the project. It seems that we cannot override classes located in this folder. How can I proceed differently? Prestashop version 1.7.8.5 Link to comment Share on other sites More sharing options...
JBW Posted January 26, 2024 Share Posted January 26, 2024 You can decorade a controller or (easier) insert your custom hook in the twig file and call it in your module. Link to comment Share on other sites More sharing options...
jmbdev Posted February 7, 2024 Author Share Posted February 7, 2024 Thank you , indeed i used a hook as you said and managed to do what i desired 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