Have your say in Community Polls: What was/is your greatest motivation to start your own business?

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

Solved

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

lukafernada
Pathfinder
152 2 56

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:

Image 07-10-2024 at 16.38.jpeg

Website URL: cheffings.net

Knife products have tag: KNIFE-EMAIL

Accepted Solution (1)

Moeed
Shopify Partner
6330 1716 2069

This is an accepted solution.

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 </body> 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 %}
  <style>
   form#cart-notification-form button.button.button--primary.button--full-width {
    display: none !important;
}
  </style>
{% endif %}

RESULT:

Moeed_0-1728316500794.png

 

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

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


View solution in original post

Replies 4 (4)

Moeed
Shopify Partner
6330 1716 2069

This is an accepted solution.

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 </body> 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 %}
  <style>
   form#cart-notification-form button.button.button--primary.button--full-width {
    display: none !important;
}
  </style>
{% endif %}

RESULT:

Moeed_0-1728316500794.png

 

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

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


lukafernada
Pathfinder
152 2 56

Thank you so so much this was taking me ages!

Moeed
Shopify Partner
6330 1716 2069

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.

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


lukafernada
Pathfinder
152 2 56

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