I am having trouble getting the array below to display correctly in a smarty template file. This should be a quick fix for someone who knows what they are doing. Just copy my array, send me the smarty code I need to use. I need this fix right away. The first person to give me the answer gets the job.
Array
( [71] => Array ( [title] => Women [id] => 71 [productCount] => 3 [171] => Array ( [id] => 171 [title] => Footwear [productCount] => 2 [74] => Array ( [id] => 74 [title] => Boots [productCount] => 2 )
)
[172] => Array
(
[id] => 172
[title] => Accessories
[productCount] => 1
[74] => Array
(
[id] => 74
[title] => Boots
[productCount] => 1
)
)
)
[72] => Array
(
[title] => Men
[id] => 72
[productCount] => 2
[171] => Array
(
[id] => 171
[title] => Footwear
[productCount] => 2
[74] => Array
(
[id] => 74
[title] => Boots
[productCount] => 2
)
)
)
)
my template code looks like this:
{foreach from=$trackingGroups item=gender key=k item=v}
{assign var=tc value=”`$v.id`”}
{$v.title} ({$v.productCount})<br />
{foreach item=department from=$trackingGroups.$tc item=v2} {$v2.title}
{/foreach} {/foreach}
but the page displays like this:
Women (3)<br />
W<br />
7<br />
3<br />
Footwear<br />
Accessories<br />
Men (2)<br />
M<br />
7<br />
2<br />
Footwear<br />
i need it to display like this showing all levels of the array.
Women (3)<br />
Footwear (2)<br />
– Boots (2) <br/>
Accessories (1)<br />
– Boots (1)
Men (2)<br />
Footwear (2)<br />
– Boots (2)<br />