$SESSION and FOREACH STATEMENT

Discussion in 'Customization & add-ons' started by dereck_j2, Dec 6, 2007.

  1. dereck_j2

    dereck_j2 Member

    Joined:
    Aug 22, 2006
    Messages:
    42
    Hi all.

    How do I do the following:

    I have a FOREACH statement inmy SMARTY template:

    {foreach from=$coupons item=c}{$c.code}{/foreach}

    I need to get the result of the FOREACH statement into s $_SESSION var.

    I have tried:

    {php} echo $_SESSION['cc'] ={/php} {foreach from=$coupons item=c}{$c.code}{/foreach}

    But this does not work.

    Can anyone help please.

    Best regards

    Dereck
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Derek,
    This is not clear what result should be put in session exactly? $coupons $c $c.code?

Share This Page