I am having trouble getting the below array to display properly in a smarty template file. If anyone can help point me in the right direction I would be most thankful.
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 />
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
)
)
)
)