Search code examples
twigshopware6

Hiding promotion / discount field


I am trying to remove the discount/promotion field on the off canvas cart. This is the path to the page that has the code for the field: storefront/page/checkout/cart

I am adding a plugin using the exact same path in the plugins directory, which looks like this:

{% sw_extends '@Storefront/storefront/page/checkout/cart/index.html.twig' %}

{% block page_checkout_cart_add_promotion %}
{% endblock %}

I expected this to override the original codeblock for page_checkout_cart_add_promotion and leave it as empty, but upon update, this fails to hide the promotion/discount field.


Solution

  • Solved: The above code/ plugin location relates to the promotion field when displaying the shopping cart. To remove the promotion field from the offcanvas cart as well, you will need to have the twig file: /component/checkout/offcanvas-cart.html.twig

    Here is the code for this file:

    {% sw_extends '@Storefront/storefront/component/checkout/offcanvas-cart.html.twig' %}
    
    {% block component_offcanvas_cart_actions_promotion %}
    {% endblock %}