Hi, I sell products which usually come with additional files, say it bonuses, to be downloaded, as in the illustration below: Products: A, B, C (URLs set in Product URLs) Bonuses: 1, 2, 3, 4, 5 (URLs set in Additional URLs) If someone buys A, they will get A, 1, 2, and 3. In the member page, the list looks like this: A 1 2 3 If someone buys B, they will get B, 1, 2, and 5. In the member page, the list looks like this: B 1 2 5 However, if someone buys A and B, they will get A, 1, 2, 3, B, 1, 2 and 5. In the member page, the list looks like this: A 1 2 3 B 1 2 5 1 and 2 are shown twice. I'm wondering if there is a way to prevent these duplications. I've tried to set bonuses as 'products' but it means I can't automate the process of bonuses (1, 2, 3, 4, 5) being listed when someone purchases real products (A or B). Users will have to manually subscribe for additional products. Is there any other way? Many thanks.
you can show these urls after products links. Change this block in member_main.html template: Code: {foreach from=$member_products item=p} <li> {if $p.url gt "" } <a href="{$p.url}">{$p.title}</a> {else} <b>{$p.title}</b> {/if} </li> {foreach from=$p.add_urls item=t key=url} <li><a href="{$url}">{$t}</a></li> {/foreach} {/foreach} to Code: {foreach from=$member_products item=p} <li> {if $p.url gt "" } <a href="{$p.url}">{$p.title}</a> {else} <b>{$p.title}</b> {/if} </li> {/foreach} {php} $urls = array(); foreach($this->_tpl_vars['member_products'] as $p){ foreach($p['add_urls'] as $url =>$title){ if(!$urls[$url]){ print "<li><a href=\"$url\">$title</a></li>"; } $urls[$url]++; } } {/php}
Hi, Thanks for the codes above. I've checked my files and found that I only have members.html and not members_main.html. However, I did find similar codes like above in the file although the structure was written in tables (instead of lists). I managed to do the modification I wanted. Thanks for the hint.