VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: tassoss on September 01, 2016, 10:08:16 AM

Title: How to display product stock level in wholesale shopper group
Post by: tassoss on September 01, 2016, 10:08:16 AM
Hi everyone,

in my eshop I have two shopper groups, one for retail and one for wholesales. How can I display the product stock level only to the wholesale group?

I am using joomla 3.6.2 and virtuemart 3.0.16.

Thank you in advance.

Tasos
Title: Re: How to display product stock level in wholesale shopper group
Post by: GJC Web Design on September 01, 2016, 10:58:56 AM
I guess detect the SG and display if correct in the template

something like

$userModel = VmModel::getModel('user');
   $vmuser = $userModel->getCurrentUser();
   $vmgroup = $vmuser->shopper_groups;

Title: Re: How to display product stock level in wholesale shopper group
Post by: tassoss on September 01, 2016, 11:20:31 AM
Thank you for your time and answer.

Unfortunately I am not a php guru and I dont understand GCJ how can this be implemented.

I will wait if anyone else has developed something like that and could help me.

I have searched a lot but I couldn't find an answer.

Title: Re: How to display product stock level in wholesale shopper group
Post by: GJC Web Design on September 01, 2016, 11:33:48 AM
those 3 lines in your details template will give the SG id as an array $vmgroup

you test this array for your chosen SG .. if present show the stock display
Title: Re: How to display product stock level in wholesale shopper group
Post by: tassoss on September 05, 2016, 09:49:04 AM
Hi GJC,

could you please tell me the directory of this file in order to try your code?

Thank you very much.
Title: Re: How to display product stock level in wholesale shopper group
Post by: GJC Web Design on September 05, 2016, 18:21:00 PM
Quoteyour details template