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 января 2019, 16:19
modx.pro
735
0

Комментарии: 3

Василий Наумкин
21 января 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
Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
3