Shopware

Shopware Wishlist Enhancement: Displaying 'Added On' Dates for a Superior Customer Experience

The wishlist is more than just a feature; it's a powerful tool in the e-commerce arsenal, bridging customer intent with future purchases. It allows shoppers to curate collections of desired items, acting as a personal shopping assistant. While Shopware offers robust out-of-the-box wishlist functionality, savvy store owners and developers often seek to enhance it, providing even richer, more personalized experiences. One such enhancement, frequently requested and recently highlighted in the Shopware forum, is the ability to display the exact date an item was added to a customer's wishlist directly in the frontend.

Shopware Wishlist Data Model Diagram showing WishlistProduct createdAt
Shopware Wishlist Data Model Diagram showing WishlistProduct createdAt

Why 'Added On' Dates Matter: Enhancing User Experience and Merchant Insights

At Migrate My Store, we understand that every detail contributes to a superior online shopping experience. Displaying the 'added on' date for wishlist items might seem like a minor tweak, but its impact is significant for both your customers and your business:

  • For Customers: Memory Jog & Urgency: Shoppers often add items to their wishlist and forget about them. Seeing a date like "Added on: 15.03.2024" can serve as a gentle reminder, prompting them to reconsider the purchase. It can also create a subtle sense of urgency if they realize an item has been on their list for a while, especially if stock is limited or a sale is approaching.

  • For Customers: Personalization & Organization: It helps users organize their thoughts and prioritize purchases. They might have added items for different occasions or at different times of the year, and the date provides valuable context.

  • For Merchants: Behavioral Insights: While not directly visible to the merchant in the frontend, understanding that customers value this information can inform backend analytics. Knowing how long items sit on wishlists can provide insights into purchasing cycles, pricing sensitivity, or the effectiveness of marketing campaigns targeting wishlist items.

  • For Merchants: Targeted Promotions (Future Potential): With this data exposed, you could potentially build features that highlight "items added over 30 days ago" or offer special discounts on "long-term wishlist items," driving conversions.

The Technical Hurdle: Why Standard Twig Variables Fall Short

The forum user 'candem' articulated a common challenge faced by many Shopware developers: how to access this specific 'added to wishlist' timestamp. Their initial, logical attempts using standard Twig variables illustrate a frequent misunderstanding of Shopware's data structure:

Attempt 1: {{ product.createdAt|date("d.m.Y") }}

As candem correctly observed, this snippet displays the date when the product itself was created in the Shopware backend. This is the timestamp associated with the product's initial entry into your catalog, not when a specific customer decided to add it to their personal wishlist. While vital for product management and inventory tracking, it doesn't serve our purpose here.

Attempt 2: {{ wishlist.createdAt|date("d.m.Y") }}

This attempt resulted in displaying the current date for all items on the wishlist. This behavior occurs because wishlist.createdAt typically refers to the creation date of the overall wishlist entity itself, or in some contexts, might default to a current timestamp if the specific item-level creation date isn't directly accessible through that path. It doesn't provide the granular, per-item addition date we're looking for.

Both attempts, while intuitive, highlight a crucial point: the 'added to wishlist' date is not stored directly on the product entity, nor is it a property of the overarching wishlist entity that applies uniformly to all its contents. Instead, this specific timestamp resides within the relationship between a customer's wishlist and an individual product.

The Solution: Accessing the Individual Wishlist Item's Creation Date

In Shopware, a customer's wishlist is essentially a collection of wishlist items. Each of these items is an entity that links a specific product to a specific wishlist and, crucially, stores its own createdAt timestamp. This is the key to unlocking the desired functionality.

Step-by-Step Implementation Guide:

To display the 'added on' date, you'll need to modify your Shopware theme. Remember to always use theme inheritance to avoid direct modifications to core files, ensuring your changes are update-safe.

  1. Identify the Correct Template File: The wishlist items are typically rendered in a template file related to the wishlist page. For Shopware 6, this is commonly found within your theme's structure, often overriding or extending a block in storefront/page/wishlist/index.html.twig or a related component template that iterates over the wishlist products.

  2. Locate the Wishlist Item Loop: Within this template, you'll find a Twig loop that iterates over each product in the customer's wishlist. It often looks something like this:

    {% for item in page.wishlist.products %}
        {# ... product details ... #}
    {% endfor %}

    The item variable within this loop represents an individual wishlist product entity, which contains the createdAt property we need.

  3. Insert the Correct Twig Code: Inside this loop, where you want the date to appear (e.g., near the product name or price), add the following Twig snippet:

    Added on: {{ item.createdAt|date("d.m.Y") }}

    This code accesses the createdAt property of the individual item (wishlist product entity) and formats it to "day.month.year".

  4. Clear Shopware Cache: After making any template changes, it's crucial to clear your Shopware cache to see the updates in the frontend. You can do this via the Shopware admin panel (Settings > Cache & Performance > Clear cache) or via the command line (bin/console cache:clear).

Example Context (Simplified):

Imagine your wishlist-item.html.twig (or similar) looks something like this:

{{ item.product.translated.name }}

Price: {{ item.product.price.first.unitPrice|currency }}

Added on: {{ item.createdAt|date("d.m.Y") }}

View Product

Advanced Customization and Best Practices

  • Date Formatting: The date filter is highly flexible. You can customize the output format (e.g., "Y-m-d H:i" for date and time, or "F j, Y" for a more verbose format like "April 20, 2026").

  • Localization: For multi-language stores, consider using Shopware's localization features or Twig's localizeddate filter if available and configured, to display dates according to the customer's locale.

  • Styling: Use CSS to style the displayed date to match your theme's aesthetics. The example uses

    , providing a hook for your stylesheets.

  • Error Handling: While createdAt is generally reliable, in more complex scenarios, you might add a check like {% if item.createdAt %} ... {% endif %} to prevent errors if the property is unexpectedly missing.

  • Theme Inheritance: Always create a custom theme or extend your current theme to override Shopware's default templates. Never modify files directly in vendor/shopware/ or the core theme, as these changes will be lost during updates.

Your Partner in Shopware Excellence: Migrate My Store

Implementing custom features like displaying 'added on' dates on your Shopware wishlist can significantly enhance your store's usability and customer satisfaction. However, navigating Shopware's intricate data models and template structures can be challenging, especially for those new to the platform or undertaking complex migrations.

At Migrate My Store, we specialize in seamless e-commerce migrations and expert Shopware development. Whether you're moving from an older platform to Shopware, upgrading your current Shopware version, or need bespoke customizations to unlock your store's full potential, our team of experts is here to help. We ensure your Shopware store is not just functional, but optimized for performance, user experience, and future growth.

Don't let technical hurdles stand in the way of providing an exceptional shopping experience. Contact us today to discuss your Shopware migration or customization needs, and let us help you build a truly outstanding online store.

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools