steve_ec Posted August 22, 2010 Share Posted August 22, 2010 I'm trying to figure out how to add a list of addons related to each product while browsing the products/services. In the template file configureproduct.tpl the $addons and $addon variables are available. I'm having trouble finding the means of adding these for the products.tpl file. Any help would be appreciated. Thanks! Steve 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted August 22, 2010 Share Posted August 22, 2010 This is taken directly from the configureproduct.tpl template: {if $addons} <tr><td colspan="2"><strong>{$LANG.cartaddons}</strong></td></tr> <tr class="orderheadingrow"><td colspan="2"></td></tr> {foreach key=num item=addon from=$addons} <tr class="orderrow{if $num % 2}2{else}1{/if}"><td>{$addon.checkbox}</td><td><label for="a{$addon.id}"><strong>{$addon.name}</strong> - {$addon.description} ({$addon.pricing})</label></td></tr> {/foreach} <tr class="orderheadingrow"><td colspan="2"></td></tr> <tr><td height="10"></td></tr> {/if} Here is some code that is dumbed down so its easier to understand: {if $addons} {foreach key=num item=addon from=$addons} {$addon.checkbox} {$addon.name} - {$addon.description} ({$addon.pricing})<br /> {/foreach} {/if} This should create a list of checkboxes for each addon available. 0 Quote Link to comment Share on other sites More sharing options...
steve_ec Posted August 22, 2010 Author Share Posted August 22, 2010 I wish it were that simple, but the variables $addons and $addon are not available for the products.tpl file. Thanks for your quick answer. 0 Quote Link to comment Share on other sites More sharing options...
steve_ec Posted August 22, 2010 Author Share Posted August 22, 2010 I could do an sql query using the {php} tag in the template but I was hoping that there was already a way to retrieve the product addons via another method. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.