2010-11-19 4 views
-1

Я пытаюсь изменить следующий код, чтобы показать все пользовательские поля. Этот код показывает только пользовательские поля, у которых есть цена, но я хочу показать все пользовательские поля, включая бесплатные.PHP HTML-корзина с использованием HTML-шаблона

<td valign="top">{$contents[0].category_name} - <strong>{$contents[0].name}</strong> {if $contents[2][0]}({$contents[2][0].name}){/if}<br/> 
      </td> 
      <td align="center">{if $contents[0].setup!=0}{$contents[0].setup|price:$currency}{else}-{/if}</td> 
      <td align="center">{if $contents[0].price==0}<strong>{$lang.Free}</strong>{elseif $contents[0].prorata_amount} 
     <strong> {$contents[0].prorata_amount|price:$currency}</strong> 
      ({$lang.prorata} {$contents[0].prorata_date|dateformat:$date_format}){else}<strong>{$contents[0].price|price:$currency}</strong>{/if}</td> 
     </tr> 
     {/if} 

     {if $cart_contents[1]} 
       {foreach from=$cart_contents[1] item=cstom} 
       {if $cstom.total>0} 
       <tr > 
      <td valign="top" class="blighter fs11" style="padding-left:15px">{$cstom.fullname}<br/> 
      </td> 
      <td align="center" class="blighter fs11">{if $cstom.setup!=0}{$cstom.setup|price:$currency}{else}-{/if}</td> 
      <td align="center" class="blighter fs11"><strong>{if $cstom.price==0}{$lang.Free}{elseif $cstom.prorata_amount}{$cstom.prorata_amount|price:$currency}{else}{$cstom.price|price:$currency}{/if}</strong></td> 
     </tr> 


       {/if} 
       {/foreach} 

      {/if} 

     {if $contents[3]} 

     {foreach from=$contents[3] item=addon} 
     <tr > 
     <td>{$lang.addon} <strong>{$addon.name}</strong></td> 
     <td align="center">{if $addon.setup!=0}{$addon.setup|price:$currency}{else}-{/if}</td> 
     <td align="center">{if $addon.price==0}<strong>{$lang.Free}</strong>{elseif $addon.prorata_amount}<strong>{$addon.prorata_amount|price:$currency}</strong> ({$lang.prorata} {$addon.prorata_date|dateformat:$date_format}){else}<strong>{$addon.price|price:$currency}</strong>{/if}</td> 

Я предполагаю, что я должен изменить эту область на линии 39

{if $cart_contents[1]} 
     {foreach from=$cart_contents[1] item=cstom} 
     {if $cstom.total>0} 

Но я не знаю, как это сделать. Надеюсь, кто-то поможет мне в этом вопросе.

Спасибо.

+2

Слишком много исходного кода. –

+0

И «dunno» на самом деле не слово. – cambraca

ответ

0

Вы пробовали только удаление, если

{if $cart_contents[1]} 
     {foreach from=$cart_contents[1] item=cstom} 
     <tr > 
    <td valign="top" class="blighter fs11" style="padding-left:15px">{$cstom.fullname}<br/> 
    </td> 
    <td align="center" class="blighter fs11">{if $cstom.setup!=0}{$cstom.setup|price:$currency}{else}-{/if}</td> 
    <td align="center" class="blighter fs11"><strong>{if $cstom.price==0}{$lang.Free}{elseif $cstom.prorata_amount}{$cstom.prorata_amount|price:$currency}{else}{$cstom.price|price:$currency}{/if}</strong></td> 
</tr> 
     {/foreach} 

    {/if} 
+0

привет McWafflestix, я редактирую свой пост и делаю его только по коду, надеюсь, теперь все в порядке ... cambraca dunno word mean, я не знаю .... спасибо Свен Альмгрен за ваш ответ, но я пробую его раньше и страница не загружается, когда я удаляю весь код – iLinux85

Смежные вопросы