News:

Support the VirtueMart project and become a member

Main Menu

How to get some values regarding custom fields?

Started by Kuubs, January 30, 2016, 21:03:34 PM

Previous topic - Next topic

Kuubs

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!

GJC Web Design

$rowheights????

check the $this->product object

customs are in arrays like   $this->product->customfieldsSorted['normal']
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Kuubs

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.

GJC Web Design

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";
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Kuubs

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!