Author Topic: Minimum Purchase Quantity by Shopper group  (Read 2188 times)

rayge

  • Jr. Member
  • **
  • Posts: 189
Minimum Purchase Quantity by Shopper group
« on: June 24, 2015, 13:19:12 pm »
I need to set things like Minimum, maximum Purchase Quantity and Purchase Quantity Steps for certain products BUT they need to be restricted to specific shopper groups.

Is there a way to handle this?
I Use: Joomla 3.4.1 & VM 3.0.9

rayge

  • Jr. Member
  • **
  • Posts: 189
Re: Minimum Purchase Quantity by Shopper group
« Reply #1 on: June 24, 2015, 18:10:45 pm »
OK here is what i came up with. in productdetails/default_addtocart.php I Added the following code:
Code: [Select]
//Product array for items that should use Min/step order globally
$exception_sku_array = array(
'QB12',
);
//$user = JFactory::getUser();
//SET MIN ONLY for WHOLSALE except for specific product skus
$usermodel = VmModel::getModel ('user');
$currentVMuser = $usermodel->getCurrentUser();
$currentVMuser->shopper_groups[] = '0'; //This allows pricing for ALL Shopper groups to appear
$virtuemart_shoppergroup_ids = $currentVMuser->shopper_groups;
$virtuemart_shoppergroup_id_str = implode(',',$virtuemart_shoppergroup_ids);
if(
$virtuemart_shoppergroup_ids[0]!='4' //Replace this with your expected shopper ID
&&
!in_array($this->product->product_sku, $exception_sku_array)
) {
$this->product->min_order_level = '1';
$this->product->step_order_level = '1';
}

i added it before this line:
Code: [Select]
if ((!empty($this->product->customsChilds)) || (!empty($this->product->customfieldsCart))) { ?>
and it seems to be working how i want.
I Use: Joomla 3.4.1 & VM 3.0.9

rayge

  • Jr. Member
  • **
  • Posts: 189
Re: Minimum Purchase Quantity by Shopper group
« Reply #2 on: October 14, 2015, 17:38:36 pm »
THis isnt working how i had hoped although the FIELD is changed by shopper group, since the ADMIN data shows a minimum quantity it seems to override anything in the front end. there needs to be a session variable or something i can override to handle changing the admin set minimum to 1 instead for retail customers.

has anyone else had to deal with this and what was the solution?

UPDATE: The workaround solution i have come up with is to have 2 products for each product needing to have a specific minimum quantity for each group.. 1 for retail customers and 1 for wholesale.
This SUCKS but it seems to be the best way without having a LOT of code.
I Use: Joomla 3.4.1 & VM 3.0.9

Khaostar

  • Jr. Member
  • **
  • Posts: 58
Re: Minimum Purchase Quantity by Shopper group
« Reply #3 on: April 11, 2016, 13:52:03 pm »
Hi!

Sorry for bumping the post, but I have the exact same need.

I want to have a minimum quantity for some products depending on the shopper group. Actually, I have to create multiple products to do that. That's a pain. And I don't want to do custom hacks.

Does anyone have a solutuon for this? A plugin maybe?

Thanks!

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28154
  • Always on vacation
    • Jenkin Hill Internet
Re: Minimum Purchase Quantity by Shopper group
« Reply #4 on: April 11, 2016, 13:59:58 pm »
I have done this using shopper group specific products, but as you say, it does mean cloning & editing each product. I know of no plugin to do this.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

ARTIFIEDWEB

  • Beginner
  • *
  • Posts: 9
  • Premium Web Services
    • ARTIFIEDWEB
  • VirtueMart Version: 3.0.18
Re: Minimum Purchase Quantity by Shopper group
« Reply #5 on: June 18, 2021, 09:34:11 am »
I know that this is an old thread but we have created a plugin that does exactly this.
You can set rules for min purchase quantity, max purchase quantity, purchase step.
You can select which products, manufacturers or categories these rules will apply to.
And you can set these rules for one or more shopper groups.

If anyone is interested, contact me at george[at]artupweb[dot]com
Websites that STAND OUT!
Contact me if you want an amazing upgrade

Leone

  • Beginner
  • *
  • Posts: 1
  • A beginner
Re: Minimum Purchase Quantity by Shopper group
« Reply #6 on: July 24, 2021, 13:51:19 pm »
An example illustrates the combined use of the minimum purchase and staggered values: The minimum order quantity for the item "Wine Ch√Ęteauneuf-du-Pape red" is 6 bottles for end customers and the article can be purchased in a staggered 6 bottles. The B2C customer can therefore choose between 6, 12, 18, 24, etc. bottles in your shop. However, B2B customers (e.g. restaurants) can only order the identical item from a minimum purchase of 30 bottles, the staggering for them is 12 bottles. So you can order 36, 42, 54, 66 etc. bottles in your shop.