Do you use Shopware5 or Shopware6?
- Shopware 5 uses Smarty in the storefront and ExtJS in Admin.
- Shopware 6 is build with Twig and VueJs.
If you want to access data from the database I’d recommend doing this in PHP and use the Repository of the Entity.
If you need the data in a specific view you could use a subscriber (explained here).
CLICK HERE to find out more related problems solutions.