Help? How to write a category if statement in checkout template

Hi all,

I want to show a agreement form in the checkout process that the user has to check if they buy a product from a certain category. Can someone help direct me to what I need to do? I just don’t know what to call in the template files.

There is a hook in summary.tpl called “checkout:terms_and_conditions”.

You can use it to customize what’s done at the summary step regarding T&C’s.


I am aware of that, I need to know how to test for if the cart holds products from a certain category so I can add a specialized terms and conditions.

Given that products can be in multiple categories, I would probably do a controller in your my_changes addon.

I’d loop through the products in the cart and if the product_id is a member of one of your targeted categories, I would add an element to the cart.products array of something like ‘targeted_product=true’.

Then in your template, you would look at a product and see if ‘targeted_product’ is ‘not empty’ and if so, do what you want to do.