Jump to content
xt:Commerce Community Forum

product_listing 3 Spalten pro Zeile???


objekt

Recommended Posts

Ich benutze VEYTON 4.0 und würde gern die product_listing_v1.html so verändern, dass man 3 Produkte pro Zeile sieht und die Standardinfos unter dem Produktbild erscheint(Artikelname, Preis, etc.). Standard ist 1 Produkt pro Zeile und Infos neben Produktbild.

Hab schon einiges probiert und verzweifelt. Bitte um HIIIIIILLLLFEE.

Danke im vorraus.

Link to comment
Share on other sites

Du musst um Deine Tabelle, Deine Liste oder Deinen Div Container das herum bauen:

{foreach name=aussen item=module_data from=$product_listing}

{php} $col++;

{/php}

.......

{php}

if ($col>=3) {

$col=0;

echo '';

}

{/php}

{/foreach}

Hab das jetzt mal so abgeändert. Leider keine Änderung

siehst du da noch einen "Fehler". Danke für deine Hilfe.

Hier der Code

{$categories}

{if $product_listing}

{if $heading_text}<h1>{$heading_text}</h1>{/if}

{if $PRODUCTS_DROPDOWN}{$PRODUCTS_DROPDOWN}{/if}

{if $sort_dropdown.options}

<div class="products_sort">

{form type=form name=sort_dropdown action='dynamic' method=get}

{form type=hidden name=page value='categorie'}

{form type=hidden name=cat value=$current_category_id}

{form type=select name=sorting value=$sort_dropdown.options default='' onchange='this.form.submit();'}

{form type=formend}

</div>

{/if}

{if $MANUFACTURER_DROPDOWN}

<div class="products_sort">

{if $MANUFACTURER_DROPDOWN}{$MANUFACTURER_DROPDOWN}{/if}

</div>

{/if}

{if $manufacturer}

{$manufacturer.MANUFACTURER.manufacturers_description}

{/if}

<div class="hrproductpreview"></div>

{foreach name=aussen item=module_data from=$product_listing}

{php} $col++;

{/php}

<table class="productPreview" width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

{if $module_data.products_image!=''}<td class="productPreviewImage"><a href="{$module_data.products_link}">{img img=$module_data.products_image type=m_info class=productImageBorder alt=$module_data.products_name}</a></td>{/if}

<td class="productPreviewContent">

<h2><a href="{$module_data.products_link}">{$module_data.products_name}</a></h2>

{if $module_data.date_available!=''}

<ul class="info_info">

<li class="infoInfo">{txt key=TEXT_PRODUCT_AVAILABLE} {$module_data.date_available|date_format:"%A, %B %e, %Y"}</li>

</ul>

{/if}

{if $module_data.review_stars_rating}

<div class="reviews_rating_light"><div class="reviews_rating_dark" style="width:{$module_data.review_stars_rating}%"></div></div>

{/if}

{if $module_data.products_short_description}<p>{$module_data.products_short_description}</p>{/if}

{if $smarty.const._CUST_STATUS_SHOW_PRICE eq '1'}

<p class="price">{$module_data.products_price.formated}</p>

<p class="taxandshippinginfo">{$module_data.products_tax_info.tax_desc}{if $module_data.products_shipping_link}<a href="{$module_data.products_shipping_link}" target="_blank" rel="nofollow">{txt key=TEXT_EXCL_SHIPPING}</a>{/if}</p>

{if $module_data.base_price}<p class="vpe">{$module_data.base_price.price} {txt key=TEXT_SHIPPING_BASE_PER} {$module_data.base_price.vpe.name}</p>{/if}

{/if}

{if $module_data.products_weight > 0}<p class="taxandshippinginfo">{txt key=TEXT_PRODUCTS_WEIGHT}: {$module_data.products_weight} KG</p>{/if}

{if $module_data.shipping_status}<p class="shippingtime">{txt key=TEXT_SHIPPING_STATUS} {$module_data.shipping_status}</p>{/if}

{if $module_data.stock_image}

<p class="stockimage">{img img=$module_data.stock_image.image type=t_img_stockrules alt=$module_data.stock_image.name}</p>

<p class="stockimagetext">{$module_data.stock_image.name}</p>

{/if}

{if $module_data.allow_add_cart eq 'true'}

{form type=form name=product action='dynamic' link_params=getParams method=post}

{form type=hidden name=action value=add_product}

{form type=hidden name=product value=$module_data.products_id}

<div class="addtobasketlisting">

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td style="width:100%">{form type=text name=qty value=1 style='width:50px;'}</td>

<td>{button text=$smarty.const.BUTTON_ADD_CART file='button_in_cart.gif' type='form' btn_template='tpl_button_2.gif' space_left='25'}</td>

</tr>

</table>

</div>

{form type=formend}

{/if}

</td>

</tr>

</table>

<div class="hrproductpreview"></div>

{php}

if ($col>=3) {

$col=0;

echo '';

}

{/php}

{/foreach}

<div id="NAVIGATION">

<div class="COUNT">{$NAVIGATION_COUNT}</div>

<div class="PAGES">{$NAVIGATION_PAGES}</div>

</div>{/if}

{$error_listing}

Beste Grüße

Link to comment
Share on other sites

also, bei mir hat dies hier geholfen...

{foreach name=aussen item=module_data from=$product_listing}

{php}

$col++;

{/php}

{assign var=maxcol value=$smarty.const._STORE_MAX_CATEGORIES_PER_ROW}

{php}

$maxcol=$this->get_template_vars('maxcol');

if ($col>=$maxcol) {

$col=0;

echo '<tr></tr>';

}

{/php} {/if}

{/foreach}

Gruß

GoriBoy

Link to comment
Share on other sites

also, bei mir hat dies hier geholfen...

Gruß

GoriBoy

in welche Zeile muss das rein? Ich bekomm da nämlich ne Fehlermeldung:

Fatal error: Smarty error: [in /..../htdocs/templates/.../xtCore/pages/product_listing/product_listing_v1.html line 41]: syntax error: mismatched tag {/if}. expected {/foreach} (opened line 29). (Smarty_Compiler.class.php, line 2300) in /..../xtFramework/library/smarty/Smarty.class.php on line 1095

Link to comment
Share on other sites

sorry,

so muß das aussehen...

{foreach name=aussen item=module_data from=$product_listing}

{php}

$col++;

{/php}

{assign var=maxcol value=$smarty.const._STORE_MAX_CATEGORIES_PER_ROW}

{php}

$maxcol=$this->get_template_vars('maxcol');

if ($col>=$maxcol) {

$col=0;

echo '</tr><tr>';

}

{/php}

{/foreach}

Gruß

GoriBoy

Link to comment
Share on other sites

das sieht schonmal gut aus. Danke! Jetzt sind aus meinen 3 Produkten 9 geworden ;) Irgendwie ist der Abbruch der Schleifen noch nicht so wie es müsste. sieht wie folgt aus.

ProduktA, ProduktB, ProduktC

----------------------------

ProduktA, ProduktB, ProduktC

----------------------------

ProduktA, ProduktB, ProduktC

Link to comment
Share on other sites

ich habs gefunden. Und funktioniert auch Super. Müssten halt nur noch kleine CSS-Datails abgeändert werden.

{$categories}

{if $product_listing}

{if $heading_text}<h1>{$heading_text}</h1>{/if}

{if $PRODUCTS_DROPDOWN}{$PRODUCTS_DROPDOWN}{/if}

{if $sort_dropdown.options}

<div class="products_sort">

{form type=form name=sort_dropdown action='dynamic' method=get}

{form type=hidden name=page value='categorie'}

{form type=hidden name=cat value=$current_category_id}

{form type=select name=sorting value=$sort_dropdown.options default='' onchange='this.form.submit();'}

{form type=formend}

</div>

{/if}

{if $MANUFACTURER_DROPDOWN}

<div class="products_sort">

{if $MANUFACTURER_DROPDOWN}{$MANUFACTURER_DROPDOWN}{/if}

</div>

{/if}

{if $manufacturer}

{$manufacturer.MANUFACTURER.manufacturers_description}

{/if}

<div class="hrproductpreview"></div>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

{foreach name=aussen item=module_data from=$product_listing}

{php} $col++;

{/php}

<td class="main">

<table class="productPreview" width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

{if $module_data.products_image!=''}<td class="productPreviewImage"><a href="{$module_data.products_link}">{img img=$module_data.products_image type=m_info class=productImageBorder alt=$module_data.products_name}</a></td>{/if}

<td class="productPreviewContent">

<h2><a href="{$module_data.products_link}">{$module_data.products_name}</a></h2>

{if $module_data.date_available!=''}

<ul class="info_info">

<li class="infoInfo">{txt key=TEXT_PRODUCT_AVAILABLE} {$module_data.date_available|date_format:"%A, %B %e, %Y"}</li>

</ul>

{/if}

{if $module_data.review_stars_rating}

<div class="reviews_rating_light"><div class="reviews_rating_dark" style="width:{$module_data.review_stars_rating}%"></div></div>

{/if}

{if $module_data.products_short_description}<p>{$module_data.products_short_description}</p>{/if}

{if $smarty.const._CUST_STATUS_SHOW_PRICE eq '1'}

<p class="price">{$module_data.products_price.formated}</p>

<p class="taxandshippinginfo">{$module_data.products_tax_info.tax_desc}{if $module_data.products_shipping_link}<a href="{$module_data.products_shipping_link}" target="_blank" rel="nofollow">{txt key=TEXT_EXCL_SHIPPING}</a>{/if}</p>

{if $module_data.base_price}<p class="vpe">{$module_data.base_price.price} {txt key=TEXT_SHIPPING_BASE_PER} {$module_data.base_price.vpe.name}</p>{/if}

{/if}

{if $module_data.products_weight > 0}<p class="taxandshippinginfo">{txt key=TEXT_PRODUCTS_WEIGHT}: {$module_data.products_weight} KG</p>{/if}

{if $module_data.shipping_status}<p class="shippingtime">{txt key=TEXT_SHIPPING_STATUS} {$module_data.shipping_status}</p>{/if}

{if $module_data.stock_image}

<p class="stockimage">{img img=$module_data.stock_image.image type=t_img_stockrules alt=$module_data.stock_image.name}</p>

<p class="stockimagetext">{$module_data.stock_image.name}</p>

{/if}

{if $module_data.allow_add_cart eq 'true'}

{form type=form name=product action='dynamic' link_params=getParams method=post}

{form type=hidden name=action value=add_product}

{form type=hidden name=product value=$module_data.products_id}

<div class="addtobasketlisting">

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td style="width:100%">{form type=text name=qty value=1 style='width:50px;'}</td>

<td>{button text=$smarty.const.BUTTON_ADD_CART file='button_in_cart.gif' type='form' btn_template='tpl_button_2.gif' space_left='25'}</td>

</tr>

</table>

</div>

{form type=formend}

{/if}

</td>

</tr>

</table>

<div class="hrproductpreview"></div>

</td>

{php}

if ($col>=3) {

$col=0;

echo '</tr><tr>';

}

{/php}

{/foreach}

</tr>

</table>

<div id="NAVIGATION">

<div class="COUNT">{$NAVIGATION_COUNT}</div>

<div class="PAGES">{$NAVIGATION_PAGES}</div>

</div>{/if}

{$error_listing}

Link to comment
Share on other sites

  • 5 months later...

Hallo,

bei mir funktioniert weder dukie6666s Version, noch GoriBoys seine. Wo kann denn der Fehler liegen?

{$categories}
{if $product_listing}
{if $heading_text}<h1>{$heading_text}</h1>{/if}
{if $PRODUCTS_DROPDOWN}{$PRODUCTS_DROPDOWN}{/if}

{if $sort_dropdown.options}
<div class="products_sort">
{form type=form name=sort_dropdown action='dynamic' method=get}
{form type=hidden name=page value='categorie'}
{form type=hidden name=cat value=$current_category_id}
{form type=select name=sorting value=$sort_dropdown.options default='' onchange='this.form.submit();'}
{form type=formend}
</div>
{/if}

{if $MANUFACTURER_DROPDOWN}
<div class="products_sort">
{if $MANUFACTURER_DROPDOWN}{$MANUFACTURER_DROPDOWN}{/if}
</div>
{/if}

{if $manufacturer}
{$manufacturer.MANUFACTURER.manufacturers_description}
{/if}

<div class="hrproductpreview"></div>
{foreach name=aussen item=module_data from=$product_listing}
{php}
$col++;
{/php}

<table class="productPreview" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
{if $module_data.products_image!=''}<td class="productPreviewImage"><a href="{$module_data.products_link}">{img img=$module_data.products_image type=m_thumb class=productImageBorder alt=$module_data.products_name}</a></td>{/if}
<td class="productPreviewContent">
<h1><a href="{$module_data.products_link}">{$module_data.products_name}</a></h1>
{if $module_data.review_stars_rating}
<div class="reviews_rating_light"><div class="reviews_rating_dark" style="width:{$module_data.review_stars_rating}%"></div></div>
{/if}
{if $module_data.products_short_description}<p>{$module_data.products_short_description}</p>{/if}
{if $smarty.const._CUST_STATUS_SHOW_PRICE eq '1'}
<p class="price">{$module_data.products_price.formated}</p>
<p class="taxandshippinginfo">{$module_data.products_tax_info.tax_desc}{if $module_data.products_shipping_link}<a href="{$module_data.products_shipping_link}" target="_blank" rel="nofollow">{txt key=TEXT_EXCL_SHIPPING}</a>{/if}</p>
{if $module_data.base_price}<p class="vpe">{$module_data.base_price.price} {txt key=TEXT_SHIPPING_BASE_PER} {$module_data.base_price.vpe.name}</p>{/if}
{/if}
{if $module_data.products_weight > 0}<p class="taxandshippinginfo">{txt key=TEXT_PRODUCTS_WEIGHT}: {$module_data.products_weight} KG</p>{/if}
{if $module_data.shipping_status}<p class="shippingtime">{txt key=TEXT_SHIPPING_STATUS} {$module_data.shipping_status}</p>{/if}

{if $module_data.stock_image}
<p class="stockimage">{img img=$module_data.stock_image.image type=t_img_stockrules alt=$module_data.stock_image.name}</p>
<p class="stockimagetext">{$module_data.stock_image.name}</p>
{/if}

{if $module_data.allow_add_cart eq 'true'}
{form type=form name=product action='dynamic' link_params=getParams method=post}
{form type=hidden name=action value=add_product}
{form type=hidden name=product value=$module_data.products_id}
<div class="addtobasketlisting">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td style="width:100%">{form type=text name=qty value=1 style='width:50px;'}</td>
<td>{button text=$smarty.const.BUTTON_ADD_CART file='button_in_cart.gif' type='form' btn_template='tpl_button_2.gif' space_left='25'}</td>
</tr>
</table>
</div>
{form type=formend}
{/if}

</td>
</tr>
</table>
<div class="hrproductpreview"></div>
{php}
if ($col>=3) {
$col=0;
echo '';
}
{/php}
{/foreach}
<div id="NAVIGATION">
<div class="COUNT">{$NAVIGATION_COUNT}</div>
<div class="PAGES">{$NAVIGATION_PAGES}</div>
</div>{/if}
{$error_listing}[/PHP]

zweie version

[PHP]{$categories}
{if $product_listing}
{if $heading_text}<h1>{$heading_text}</h1>{/if}
{if $PRODUCTS_DROPDOWN}{$PRODUCTS_DROPDOWN}{/if}

{if $sort_dropdown.options}
<div class="products_sort">
{form type=form name=sort_dropdown action='dynamic' method=get}
{form type=hidden name=page value='categorie'}
{form type=hidden name=cat value=$current_category_id}
{form type=select name=sorting value=$sort_dropdown.options default='' onchange='this.form.submit();'}
{form type=formend}
</div>
{/if}

{if $MANUFACTURER_DROPDOWN}
<div class="products_sort">
{if $MANUFACTURER_DROPDOWN}{$MANUFACTURER_DROPDOWN}{/if}
</div>
{/if}

{if $manufacturer}
{$manufacturer.MANUFACTURER.manufacturers_description}
{/if}

<div class="hrproductpreview"></div>
{foreach name=aussen item=module_data from=$product_listing}
{php}
$col++;
{/php}

<table class="productPreview" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
{if $module_data.products_image!=''}<td class="productPreviewImage"><a href="{$module_data.products_link}">{img img=$module_data.products_image type=m_thumb class=productImageBorder alt=$module_data.products_name}</a></td>{/if}
<td class="productPreviewContent">
<h1><a href="{$module_data.products_link}">{$module_data.products_name}</a></h1>
{if $module_data.review_stars_rating}
<div class="reviews_rating_light"><div class="reviews_rating_dark" style="width:{$module_data.review_stars_rating}%"></div></div>
{/if}
{if $module_data.products_short_description}<p>{$module_data.products_short_description}</p>{/if}
{if $smarty.const._CUST_STATUS_SHOW_PRICE eq '1'}
<p class="price">{$module_data.products_price.formated}</p>
<p class="taxandshippinginfo">{$module_data.products_tax_info.tax_desc}{if $module_data.products_shipping_link}<a href="{$module_data.products_shipping_link}" target="_blank" rel="nofollow">{txt key=TEXT_EXCL_SHIPPING}</a>{/if}</p>
{if $module_data.base_price}<p class="vpe">{$module_data.base_price.price} {txt key=TEXT_SHIPPING_BASE_PER} {$module_data.base_price.vpe.name}</p>{/if}
{/if}
{if $module_data.products_weight > 0}<p class="taxandshippinginfo">{txt key=TEXT_PRODUCTS_WEIGHT}: {$module_data.products_weight} KG</p>{/if}
{if $module_data.shipping_status}<p class="shippingtime">{txt key=TEXT_SHIPPING_STATUS} {$module_data.shipping_status}</p>{/if}

{if $module_data.stock_image}
<p class="stockimage">{img img=$module_data.stock_image.image type=t_img_stockrules alt=$module_data.stock_image.name}</p>
<p class="stockimagetext">{$module_data.stock_image.name}</p>
{/if}

{if $module_data.allow_add_cart eq 'true'}
{form type=form name=product action='dynamic' link_params=getParams method=post}
{form type=hidden name=action value=add_product}
{form type=hidden name=product value=$module_data.products_id}
<div class="addtobasketlisting">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td style="width:100%">{form type=text name=qty value=1 style='width:50px;'}</td>
<td>{button text=$smarty.const.BUTTON_ADD_CART file='button_in_cart.gif' type='form' btn_template='tpl_button_2.gif' space_left='25'}</td>
</tr>
</table>
</div>
{form type=formend}
{/if}

</td>
</tr>
</table>
<div class="hrproductpreview"></div>
{assign var=maxcol value=$smarty.const._STORE_MAX_CATEGORIES_PER_ROW}
{php}
$maxcol=$this->get_template_vars('maxcol');
if ($col>=3) {
$col=0;
echo '</tr><tr>';
}
{/php}
{/foreach}
<div id="NAVIGATION">
<div class="COUNT">{$NAVIGATION_COUNT}</div>
<div class="PAGES">{$NAVIGATION_PAGES}</div>
</div>{/if}
{$error_listing}[/PHP]

Gruss flavor

Link to comment
Share on other sites

Du musst zwischen die Schleife schon den Inhalt so formatieen das diese nebeneinander passen.

Momentan hast Du im Code eine Tabelle mit 100% Breite:

<table class="productPreview" width="100%" border="0" cellspacing="0" cellpadding="0">[/CODE]

Du musst entweder Div container machen die nebeneinader floaten oder aber eine übergeordnete Tabelle schaffen die nach z.B . 3 Spalten umbricht.

Link to comment
Share on other sites

Danke für den Tip dukie6666,

hast mich einen großen Schritt weiter gebracht.

ich habe jetzt mal über css den div zum floaten gebracht und es klappt auch zum teil wie ich es haben möchte.

Habe bemerkt das der Code

{php}

$col++;

{/php}

dafür nicht erforderlich ist...warum?

Andere Frage: Wo finde ich die gepunktete Umbruch Strichlinie die auf dem Bild zu sehen ist? Sie zerstört die Ansicht und versetzt die Artikel. Vorher hat sie schön die Artikel untereinander getrennt, jetzt..nun ja. Warum trennt sie nicht mehr?

viele Grüße

post-90820-14337914979468_thumb.png

Link to comment
Share on other sites

dachte ich anfangs auch, genau das sollte es ja auch sein. Habe es dann mal entfernt, es ist aber leider nur eine Linie entfern worden, die oberste! danach habe ich sie wieder eingefügt. Jetzt habe ich die zeile wieder draußen und es sind immer noch weitere Linien zu sehen! Ich begreife das nicht!

gruß Greg

Link to comment
Share on other sites

dachte ich anfangs auch, genau das sollte es ja auch sein. Habe es dann mal entfernt, es ist aber leider nur eine Linie entfern worden, die oberste! danach habe ich sie wieder eingefügt. Jetzt habe ich die zeile wieder draußen und es sind immer noch weitere Linien zu sehen! Ich begreife das nicht!

gruß Greg

dann bastel dir mal eine eigene div. Erstell dir eine neu product_listing.html notfalls

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...