Skip to content

Commit e0c96cc

Browse files
authored
Merge pull request #803 from AltayAkkus/patch-1
Add blockResubmit to documentation
2 parents f4f159e + 05fdb27 commit e0c96cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

guides/plugins/plugins/checkout/cart/add-cart-validator.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ It has to extend from the abstract class `Shopware\Core\Checkout\Cart\Error\Erro
107107
* `getLevel`: The kind of error, available are `notice`, `warning` and `error`. Depending on that decision, the error will be printed in a blue,
108108

109109
yellow or red box respectively. This example will use the error here.
110-
111110
* `blockOrder`: Return a boolean on whether this exception should block the possibility to actually finish the checkout.
112111

113112
In this case it will be `true`, hence the error level defined earlier. It wouldn't make sense to block the checkout, but only display a notice.
114113

114+
* `blockResubmit`: Optional, return a boolean on whether this exception block the user from trying to finish the checkout again.
115+
116+
If you want to use it, add the method `blockResubmit(): bool` to your custom error. If you don't, it is `true` by default.
115117
* `getParameters`: You can add custom payload here. Technically any plugin or code could read the errors of the cart and act accordingly.
116118

117119
If you need extra payload to your error class, this is the place to go.

0 commit comments

Comments
 (0)