VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: rayge on July 03, 2013, 21:56:23 PM

Title: virtuemart_shoppergroup_id missing now?
Post by: rayge on July 03, 2013, 21:56:23 PM
It seems that this doesnt work now with 2.0.21g.

I cannot find the shopper group using $this->product->virtuemart_shoppergroup_id

Now. Does anyone know what has changed and how to get the ID?
Title: Re: virtuemart_shoppergroup_id missing now?
Post by: rayge on July 03, 2013, 22:55:21 PM
OK scouring the code i found this.

$usermodel = VmModel::getModel ('user');
$currentVMuser = $usermodel->getCurrentUser ();

and to get the groups attached to a user I can use this.
$currentVMuser->shopper_groups;

this wont change anytime soon yes?
Title: Re: virtuemart_shoppergroup_id missing now?
Post by: Milbo on July 04, 2013, 00:06:33 AM
I dont understand your problem, but

$product->shoppergroups


Use vmdebug('my product',$this->product); to see what your product has for data
Title: Re: virtuemart_shoppergroup_id missing now?
Post by: rayge on July 05, 2013, 18:50:37 PM
I am working inside default_showprices.php

$this->product->shoppergroups
is ahowing an empty array

vmdebug did nothing so maybe im doing it wrong?

I can copy and paste output from
echo "<pre>";
print_r($this->product);
echo "</pre>";

if you like.
Title: Re: virtuemart_shoppergroup_id missing now?
Post by: Milbo on July 07, 2013, 20:04:05 PM
vmdebug is doing a print_r for you.

If the array is emtpy, it means the product has no shoppergroups set.