Jump to content

[Solved] Custom module with a column FAKTURY added to orders.


beshop

Recommended Posts

Hello, I have a problem, and I can't figure out why it doesn't work. I have a module where I can add a column and display the invoice name (I have custom invoices), but I want to include HTML code in the column. Since HTML is reportedly not supported directly, I created a custom Twig template. However, I keep getting the error: Content template for column type "custom_html" was not found.

 

Modul is in attachmet..

 

I'm feeling helpless; not even ChatGPT can help me. 😕

 

BIG thanks

fadoorders.zip

Edited by beshop (see edit history)
Link to comment
Share on other sites

Basically, I don’t actually need a module; I just need information on why PrestaShop 8 doesn’t allow me to insert HTML characters into a column. I included the module here so I wouldn’t have to write long snippets of code in this discussion. What I’m looking for is more about guidance on how to approach this issue, rather than creating a full module for me.

 

Link to comment
Share on other sites

Hello,

I just had a look over the provided module.

The problem seems to be the fact that you are not storing the .twig file in the correct location.

Moving the .twig file to /modules/fadoorders/views/PrestaShop/Admin/Common/Grid/Columns/Content/custom_html.html.twig should fix your error (I haven't tested but this is most likely case sensitive too), as highlighted in the official documentation

I have not tried with your specific .twig file, but creating one with the following code: <div>test</div> outputs the result as in my screenshot.

Please let me know if you have any additional queries and I'll try and see if I can help.

Screenshot from 2024-11-30 18-00-13.png

Edited by Andrei H
Change customhtml to custom_html to match the provided name (see edit history)
  • Thanks 1
Link to comment
Share on other sites

  • beshop changed the title to [Solved] Custom module with a column FAKTURY added to orders.

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...