I am looking for a way to check if certain products of a specific category are in cart and then based on that hide a specific payment method.

I have found this thread which deals with basically the same problem but checks if a certain product is in cart.

I'd like to tackle this with a broader approach, thus aiming for categories since products can be added all the time.

1 Answer 1


I solved this by using Stash. I now check for certain channels that contain products where payment with PayPal isn't allowed.

It goes like this:

{exp:stash:set name="is_channel" parse_tags="yes" parse_conditionals="yes" default="0"}
        {if channel_name == "channel_a"}1{/if}
        {if channel_name == "channel_b"}1{/if}
        {if channel_name == "channel_c"}1{/if}

then in the template code:

{exp:stash:parse process="end"}
    {if {exp:stash:is_empty name="is_channel"}}
        Content here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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