Skip to content

Adding Promotion banners to Product Listing

1. Create a Metaobject Definition

This metaobject is used to configure promotion banner data.

  1. Go to Settings → Custom Data and add a metaobject definition.

  1. The definition name is “Promotion”. Make sure the type is also “promotion”.

  1. Add the definition fields - Image, Text, Button Text, URL, Position:

    • Image (type: File)

      The image of your banner.

  • Text (type: Single line text)

    The text that should be displayed on the banner.

  • Button Text (type: Single line text)

    The button text that should be displayed on the banner.

  • URL (type: URL)

    The URL to which the banner should redirect customers when clicked.

  • Position (type: Integer)

    Dictates after which product the promotion should be displayed in the grid.

  1. Click Save.

2. Create a Metafield Definition

This metafield is used to associate metaobjects with the collections to which promotions need to be shown.

  1. Go to Settings → Custom Data → Collections.

  1. Click “Add definition”.

  1. Configure the definition as follows:

    • Name: Promotions
    • Namespace and key: convermax.promotions
    • Type: Metaobject (List of entries); Reference: Promotion

  1. Click Save.

3. How to Use

  1. Go to Content → Metaobjects and click on the Promotion metaobject.

  1. Add a promotion entry and populate the promotion data.

    For example:

  1. Go to the collection in which you want to show the promotion and select entries in the “Promotions” metafield.

You can add multiple banners to a collection by creating multiple metaobject entries.