Control Abandoned checkout, Disable fields

Hello Community Members,

I hope you’re all doing well.

Could anyone guide me on how to disable specific checkout fields based on certain conditions? For example, I have a product with the tag “not-allowed”, and during checkout, I want to check if this product is in the cart. If it is, the email field should be disabled because such items are not available for purchase.

I have already installed the Shopify Function Cart Transform, which currently blocks the checkout and displays an error banner if the product is in the cart. However, some users still fill in their details, leading to abandoned checkouts.

What I want is to ensure that if such a product is in the cart, users cannot fill out any checkout details at all.

Thank you in advance for your guidance!

Hi Ahsan,

Would the the Cart and Checkout Validation Function API work for this?

Hi Liam,

Yes, I’ve used the Cart and Checkout Validation Function, which blocks the checkout and prevents customers from making a purchase. However, my requirement is to disable the email field specifically, so customers cannot enter their email address.

Currently, the checkout is blocked, but if the customer enters their email, an Abandoned Checkout is created, which I want to avoid.

If you have a better solution for this, please guide me. Thanks! :blush:

If the goal is to never allow a buyer get to the checkout with a product that has a tag of not_allowed - one alternative option would be to add logic to the product page that would disable/ hide the add to cart button when a product contains that tag. That way no-one would even be able to add the product to the cart in the first place?