VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ereallstaff on July 03, 2013, 12:09:39 PM

Title: Accessing product values from a product page
Post by: ereallstaff on July 03, 2013, 12:09:39 PM
Hello!

I am on a virtuemart page product details.

Is it possible to access products parameters, without executing queries again?

I need f.e. product_weight , that should be inserted already inside globals variable ( but using $_GLOBAL['product']  doesn't give me back anything) .

Inside the view is it possible to make a $view->get ('product)  , but will be possible to have the current instance from external and get those?

Thanks

Title: Re: Accessing product values from a product page
Post by: Milbo on July 03, 2013, 20:29:17 PM
of course. all is there, learn to use vmdebug. enable virtuemart debug and use vmdebug('mydata',$this) in your layout to see which data is accessible.
Title: Re: Accessing product values from a product page
Post by: jenkinhill on July 04, 2013, 00:20:32 AM
And also see http://forum.virtuemart.net/index.php?topic=92756.0
Title: Re: Accessing product values from a product page
Post by: ereallstaff on July 04, 2013, 09:48:26 AM
Hello guys and thanks for replies

I try vmdebug soon
Title: Re: Accessing product values from a product page
Post by: ereallstaff on July 04, 2013, 11:22:10 AM
I suppose that if the print is:

vmdebug mydata

means that $this is null?

Thanks
Title: Re: Accessing product values from a product page
Post by: Milbo on July 05, 2013, 13:50:13 PM
?, no

first parameter description, next parameters are the values to print. $this should be never null. $this in a layout should show you the whole accessible data.