Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 85-90 (lines=6) @@
82
                    $payType = null;
83
                }
84
                $fields = \Ecommerce\UserAdds\Field::getList();
85
                foreach ($fields as $field) {
86
                    if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
87
                        $error = 1;
88
                        Msg::add('Вы не указали: ' . $field->name);
89
                    }
90
                }
91
                if (!empty($_POST['discounts']['card_item_id'])) {
92
                    $userCard = \Ecommerce\Card\Item::get((int) $_POST['discounts']['card_item_id']);
93
                    if (!$userCard) {

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

@@ 43-48 (lines=6) @@
40
            }
41
42
            $fields = \Ecommerce\UserAdds\Field::getList();
43
            foreach ($fields as $field) {
44
                if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
45
                    $error = 1;
46
                    Msg::add('Вы не указали: ' . $field->name);
47
                }
48
            }
49
            if (!$error) {
50
                $cardItem = new \Ecommerce\Card\Item();
51
                $cardItem->card_id = $card->id;