View Single Post
  #6  
Old 02-20-2008, 01:08 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Add extra field to Featured Products

I was not much wrong, the task easier, here is a solution to your problem.

1. Create "Extra fileds" for the author, called "author" (name of the field should not be changed, Default value - Empty).

2. Create a new file "skin1/modules/Extra_Fields/product2.tpl" with the following content:
PHP Code:
{section name=field loop=$products[product].extra_fields}
{if 
$products[product].extra_fields[field].active eq "Y" && $products[product].extra_fields[field].value && $products[product].extra_fields[field].field eq "author"}
<
b>{$products[product].extra_fields[field].field}</b> - 
{
$products[product].extra_fields[field].value}
<
br>
{/if}
{/
section

3.Edit the file "skin1/customer/main/products.tpl"
after lines (for xcart 4.1.9 gold):
PHP Code:
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}{if $featured eq 'Y'}&amp;featured{/if}"><font class="ProductTitle">{$products[product].product}</font></a>
{if 
$config.Appearance.display_productcode_in_list eq "Y" and $products[product].productcode ne ""}
<
br />
{
$lng.lbl_sku}: {$products[product].productcode}
{/if} 

insert next lines:
PHP Code:
<br>
{if 
$active_modules.Extra_Fields ne ""}
{include 
file="modules/Extra_Fields/product2.tpl"}
{/if} 

4. Happy end

When the module is active "extra fileds, and the product in the" featured product", and for "extra fileds" defined value "author " - will be displayed.

It also displays the value of field "author" when viewing content category.
If the feature is not required, need to make some changes.
Reply With Quote