0

I need to force one customer group to buy a minimum of 10 products per order (they get free shipping).

Looks to me like this is not possible with normal settings.

Where would I hook in to make this happen?

Would it be easier to use a minimum price instead of product count?

PiTheNumber
  • 3,234
  • 10
  • 47
  • 70

1 Answers1

1

You can override the method Mage_Sales_Model_Quote::validateMinimumAmount. This doesn't allow customers to checkout if the order is under a certain amount. You can add your own condition to disallow checkout for orders with less than X products.

Use this if you want the total qty of products to be at least 10.

$minQty = 10;
if ($this->getItemsQty() < $minQty){ //$this is instance of Mage_Sales_Model_Quote
    return false;
}

or this if you want at least 10 different products in the cart

$minQty = 10;
if ($this->getItemsCount() < $minQty){ //$this is instance of Mage_Sales_Model_Quote
    return false;
}
Marius
  • 197,939
  • 53
  • 422
  • 830
  • Looks like validateMinimumAmount() is checked while the product is added to the cart. I would need to check the cart contents on /checkout. – PiTheNumber Sep 23 '13 at 14:42
  • Well, that works if I rewrite OnepageController. See http://www.magentocommerce.com/wiki/5_-modules_and_development/0-_module_development_in_magento/how_to_overload_a_controller – PiTheNumber Sep 23 '13 at 15:26