minishop2 - Minimum order amount: possible?

Is there a way to set a minimum order amount in minishop2?
I want that customers must reach a minimum amount before they can send a order.

Thank you for your help.
Fabian
Fabian Christen
21 january 2019, 16:19
99
0

Comments: 3

Василий Наумкин
21 january 2019, 16:29
0
Yes, you can use system event msOnSubmitOrder and return an error if something not good.

switch ($modx->event->name) {
    case 'msOnSubmitOrder':
        $cart = $order->ms2->cart->status();
        if ($cart['total_cost'] < 1000) { // Your amount
            return $modx->event->output([
                'success' => false,
                'message' => 'You need to add more products',
            ]);
        }
    }
}
Russian docs
Log in or sign in to make new comments.