Minimum order limit for the specific group

Hi there,

I would like to set minimum order limit for the specific group.

eg Wholesale group has 500 limit and only for this or higher value fn_allow_place_order will be true.

What should be the correct code for this condition?

Thank you in advance for your help and sorry if anything is not clear I’m new here



/core/fn.cart.php


//
// Checks if order can be placed
//
function fn_allow_place_order(&$cart)
{
$total = $cart['total'];

fn_set_hook('allow_place_order', $total, $cart);

$cart['amount_failed'] = (Registry::get('settings.General.min_order_amount') > $total && floatval($total));

if (!empty($cart['amount_failed']) || !empty($cart['shipping_failed'])) {
return false;
}

return true;
}




Create a hook for ‘allow_place_order’. Test whether the user is a member of the group you want to verify. If so, then check that the $cart[‘amount’] is >= the min amount you want. If not, set $cart[‘failed_shipping’] = true and return.

[quote name=‘tbirnseth’]Create a hook for ‘allow_place_order’. Test whether the user is a member of the group you want to verify. If so, then check that the $cart[‘amount’] is >= the min amount you want. If not, set $cart[‘failed_shipping’] = true and return.[/QUOTE]

Thank you very much tbirnseth!!

I spent several days reading about the structure of this script and with your help,I created my first addon :slight_smile:

Regards

Glad you were able to get it. You should have been able to use the existing addon called my_changes. It is intended to be a local hook for customization of your store.

Could you share the addon?

I need this as well.



Thanks

Kamil,

Does this minimum apply to a single product or is it applied over multiple products?