You can do this in agreement template itself. For example: {if $smarty.request.product_id == 1} Agreement for first product {/if} {if $smarty.request.product_id == 2} Agreement for second product etc... {/if} etc...