alt

Important information

Please be advised that there will be a scheduled downtime across our API network on November 05 and November 07, 2024. For more information, visit our platform status portal.:
- Scheduled maintenance on November 5, 2024
- Scheduled maintenance on November 7, 2024

Unzer

Customize the plugin

Customize the Shopware 5 plugin to suit your unique business requirements.

This section is optional for all your customizations. As an agency or developer, you can customize the plugin according to your requirements.

Before you begin

Set your language preferences for the payment methods

The Unzer Shopware 5 plugin by default delivers the text snippets in DE and EN. These are stored in namespaces in the Snippets > Snippet administration section.

Language preferences

You can add the translations in the Namespace folder with the various available options. You can use the search for Unzer in the upper right corner to easily find and edit each text snippet.

Edit Checkout success payment data texts

For all invoice payment methods, SEPA direct debit, and Unzer Prepayment, you can modify the text displayed on the checkout-finish-page. This is required for printing the bank details that the customer can refer to for making the payment.

Sign in to the backend, go to Configuration > Snippets and search for a few words you want to change.

Checkout success data texts

Checkout success page

  1. In the Shopware 5 backend, go to Configuration > Snippets.
  2. Type the words which you want to change in the upper right corner search field.
  3. Double-click the Value that you want to change.
  4. Select update.
  5. Clear the caches and compile themes after editing the templates.

Modify or add payment data on order confirmation email

You can modify the Shopware’s order confirmation e-mail and print out the bank details that the customer can refer to for making the payment.

  1. Open in Shopware’s backend Configuration > E-mail management > E-mail templates.

  2. Go in the left file manager to System emails > sORDER.

  3. Choose Plain text or HTML, depending on the emails your shop uses. Back end email templates

  4. Add the following code snippet where you want the data to be displayed.

    {if $additional.unzer.bankData}
        Bitte überweisen Sie den Betrag auf das nachfolgende Bankkonto:
        <table>
            <tr>
                <td><strong>IBAN</strong></td>
                <td>{$additional.unzer.bankData.iban}</td>
            </tr>     
            <tr>
                <td><strong>BIC</strong></td>
                <td>{$additional.unzer.bankData.bic}</td>
            </tr>
            <tr>
                <td><strong>Holder</strong></td>
                <td>{$additional.unzer.bankData.holder}</td>
            </tr>   
            <tr>
                <td><strong>Descriptor</strong></td>
                <td>{$additional.unzer.bankData.descriptor}</td>
            </tr> 
            <tr>
                <td><strong>Amount</strong></td>
                <td>{$additional.unzer.bankData.amount|currency}</td>
            </tr>   
        </table>
    {/if}
    
  5. Select Save template.

  6. Clear the caches and compile themes after editing the templates.

Modify the PDF invoice document

You can add the bank details, that the customer can refer to make the payment, to Shopware 5 PDF invoice. You can modify the footer of the invoice and its content. See Shopware invoice PDF. Example invoice for Shopware 5

Modify the PDF invoice content

Go to Configuration > Basic settings > Shop settings > PDF document creation. Click on the pencil icon next to Invoice to open the configuration for invoices. In the Elements section, choose UnzerPayment_Info. Now you can modify the content. Be careful and do not change variables such as {$bankData.holder}.

Settings PDF content

After editing, don’t forget to Save, and then clear the cache.

The plugin can also modify the footer section by replacing the shop’s own footer content.

Go to Configuration > Basic settings > Shop settings > PDF document creation. Click on the pencil icon next to Invoice to open the configuration for invoices. In Elements section, choose UnzerPayment_Footer. Now you can modify the content. Be careful and do not change variables such as {$bankData.holder}.

Settings PDF content

After editing, don’t forget to Save and then clear the cache.

Registered payment data

The references to the stored payment data of the end customers are available in the s_plugin_unzer_payment_vault table. For example, the reference IDs (column type_id) are available for your own subscription integration. For security reasons, an address_hash is generated when using other customer addresses, but this is only used in the plugin for validation of the subscription response from the payment system. The column user_id should be considered as a reference to the customer account in Shopware 5 plugin.

Screenshot of database table s_plugin_unzer_payment_vault

View stored log files

You can find the log file entries in your Shopware 5 backend Log.

  1. Go to Configuration > Logfile > Backend-Log.
  2. Select System-Log to view the log files, such as unzer_payment_production-2021-07-07.log for the log files generated on the 7 July 2021.

View of logfiles of Shopware

Changing templates

You can change or modify templates of plugin according to your requirements. The specific templates are available in the following directories:

For webpageDirectory
Payment methods on checkout/confirmUnzerPayment/Resources/views/frontend/unzer/_payment/frames/
Checkout finishUnzerPayment/Resources/views/frontend/unzer/_payment/behaviors/…
Account Payment site/registered payment dataUnzerPayment/Resources/views/frontend/unzer/_payment/account/…

Next Steps