Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Extra field in related products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-15-2009, 02:54 AM
 
nck-k nck-k is offline
 

Newbie
  
Join Date: Mar 2009
Posts: 8
 

Default 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}&amp;cat={$cat}&amp;page={$navigation_page}{if $featured eq 'Y'}&amp;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}&amp;cat={$cat}&amp;page={$navigation_page}{if $featured eq 'Y'}&amp;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!
__________________
x-cart gold - 4.1.x
Reply With Quote
  #2  
Old 09-16-2009, 10:44 AM
 
speedfreq speedfreq is offline
 

Newbie
  
Join Date: Jul 2009
Posts: 3
 

Default Re: Extra field in related products

Was anyone able to figure this out? I really need to add extra fields to related products, but am just having no luck. Anyone?
__________________
X-Cart Gold 4.2
Reply With Quote
  #3  
Old 09-28-2009, 11:06 AM
 
buckyreal buckyreal is offline
 

Newbie
  
Join Date: Apr 2003
Posts: 5
 

Default Re: Extra field in related products

I'm interested in doing this too... is it possible?
__________________
Tobias Ross
Ineye.com

Xcart 4.2.2
Reply With Quote
  #4  
Old 09-28-2009, 11:21 AM
 
speedfreq speedfreq is offline
 

Newbie
  
Join Date: Jul 2009
Posts: 3
 

Default Re: Extra field in related products

This is what did it for me. Finally figured it out after a while of playing around...

changes made in /modules/Upselling_Products/related_products.tpl

{$product_links[cat_num].extra_fields[1].value}
{$product_links[cat_num].extra_fields[2].value}{$product_links[cat_num].extra_fields[3].value}

Those will list the first 3 extra fields values. If you want the field name I believe you sub in "field_value" for "value". You can also use a variable in a loop such as something like this:

<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 "SHORT_DESC"}
{$product_links[cat_num].extra_fields[field].field_value}
{/if}
{/section}</span>
__________________
X-Cart Gold 4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:32 PM.

   

 
X-Cart forums © 2001-2020