Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Can Magento set Minimum Order Amount per Customer Group? 
 
SeaUrchin1
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2012-10-16
 

Jerry’s code worked for me, but only after deleting “top_” from (’top_methods’) in the second instance.  Prior to that, I couldn’t get the “proceed to checkout” button to show up after the minimum amount had been met.

<?php if (($group == 2 && $grand_total > $minimum_order) || $group != 2): ?>
<ul class="checkout-types">
<?php foreach ($this->getMethods('methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>


Thank you!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tizzalicious
Member
 
Avatar
Total Posts:  42
Joined:  2011-05-28
 

I would like to try Jerry’s code, but could someone explain how I could use it when I have multiple groups with different minimum amounts?

I have 2 groups with a minimum of €150
and 2 with a minimum of €80

Would I just add the code multiple times, of what? I don’t know enough bout coding to figure it out myself. I hope someone can help me out. I am currently using EM’s minimum amount, but it’s throwing errors on the success page, even for customers who are not logged in/in any customer groups, so I would like to find an alternative.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blueikon
Jr. Member
 
Total Posts:  2
Joined:  2011-12-16
 

we are trying to get this to work with our site
www.onduline-roofing-sheets.co.uk
but we need it to have say a minimum order of for example 20 ‘onduline sheets’ but not other items
any ideas how to implement this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
optical
Member
 
Total Posts:  35
Joined:  2009-08-06
 

This is not working for me. No warning text when I’m below the minimum and the checkout button is missing when I exceed the minimum amount.  I also tried remove “top_” on the 2nd instance.  Also, is there way to make this work with your own custom customer groups?  I do not want to use the default Wholesale group and create my own.

Please help…

I’m running 1.7.0.2.

Here’s my code:

?>
<?php
/**
* Shopping cart template
*
* @see Mage_Checkout_Block_Cart
*/

<?php
$logged_in = Mage::getSingleton( 'customer/session' )->isLoggedIn();

if ($logged_in) {
$group = Mage::getSingleton('customer/session')->getCustomerGroupId();

$grand_total = Mage::helper('checkout')->getQuote()->getGrandTotal();

$minimum_order = 300;
}
?>

?>
<div class="cart">
<div class="page-title title-buttons">
<h1><?php echo $this->__('Shopping Cart') ?></h1>
<?php if(!$this->hasError()): ?>
<?php if (($group == 2 && $grand_total > $minimum_order) || $group != 2): ?>
<ul class="checkout-types">
<?php foreach ($this->getMethods('top_methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>

<?php if ($group == 2 && $grand_total < $minimum_order): ?>
<span style="color: red">Note: The minimum order amount for Wholesale customers is $300. Please add more items to your cart.</span><br /><br />
<?php endif; ?>
<?php endif; ?>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php echo $this->getChildHtml('form_before') ?>
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>” method="post">
<fieldset>
<table id="shopping-cart-table" class="data-table cart-table">
<col width="1" />
<col />
<col width="1" />
<?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
<col width="1" />
<?php endif ?>
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<col width="1" />
<?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
<col width="1" />
<?php endif; ?>
<col width="1" />

<?php $mergedCells = ($this->helper('tax')->displayCartBothPrices() ? 2 : 1); ?>
<thead>
<tr>
<th rowspan="<?php echo $mergedCells; ?>"> </th>
<th rowspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Product Name') ?></span></th>
<th rowspan="<?php echo $mergedCells; ?>"></th>
<?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
<th rowspan="<?php echo $mergedCells; ?>” class="a-center"><span class="nobr"><?php echo $this->__('Move to Wishlist') ?></span></th>
<?php endif ?>
<th class="a-center" colspan="<?php echo $mergedCells; ?>"><span class="nobr"><?php echo $this->__('Unit Price') ?></span></th>
<th rowspan="<?php echo $mergedCells; ?>” class="a-center"><?php echo $this->__('Qty') ?></th>
<th class="a-center" colspan="<?php echo $mergedCells; ?>"><?php echo $this->__('Subtotal') ?></th>
<th rowspan="<?php echo $mergedCells; ?>” class="a-center"> </th>
</tr>
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
<tr>
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
</tr>
<?php endif; ?>
</thead>
<tfoot>
<tr>
<td colspan="50" class="a-right">
<?php if($this->getContinueShoppingUrl()): ?>
<button type="button" title="<?php echo $this->__('Continue Shopping') ?>” class="button btn-continue” onclick="setLocation(’<?php echo $this->getContinueShoppingUrl() ?>’)"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
<?php endif; ?>
<button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>” class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button>
<button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Shopping Cart'); ?>” class="button btn-empty” id="empty_cart_button"><span><span><?php echo $this->__('Clear Shopping Cart'); ?></span></span></button>
<!--[if lt IE 8]>
<input type="hidden" id="update_cart_action_container" />
<script type="text/javascript">
//<![CDATA[
Event.observe(window, ‘load’, function()
{
// Internet Explorer (lt 8) does not support value attribute in button elements
$emptyCartButton = $(’empty_cart_button’);
$cartActionContainer = $(’update_cart_action_container’);
if ($emptyCartButton && $cartActionContainer) {
Event.observe($emptyCartButton, ‘click’, function()
{
$emptyCartButton.setAttribute(’name’, ‘update_cart_action_temp’);
$cartActionContainer.setAttribute(’name’, ‘update_cart_action’);
$cartActionContainer.setValue(’empty_cart’);
});
}

});
//]]>
</script>
<![endif]-->
</td>
</tr>
</tfoot>
<tbody>
<?php foreach($this->getItems() as $_item): ?>
<?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>
</tbody>
</table>
<script type="text/javascript">decorateTable(’shopping-cart-table’)</script>
</fieldset>
</form>
<div class="cart-collaterals">
<div class="col2-set">
<div class="col-1">
<?php if($_crosssell = $this->getChildHtml('crosssell')): ?>
<?php echo $_crosssell; ?>
<?php else: ?>
<div class="no-crosssell">
<img src="<?php echo $this->getSkinUrl('images/media/callout1.jpg') ?>” alt="” />
<img src="<?php echo $this->getSkinUrl('images/media/fpo_no_crosssell.gif') ?>” alt="” />
</div>
<?php endif; ?>
</div>
<div class="col-2">
<?php /* Extensions placeholder */ ?>
<?php echo $this->getChildHtml('checkout.cart.extra') ?>
<?php echo $this->getChildHtml('coupon') ?>
<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>
<div class="totals">
<?php echo $this->getChildHtml('totals'); ?>
<?php if(!$this->hasError()): ?>
<?php if (($group == 2 && $grand_total > $minimum_order) || $group != 2): ?>
<ul class="checkout-types">
<?php foreach ($this->getMethods('methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>

 
Magento Community Magento Community
Magento Community
Magento Community
 
innoexts
Sr. Member
 
Avatar
Total Posts:  124
Joined:  2011-02-10
 

Hello,

Customer Groups Manager extension allows setting Minimum Order Amount per Customer Group:

http://innoexts.com/promotion/customer-group/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2