I would like to redirect users to an additional page in my checkout flow if they have a particular product type in their cart. Does anyone know how I can do that?


Well depends exactly what you want to do, but something along these lines...

{% set cart = craft.commerce.carts.cart %}

{% for lineItem in cart.lineItems %}
   {% if lineItem.purchasable.product.type == "whatever" %}
       {# item of that type found...redirect the user #} 
       {% redirect 'somewhere' %}
   {% endif %}
{% endfor %}

{# item of that type not found... #}
{% redirect 'elsewhere' %} 
...or your default stuff directly here...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.