I want to disable ability to go from cart to checkout & payment process for certain users having certain attribute, e.g. I want to display them message like You cannot buy any products until you verify your account, how can I achieve it? I want them to be able to add products to cart normally, but add something like grayed out checkout buttons & prevent them from buying anything until their flag is true.

I already tried overwriting block in checkout, and I can gray out and disable frontend possibility for certain customers but I'm looking for way to disable it properly, so they cannot bypass this and checkout via link or something.

1 Answer 1


You can keep your code for grayed out checkout buttons and I suggest you to override checkout index controller (Magento\Checkout\Controller\Index\Index) by adding your custom validation based on current logged in user. Following this way, no one can bypass your validation via link or something else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.