Skip to content

Commit e5373e5

Browse files
committed
Disable CartStockAvailability constraint in revise action
1 parent 00a6e1c commit e5373e5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CoreShop\Component\Core\Model\Order:
22
constraints:
33
- \CoreShop\Bundle\CoreBundle\Validator\Constraints\CartStockAvailability: { groups: ['coreshop'] }
4-
- \CoreShop\Bundle\CoreBundle\Validator\Constraints\CartMinimumQuantity: { messageBelowMinimum: 'coreshop.cart_item.quantity_below_min_limit', groups: ['coreshop'] }
5-
- \CoreShop\Bundle\CoreBundle\Validator\Constraints\CartMaximumQuantity: { messageAboveMaximum: 'coreshop.cart_item.quantity_above_max_limit', groups: ['coreshop'] }
4+
- \CoreShop\Bundle\CoreBundle\Validator\Constraints\CartMinimumQuantity: { messageBelowMinimum: 'coreshop.cart_item.quantity_below_min_limit', groups: ['coreshop', 'coreshop_revise'] }
5+
- \CoreShop\Bundle\CoreBundle\Validator\Constraints\CartMaximumQuantity: { messageAboveMaximum: 'coreshop.cart_item.quantity_above_max_limit', groups: ['coreshop', 'coreshop_revise'] }

src/CoreShop/Bundle/FrontendBundle/Controller/OrderController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public function reviseAction(Request $request): Response
5454
}
5555

5656
$form = $this->getFormFactory()->createNamed('coreshop', PaymentType::class, $order, [
57-
'payment_subject' => $order,
57+
'payment_subject' => $order,
58+
'validation_groups' => ['coreshop_revise']
5859
]);
5960

6061
if ($request->isMethod('post')) {

src/CoreShop/Bundle/OrderBundle/Resources/config/validation/Order.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CoreShop\Component\Order\Model\Order:
22
constraints:
3-
- \CoreShop\Bundle\OrderBundle\Validator\Constraints\CartPriceRule: { groups: ['coreshop'] }
3+
- \CoreShop\Bundle\OrderBundle\Validator\Constraints\CartPriceRule: { groups: ['coreshop', 'coreshop_revise'] }
44

55
getters:
66
items:

0 commit comments

Comments
 (0)