remyessers Posted November 28, 2012 Share Posted November 28, 2012 Hallo, Ik zou graag de accessoires van een product willen tonen op de categorie-pagina. De lijst met producten wordt gegenereerd door product-list.tpl van mijn thema: {if isset($products)} <!-- Products list --> <ul id="product_list" class="clear"> {foreach from=$products item=product name=products} <li class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.index % 2}alternate_item{else}item{/if} clearfix"> <div class="center_block"> <div> <a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_img_link" title="{$product.name|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /> {if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}<h3>{$product.name|truncate:20:'..'|escape:'htmlall':'UTF-8'}</h3></a> </div> {if isset($comparator_max_item) && $comparator_max_item}<p class="compare" style="position:absolute"><input type="checkbox" onclick="checkForComparison({$comparator_max_item})" class="comparator" id="comparator_item_{$product.id_product}" value="{$product.id_product}" /></p>{/if} <div class="right_block"> {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='On sale!'}</span>{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span> {/if} {if isset($product.online_only) && $product.online_only}<span class="online_only">{l s='Online only!'}</span>{/if} {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} {if isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} <!-- prev price --> <p class="prv-price" style="display: inline;"> <!--{if $priceDisplay >= 0 && $priceDisplay <= 2} {if $product.price_without_reduction > $product.price} <strike> {convertPrice price=$product.price_without_reduction} {if isset($product.reduction) && $product.reduction} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if} </strike> {/if} {/if} </p> {/if} <!-- price --> <p><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p> <div class="rating">{$avg_rating}</div> <div class="availability_display"> {if $product.quantity <= 0} <span><img src="/themes/t1_clothes/img/nocheck.png" /> Niet op voorraad</span> {else} <span><img src="/themes/t1_clothes/img/check.png" /> Product op voorraad</span> {/if} </div> {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {/if} {/if} {/if} </div></div> </li> {/foreach} </ul> <!-- /Products list --> {/if} Hoe kan ik de accessoires van ieder product aanroepen? In product.tpl lukt dat wel en zie ik onderstaande code: {if isset($accessories) AND $accessories} <!-- accessories --> <p><strong>{l s='Accessories'}</strong></p> <ul> {foreach from=$accessories item=accessory name=accessories_list} {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)} <li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description"> <a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}"> <img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /> <h5>{$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}</h5></a> <p> {if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<span class="price">{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</span>{/if}</p> </li> {/foreach} </ul> {/if} Deze code zou ik eigenlijk willen gebruiken voor ieder product op de categorie pagina, maar deze variabelen kan ik niet aanroepen. Hoe zorg ik dat ik deze toch kan gebruiken? Alvast bedankt! Link to comment Share on other sites More sharing options...
scorpionsworld Posted November 28, 2012 Share Posted November 28, 2012 [standaard reply modus] - Welke versie van Prestashop gebruik je? - Wat is de URL(s) van de site indien van toepassing? - Screenshots? [/standaard reply modus] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now