Hi. I have a piece of information that I would like to display on member.html ONLY if they have an active recurring product. I have tried this: Code: {foreach from=$payments item=p} {if $p.cancel_url} Show some text {/if} {/foreach} ... But if the user has 2 or more recurring products it shows 2 or more outputs of the text that I want shown. So I tried this to limit to only 1 output: Code: {foreach from=$payments item=p name=payment_loop} {if $p.cancel_url} Show some text {/if} {if $smarty.foreach.payment_loop.iteration == 1} {php}break;{/php} {/if} {/foreach} ... But this only looks at one of their payments, which may miss an actual recurring product and thus give me the wrong output. What code can I use to determine if the user has ANY active recurring product, and then create a single output?
The simplest way is to test for {$user.data.cc} field. If user have active recurring product he have CC info in profile, if subscription is cancelled and expired CC info will be deleted so : {if $user.data.cc} do something {/if}