Code Duplication    Length = 4-4 lines in 3 locations

system/modules/Ecommerce/appControllers/CartController.php 2 locations

@@ 74-77 (lines=4) @@
71
                } elseif ($deliverys && !empty($deliverys[$_POST['delivery']])) {
72
                    $cart->delivery_id = $_POST['delivery'];
73
                    foreach ($deliverys[$cart->delivery_id]->fields as $field) {
74
                        if (empty($_POST['deliveryFields'][$field->id]) && $field->required) {
75
                            $error = 1;
76
                            Msg::add('Вы не указали: ' . $field->name, 'danger');
77
                        }
78
                    }
79
                }
80
                if ($payTypes && (empty($_POST['payType']) || empty($payTypes[$_POST['payType']]))) {
@@ 90-93 (lines=4) @@
87
                    $payType = null;
88
                }
89
                foreach (\Ecommerce\UserAdds\Field::getList() as $field) {
90
                    if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
91
                        $error = 1;
92
                        Msg::add('Вы не указали: ' . $field->name, 'danger');
93
                    }
94
                }
95
                if (!empty($_POST['discounts']['card_item_id'])) {
96
                    $userCard = \Ecommerce\Card\Item::get((int)$_POST['discounts']['card_item_id']);

system/modules/Ecommerce/appControllers/EcommerceController.php 1 location

@@ 73-76 (lines=4) @@
70
71
            $fields = \Ecommerce\UserAdds\Field::getList();
72
            foreach ($fields as $field) {
73
                if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
74
                    $error = 1;
75
                    Msg::add('Вы не указали: ' . $field->name);
76
                }
77
            }
78
            if (!$error) {
79
                $cardItem = new \Ecommerce\Card\Item();