nck-k |
07-15-2009 02:54 AM |
Extra field in related products
Hi,
If you take a look at http://www.medicalonlineshop.nl/tandpasta-whitening/safe-white-combi.html you see "Safe & White Combi Aanbieding!" as the title of the product.
Actually only "Safe & White Combi" is the title of the product and "Aanbieding" is an extra field that will be displayed whithin the title on the product page and categorypages.
Now at the bottom of the product page, there are some upselling/related products. Here you only see the title and not the extra field. I would like to also display the extra field here.
I use these codes:
related_products.tpl (that is included in product.tpl)
Code:
{* $Id: related_products.tpl,v 1.15.2.1 2007/05/02 06:05:39 max Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
{section name=cat_num loop=$product_links}
<div class="product-display"> <a href="product.php?productid={$product_links[cat_num].productid}">{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=150 product=$product_links[cat_num].product tmbn_url=$product_links[cat_num].tmbn_url}</a> {if $active_modules.Special_Offers ne "" && $product_links[cat_num].have_offers && $usertype eq 'C'}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$product_links[cat_num]}
{/if} <a href="product.php?productid={$product_links[cat_num].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}" class="product-display-name">{$product_links[cat_num].product} <span>{section name=field loop=$product_links[cat_num].extra_fields}
{if $product_links[cat_num].extra_fields[field].active eq "Y" && $product_links[cat_num].extra_fields[field].field_value && $product_links[cat_num].extra_fields[field].service_name eq "SERVICE_NAME01"}
{$product_links[cat_num].extra_fields[field].field_value}
{/if}
{/section}</span></a>
<div class="product-display-sum"> {if $product_links[cat_num].product_type eq "C"}
{else}
{if $active_modules.Subscriptions ne "" and ($product_links[cat_num].catalogprice gt 0 or $product_links[cat_num].sub_priceplan gt 0)}
{else}
{if ($config.General.unlimited_products ne "Y" && ($product_links[cat_num].avail le 0 or $product_links[cat_num].avail lt $product_links[cat_num].min_amount) && $product_links[cat_num].variantid) or ($product_links[cat_num].taxed_price ne 0 or ($product_links[cat_num].variantid && $product_links[cat_num].variants_has_price) or ($active_modules.Special_Offers ne "" and $product_links[cat_num].use_special_price ne ""))}
{if $product_links[cat_num].taxed_price ne 0 or ($product_links[cat_num].variantid && $product_links[cat_num].variants_has_price)}
{if $product_links[cat_num].list_price gt 0 and $product_links[cat_num].taxed_price lt $product_links[cat_num].list_price}
{math equation="100-(price/lprice)*100" price=$product_links[cat_num].taxed_price lprice=$product_links[cat_num].list_price format="%3.0f" assign=discount}
{if $discount gt 0} <span class="price">{include file="currency.tpl" value=$product_links[cat_num].list_price}</span> {/if}
{/if}
{if $active_modules.Special_Offers ne "" and $product_links[cat_num].use_special_price ne ""}
{/if} <span class="price">{include file="currency.tpl" value=$product_links[cat_num].taxed_price}</span> <span class="price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product_links[cat_num].taxed_price}</span> {if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if}
{if $active_modules.Special_Offers ne "" and $product_links[cat_num].use_special_price ne ""}
{/if}
{if $product_links[cat_num].taxes} <br />
<div class="PListTaxBox">{include file="customer/main/taxed_price.tpl" taxes=$product_links[cat_num].taxes is_subtax=true}</div>
{/if}
{/if}
{if $active_modules.Special_Offers ne "" and $product_links[cat_num].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$product_links[cat_num]}
{/if}
{else} <font class="ProductPrice">{$lng.lbl_enter_your_price}</font> {/if}
{/if}
{/if} <span class="btw">Incl. BTW excl. verzendkosten</span> </div>
<a href="product.php?productid={$product_links[cat_num].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}"><img src="/skin1/assets/themes/08/images/product-display-more.png" /></a>
<div class="product-display-rating"> {include file="ratings/ratings_recom.tpl"} </div>
</div>
<!--<a href="product.php?productid={$product_links[cat_num].productid}" class="ItemsList">{$product_links[cat_num].product}</a>-->
{/section}
{/capture}
{include file="dialog_recom.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog}
{/if}
You see the code where i try to insert the extra field, but it doesn't work:
Code:
<span>{section name=field loop=$product_links[cat_num].extra_fields}
{if $product_links[cat_num].extra_fields[field].active eq "Y" && $product_links[cat_num].extra_fields[field].field_value && $product_links[cat_num].extra_fields[field].service_name eq "SERVICE_NAME01"}
{$product_links[cat_num].extra_fields[field].field_value}
{/if}
{/section}</span>
Can someone help me?
Thank you!
|