Odt template - Product nature

Hello, please advise if anyone has already done so. In the business offer, I need to merge products according to product nature. For example, product nature is “Electrical” and it contains products - button, bulb, cable, etc. Or “Pneumatic” - terminal, clutch, valve … In * .odt template I would need to display the price merged according to product nature. I can’t figure it out. Thank you very much.
Edit: or with tag/category

Tag/category are made for that.

But it will not be possible to

You need to go for PDF template an a bit of code.

Thank You for Your answer. This is a little bit difficult for me :-(. I will try it.