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

Adding Extra Fields to product list page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-14-2007, 04:02 AM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Adding Extra Fields to product list page

Can anyone tell me why I cant add the extra fields code to products_t.tpl

{if $active_modules.Extra_Fields ne ""}
{include file="modules/Extra_Fields/product.tpl"}
{/if}


The code works fine in product.tpl. I checked the if statement and it works. In the "modules/Extra_Fields/product.tpl" template there doesnt seem to be any fields required to make this work.

Any ideas would be greatly appreciated!

-dpm
__________________
x-cart-4.1.8gold
Reply With Quote
  #2  
Old 12-14-2007, 04:18 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Adding Extra Fields to product list page

Afraid it isn't that easy. Have a look here:

http://forum.x-cart.com/showthread.php?t=9540
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 12-14-2007, 09:55 AM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Re: Adding Extra Fields to product list page

Yikes... This has been an issue sicne 04... It's now 2008... One would think it would be standard by now... =/
__________________
x-cart-4.1.8gold
Reply With Quote
  #4  
Old 12-17-2007, 06:17 AM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Re: Adding Extra Fields to product list page

I'll get you the code to make it work for you, I'm at work now and can't grab it atm.
__________________
4.1.9
Reply With Quote
  #5  
Old 12-17-2007, 08:58 AM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Re: Adding Extra Fields to product list page

Much appreciated!

-dpm
__________________
x-cart-4.1.8gold
Reply With Quote
  #6  
Old 12-19-2007, 04:02 PM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Re: Adding Extra Fields to product list page

in products.php
After:
PHP Code:
if (!empty($active_modules["Subscriptions"])) {
    include 
$xcart_dir."/modules/Subscriptions/subscription.php";

Paste this
PHP Code:
if (!empty($active_modules["Extra_Fields"]) && !empty($products)) {
foreach(
$products as $k => $v) {
$products[$k]["extra_fields"] = func_query("SELECT $sql_tbl[extra_fields].field as field, $sql_tbl[extra_field_values].value as value, $sql_tbl[extra_fields].service_name as service_name FROM $sql_tbl[extra_fields]$sql_tbl[extra_field_values] WHERE $sql_tbl[extra_field_values].fieldid = $sql_tbl[extra_fields].fieldid AND $sql_tbl[extra_fields].active='Y' AND $sql_tbl[extra_field_values].productid = '$v[productid]'");
}


This is an example of what I use in skin1/customer/main/products.tpl or products_t.tpl (Whichever you use) after the product description

PHP Code:
<ul class="ProductDescUL">
{foreach 
from=$products[product].extra_fields item="ef"}
{if 
$ef.value ne ''}
<
li class="ProductDescLI"><span class="Bold">{$ef.field}:</span> {$ef.value}</li>
{/if}
{/foreach}
 </
ul
__________________
4.1.9
Reply With Quote
  #7  
Old 12-20-2007, 05:52 AM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Re: Adding Extra Fields to product list page

Thanks mate! Works perfectly.

-dpm
__________________
x-cart-4.1.8gold
Reply With Quote
  #8  
Old 12-20-2007, 06:09 AM
 
project_digital2 project_digital2 is offline
 

Member
  
Join Date: Oct 2007
Posts: 10
 

Default Re: Adding Extra Fields to product list page

Will this work in the cart.tpl?
__________________
Project Digital
www.projectdigital.com
x-cart version 4.1.9
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 10:46 PM.

   

 
X-Cart forums © 2001-2020