| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Extra fields outside of product.tpl | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Extra fields outside of product.tpl
Hi,
I'm wanting to be able to use extra fields outside of product.tpl (say in a category listing) - unfortunately calling {include file="modules/Extra_Fields/product.tpl"} doesn't seem to do the trick. Can anyone give me some advice about what the other part of the trick to this would be?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World - Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com) X-Cart Version 4.1.10 |
|||||||||
#2
|
|||||||
|
|||||||
Re: Extra fields outside of product.tpl
Lots of posts about how to do this - depends on your version. Your sig says 4.1, but you are in the 4.4 forum.
Start here: http://forum.x-cart.com/showthread.php?t=47812
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||||
|
|||||||||
Re: Extra fields outside of product.tpl
Extra fields on product details page is a separate array, on products list page is part of the product array. So calling extra field template directly won't work. Try passing to it extra fields array
{include file="modules/Extra_Fields/product.tpl" extra_fields=$product.extra_fields} check with the debug window the variable name is correct
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Extra fields outside of product.tpl
Thanks to both of you for your input on this.
cflsystems - do you expect that code should work on *any* page in the site? I'm trying to get this to work on the BCSE quick order module, but I'm wondering if the variable $product is something that is always available regardless of module, or if i would have to explicitly make it available? I have noticed their coding uses the variable $p instead of $product, but for some other customizations I was able to use $product (for cart functions.) I specifically only need to reference a single extra field for my purposes, and I've also tried using {$product.extra_fields[0].field_value} and {$p.extra_fields[0].field_value} but no such luck.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World - Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com) X-Cart Version 4.1.10 |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Extra fields outside of product.tpl
The code will not work on any page of the site of course but should work on products list pages. It all depends what is available on the page.
$products array is on every products list page regardless of what modules are in use. You still need to use the debug console and get the correct variable names from there.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: Extra fields outside of product.tpl
Aha. Thanks for clearing that up for me.
This is all being done inside an addon module that deals with cart functions and product functions...but it could very well be that it does not include the extra fields as part of its $p array. Can you point me in the direction, or to one of the .php files where the product array is loaded? I would like to see if I can try and force the extra fields to load.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World - Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com) X-Cart Version 4.1.10 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|