How to customize catalog promotion labels?

Sylius provides flexible ways to display and style catalog promotion labels on your storefront. You can:

  • Change the labels

  • Customize them using Twig hooks

This guide walks you through customizing the labels separately for:

  • Product Show Page

  • Product Index Page (Product Cards)


Product Show Page Customization

To display and customize catalog promotion labels on the product show page:

1. Inspect the Element to Find Hook Definitions

The catalog promotion labels are rendered via the following Twig hook:

2. Create the Custom Template

Once you’ve identified the hook, create a custom Twig template for how the labels should appear:

3. Configure the Twig Hook

To ensure Sylius uses your new template, register the template:

βœ… Result

After implementing these changes, the catalog promotion labels will be displayed with your custom template on the product show page.


Product Index Page

Inspect a product card (e.g., on the category or search result page).

1. Inspect the Element to Find Hook Definitions

The catalog promotion labels are rendered via the following hook:

Under this hook, you'll see the component name:

2. Create the Template for Index Page Labels

Due to Sylius using anonymous Twig components for product cards, you must override them via a component name:

3. Configure the Hook for the Product Index Page

Define your custom component by template name defined in templates/components directory:

βœ… Result

After implementing these changes, the catalog promotion labels will be displayed with your custom template on the product index page.

circle-exclamation

Last updated

Was this helpful?