[SOLVED] Displaying Individual Custom Fields in Products 2.1.2

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Daryn

[SOLVED] Displaying Individual Custom Fields in Products 2.1.2

Post by Daryn »

This has been absolutely driving me up the wall for the past couple of hours. Instead of doing a foreach to display all of the product fields, I want to input them into their own areas 1 at a time because I only want to display certain ones on the summary template, and everything else on the detail template.

Absolutely nothing I've tried works. Any idea on how I need to write it?

I've tried things like

Code: Select all

{$entry->customnamehere}
TIA
Last edited by Daryn on Wed Jan 07, 2009 4:23 pm, edited 1 time in total.
Daryn

Re: Displaying Individual Custom Fields in Products 2.1.2

Post by Daryn »

BTW, I've done

Code: Select all

{$entry->fields|print_r}
but I guess I'm just not sure on how I need to structure the string to call to the specific field and its value to output them on the front end.
bryan

Re: Displaying Individual Custom Fields in Products 2.1.2

Post by bryan »

Hey, Daryn. Try something like this...

Code: Select all

{foreach from=$items item=entry}
{assign var='field' value=$entry->fields}
{foreach from=$field item=thisfield}
{assign var=$thisfield->name value=$thisfield->value}
{/foreach}

{$customnamehere}

{/foreach}
Daryn

Re: Displaying Individual Custom Fields in Products 2.1.2

Post by Daryn »

Hey Bryan,

Thanks, I'll give that a try. I appreciate you not replying with something like "RTFM" or flaming me.  8)
bryan

Re: [SOLVED] Displaying Individual Custom Fields in Products 2.1.2

Post by bryan »

I'll leave that to the professionals  ;)
porridj
Forum Members
Forum Members
Posts: 12
Joined: Wed Jan 07, 2009 3:04 pm

Re: [SOLVED] Displaying Individual Custom Fields in Products 2.1.2

Post by porridj »

{$entry->fields.Brand->value}

{$entry->fields.FIELDNAMEHERE->value}

try that... i think it works (it works for me and im pretty sure thats what your after!)

saved me i was looking for ages.

Im running into walls left right and centre trying to follow the design ive been given...let me know how you get on :)
GBR
New Member
New Member
Posts: 9
Joined: Sat Dec 27, 2008 1:28 am
Location: Wellington, New Zealand

Re: [SOLVED] Displaying Individual Custom Fields in Products 2.1.2

Post by GBR »

porridj wrote: {$entry->fields.Brand->value}

{$entry->fields.FIELDNAMEHERE->value}

try that... i think it works (it works for me and im pretty sure thats what your after!)

saved me i was looking for ages.
Thanks porridj - that was exactly what I was looking for.

Regards
Locked

Return to “Modules/Add-Ons”