Search code examples
twigfrontendshopwarestorefrontshopware6

How to create custom field in Shopware 6 and show it on frontend?


How do i make a custom created field in Shopware 6 and show it on the frontend/storefront by using a Twig file?


Solution

  • Go to Settings > System > Custom Fields -> Add new set. Or Add field to existing Custom field set.

    Add this to the Twig template:

    {{context.salesChannel.customFields.your_custom_field | trans}}
    

    Change SalesChannel to the type the custom field is associated with.

    Change your_custom_field to the “technical name” specified in the custom field. “trans” is added to get the local translation.