How do I remove the checkout option on the cart drawer for specific products

Topic summary

Goal: Prevent customers from bypassing age verification by hiding the cart drawer’s Checkout button when a knife is in the cart.

Context: Knives on cheffings.net are tagged KNIFE-EMAIL. The cart drawer (mini-cart flyout) currently allows checkout without age verification.

Solution shared: Add a Liquid snippet in theme.liquid (before ) to scan cart items for the KNIFE-EMAIL tag and conditionally hide the Checkout option when detected. Steps provided: Online Store > Edit Code > theme.liquid > insert code that sets a flag if any cart item has the knife tag, then use that condition to remove/disable the Checkout button in the drawer.

Result: The store owner confirmed the approach worked and thanked the contributor. A screenshot was shared to illustrate the outcome, but it’s not essential to understand the solution.

Status: Issue appears resolved regarding hiding checkout for knife-tagged items. The store owner indicated a follow-up question was sent, so discussion may continue for additional help.

Summarized with AI on December 17. AI used: gpt-5.

Basically, if a customer orders a knife then they need to be age verified in the cart, however the ‘checkout’ option on the cart drawer allows them to bypass that. How do I get it so the checkout option is hidden if a knife is added to the cart.

The checkout button being this one:

Website URL: cheffings.net

Knife products have tag: KNIFE-EMAIL

Hey @lukafernada

Give this code a try.

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag

{% assign knife_in_cart = false %}

{% for item in cart.items %}
  {% if item.product.tags contains 'KNIFE-EMAIL' %}
    {% assign knife_in_cart = true %}
  {% endif %}
{% endfor %}

{% if knife_in_cart %}
  
{% endif %}

RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

1 Like

Thank you so so much this was taking me ages!

1 Like

Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.

1 Like

actually if thats ok, i have reached out to you for one more question for help