Avatar billede peder77 Nybegynder
25. maj 2005 - 15:58 Der er 1 løsning

En vare pr linie

Hej Ekspertene.

Jeg er ved at rette en webshop til  og er stødt ind i et problem.

Når man vælger at se alle varene i en kategori, står varene to og to ved siden af hinanden.
Jeg vil gerne have dem til at stå 1 vare pr linen!

Her er scriptet til den fil der henter varene
----------------------------------------------------------
{* product brief view (from a category or search) *}
{if $product_info ne NULL}
<p><table width=95% border=0 cellspacing=1 cellpadding=2>
<tr>
<td width=1% align=center valign=top>
{if $product_info[7]}
    <a href="index.php?productID={$product_info[11]}">
    <img src="products_pictures/{$product_info[7]}" alt="{$product_info[1]}" border=0><br>
    {$smarty.const.MORE_INFO_ON_PRODUCT}
    </a>
{else}
  {if $product_info[5]}
    <a href="index.php?productID={$product_info[11]}">
    <img src="products_pictures/{$product_info[5]}" alt="{$product_info[1]}" border=0>
    {$smarty.const.MORE_INFO_ON_PRODUCT}
    </a>
  {/if}
{/if}
</td>
<td valign=top width=99%>
<table width=100% border=0 cellpadding=2>
<tr>
<td valign=top>
  <table border=0 cellpadding=0 cellspacing=0>
  <tr>
  <td>
  <a class=cat href="index.php?productID={$product_info[11]}">{$product_info[1]}</a><br>
  {if $product_info[8] > 0} {* rating *}
    {section name=i loop=5}{if $smarty.section.i.index<$product_info[3]}<img src="images/redstar.gif">{else}<img src="images/blackstar.gif">{/if}{/section}
  {/if}
    </td>
  </td>
  </tr>
  </table>
</td>
<td align=right valign=top> {* arr to cart *}
    {if $smarty.const.CONF_SHOW_ADD2CART eq 1}
    {if $product_info[6] > 0}
            <a href="index.php?shopping_cart=yes&add2cart={$product_info[11]}"><img src="images/cart_small.gif" border=0 alt="{$smarty.const.ADD_TO_CART_STRING}"></a>
    {else}&nbsp;
    {/if}
    {/if}
</td>
</tr>
<tr>
<td colspan=2>
    {* show list price? *}
    {if $product_info[10] > 0 && $product_info[10] > $product_info[4] && $product_info[4] > 0}
        {$smarty.const.LIST_PRICE}: <font color=brown><strike>{$product_info[13]}</strike></font><br>
    {/if}

    <b>{$smarty.const.CURRENT_PRICE}: <font class=cat color=red>
    {if $product_info[4] <= 0}n/a{else}{$product_info[12]}{/if}
    </font></b>

    {* you save *}
    {if $product_info[10] > 0 && $product_info[10] > $product_info[4] && $product_info[4] > 0}
        <br>
        {$smarty.const.YOU_SAVE}:
        <font color=brown>{$product_info[14]} ({$product_info[15]}%)
        </font><br>
    {/if}
</td>
</tr>
<tr>
<td colspan=2>
    {$product_info[2]}
</td>
</tr>
</table>
</td>
</tr>
</table>
{/if}
-----------------------------------------
Vil lige sige at jeg ikke fatter særligt meget af PHP.
Håber der er en venlig sjæl som vil hjælpe.
Vh
Peter
Avatar billede peder77 Nybegynder
01. juni 2005 - 13:45 #1
der var ikke meget hjælp at hente her.
Jeg lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester