VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Kuubs on January 30, 2016, 21:03:34 PM

Title: How to get some values regarding custom fields?
Post by: Kuubs on January 30, 2016, 21:03:34 PM
Hello,

How can you check the custom fields data, like counting how much custom fields questions are in the product page, etc.

I've tried to use the rowHeights in the sublayout from the addtocart:

if(!empty($rowHeights['customfields'])) {

But that always gives a value of 1, even if there are none custom fields present.

Thanks!
Title: Re: How to get some values regarding custom fields?
Post by: GJC Web Design on January 31, 2016, 11:45:00 AM
$rowheights????

check the $this->product object

customs are in arrays like   $this->product->customfieldsSorted['normal']
Title: Re: How to get some values regarding custom fields?
Post by: Kuubs on February 02, 2016, 11:36:28 AM
Quote from: GJC Web Design on January 31, 2016, 11:45:00 AM
$rowheights????

check the $this->product object

customs are in arrays like   $this->product->customfieldsSorted['normal']

Where can I find these values? Why isn't documented which objects I can check from the $product? Because your example always gives me 0 if I count the array, even if there is a custom field present.
Title: Re: How to get some values regarding custom fields?
Post by: GJC Web Design on February 02, 2016, 11:55:48 AM
QuoteWhy isn't documented which objects I can check from the $product?

because all you have to do is echo it out!

If u want to doc it off you go...  this is an open source project!

print 'Debug Line '.__LINE__.' $this->product <pre>'; print_r ($this->product); print "</pre><br />\n";
Title: Re: How to get some values regarding custom fields?
Post by: Kuubs on February 03, 2016, 18:36:14 PM
Quote from: GJC Web Design on February 02, 2016, 11:55:48 AM
QuoteWhy isn't documented which objects I can check from the $product?

because all you have to do is echo it out!

If u want to doc it off you go...  this is an open source project!

print 'Debug Line '.__LINE__.' $this->product <pre>'; print_r ($this->product); print "</pre><br />\n";

That's exactly what I was searching! Thanks!

EDIT: Wow, I just realize what kind of moron I am  :-X Still thanks!