Search code examples
vuejs2shopwareshopware6

Shopware 6 plugin: How can I add manufacturer name and technical name to Shopware extension list page?


I'm working on adding two new pieces of information to the extension list administration page in a Shopware 6 store:

  • The extension's manufacturer name
  • The extension's technical name

Here is the image of the extension list


Solution

  • The manufacturer name and technical name can be added to the Shopware 6 extension list page by overriding the sw-extension-card-base component:

    index.js would look like:

    import template from './sw-extension-card-base.html.twig';
    import './sw-extension-card-base.scss'; 
    
    import deDE from './snippet/de-DE.json';
    import enGB from './snippet/en-GB.json';
    
    const { Component, Defaults } = Shopware;
    
    Component.override('sw-extension-card-base', {
      template,
    
      snippets: {
        'de-DE': deDE,
        'en-GB': enGB
      }
    });
    

    The sw-extension-card-base.html.twig looks like:

    
    {% block sw_extension_card_base_meta_date %}
      {% parent %}
    
      <div>
        <span 
          v-if="extension.producerName"
          class="sw-extension-card-base__meta-info-version"
        >
          {{ $tc('sw-extension-card-base.override.manufacturer') }}: {{ extension.producerName }}
        </span>
      </div>
    
      <div>  
        <span
          v-if="extension.name" 
          class="sw-extension-card-base__meta-info-version"
        >
          {{ $tc('sw-extension-card-base.override.technicalName') }}: {{ extension.name }}
        </span>
      </div>
    {% endblock %}