Shopware 6 - Removing the revocation notice from the checkout

August 12, 2020 - 1 min read

Under German law, webshops need to have a revocation notice on their checkout - the so-called Widerrufsbelehrung. In Dutch shops, this revocation notice isn’t needed. However, there is no option in the Shopware admin to disable this notice so it will show up on every Shopware 6 install by default.

In my search to disable this notice, I found the views/storefront/page/checkout/confirm/index.html.twig file, with this piece of Twig templating code;

{% block page_checkout_confirm_revocation_notice %}
    {% if shopware.config.confirm.revocationNotice %}
        <p class="revocation-notice">
            {% block page_checkout_confirm_revocation_notice_link %}
                <a href="{{ path('frontend.cms.page',{ id: shopware.config.core.basicInformation.revocationPage }) }}"
                   title="{{ "checkout.confirmRevocationNotice"|trans|striptags }}"
                   data-url="{{ path('frontend.cms.page',{ id: shopware.config.core.basicInformation.revocationPage }) }}">
                    {{ "checkout.confirmRevocationNotice"|trans|sw_sanitize }}
            {% endblock %}
    {% endif %}
{% endblock %}

I could just sw_extend this Twig template in my own theme and remove the contents of that block, but I noticed there’s an if loop surrounding the notice that checks for shopware.config.confirm.revocationNotice. It turns out that this setting can be set through the command like this;

bin/console system:config:set confirm.revocationNotice 0

Now run bin/console bundle:dump and bin/console cache:clear and you’re all set.

Kyle Mathews

Written by Peter Jaap Blaakmeer @PeterJaap