VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: earlybird on August 14, 2013, 13:04:19 PM

Title: how to Display custom fields titles and custom field values on Cart template
Post by: earlybird on August 14, 2013, 13:04:19 PM
Hello there,
I want to display customfieldsvalues and customfieldtitles on the cart temlate.

at the moment i dispay only one string with all customfield values and titles,
they look like :
"<span>color:red</span><br><span>material:wood</span><br>..."
but i want to display them like
"<span class="title">color:</span><span class="value">red</span>"

but I don't know how to get them seperatly.
at the moment i use
foreach ($this->cart->products as $pkey => $prow) {
echo $prow->customfields;
}


Has somebody a hint for me ???
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: Maxim Pishnyak on August 14, 2013, 21:35:19 PM
echo $prow->customfields;
You could search <br /> in customfields.php
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: earlybird on August 15, 2013, 23:50:07 PM
Thanks!,
i found the <br />  in the model customfields.php
but isn't there a way to get those title/values
as an Object or an array?

so i could process them in the cart template
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: Maxim Pishnyak on August 16, 2013, 20:32:13 PM
Why you don't like 'kill <br />' method?

As for 'Object or an array?' I'm not sure there could be a post about this on forum. You could try to search.
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: earlybird on August 21, 2013, 12:02:13 PM
Cause this means I have to change a core file.
and on the next update it's gone.
or am I wrong ?
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: Maxim Pishnyak on August 21, 2013, 16:39:29 PM
You're right. You could program a plugin and don't hack a core.
Quote from: Maxim Pishnyak on August 16, 2013, 20:32:13 PM
As for 'Object or an array?' I'm not sure there could be a post about this on forum. You could try to search.
You didn't try to search?
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: earlybird on August 21, 2013, 18:21:41 PM
I tried now to search for this but may be I've the wrong search terms but
i didn't found it
do you may be have a link ?
Title: Re: how to Display custom fields titles and custom field values on Cart template
Post by: Maxim Pishnyak on August 24, 2013, 10:20:48 AM
http://forum.virtuemart.net/index.php?topic=100191.0