News:

Support the VirtueMart project and become a member

Main Menu

product variant restriction to shopper group

Started by p.barg, December 11, 2015, 16:08:47 PM

Previous topic - Next topic

p.barg

Hello,
the restriction of products to specific shopper groups only seems to work for (main) products, but not for variants.
I was going to add a variant of a product that should only be visible for a specified shoppergroup, but the variant is shown in the dropdown for all customers.
Is there a way (other than create a new product for this shoppergroup) to achieve this?

Thanks

Petra

J.3.4.5 /  VM 3.0.12

Milbo

You mean a MV or GV? It should work with children.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

Hi Milbo,
we're using standard variants, but I've also tried with Multivariants. Doesn't work either for me...
Works perfectly with main products. Maybe I'm missing some setting?

Petra

Milbo

What are standard variants? I have to update the german wording. it is horrible, yeh.

Standard variants are for me done without children.
Then there are the generic child variants
and the Multivariants.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

Hi Max,
I'm talking about Generic Child Variants and Multivariants.

-- Petra

Milbo

the child has the same groups as the parent as long not overriden. Be aware that shoppergroups can remove the standard group or keep it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

That's exactly what I'm trying to do: override the shopper group of the parent product:
In my tests the child has a different shopper group than the parent (which is not restricted to a specific shopper group), but it shown nevertheless to all shopper groups.
So, obviously it doesn't work as expected.

p.barg

So can you confirm that this is a bug and if so is there a workaround/fix?

Milbo

No, I cannot confirm.
Did you check this? "Be aware that shoppergroups can remove the standard group or keep it.
Modify message"
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

I have 4 shopper groups - none of them is defined as "additional shopper group" (if that's what you mean by 'can remove the standard group or keep it').
One product variant is restricted to exactly one of these shopper groups (in our case 'wholesale') and yet all other shopper groups (e.g. guests) also see this variant.
If needed I can provide some screenshots.

Milbo

Thank you. I was not lazy and can confirm it.

Please check line 254 in sublayouts/customfield.php. Just remove the second parameter of
$productChild = $productModel->getProduct((int)$child,false);

or set the second parameter to true.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

Thanks for looking into this Max! Your fix solves the problem in that the variant itself is no longer listed in the drop-down for the other shopper groups now.
But for some reason a price with (0,00 €) is displayed in its place. I'm sure this can be removed easily (probably in the same file), but I couldn't find it....

Milbo

and the price setting? which price should be shown?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

As the variant shouldn't be shown (and isn't after applying your fix), the price shouldn't be shown either.
It appears to be a leftover from the variant that is not shown any longer. See attached image - the 0,00€
in the first line.