Liquid: check if using cart drawer or page (or popup!)

Hi! We use Dawn (7.0.1). For a bit of custom code I’m writing, I need to detect the ID of the currently active, or detect whether the cart in question is the drawer or the page (or the popup!)

Essentially, I need a way to get the current form ID - but I can get this either directly (via some kind of {% current form %}?) or indirectly by knowing which kind of cart is currently in use.

Thanks

Hello @nagumi

Here is the Liquid code to get cart type in dawn theme. settings.cart_type

HTML/Liquid code to check if it’s drawer

{%- if settings.cart_type == "drawer" -%}
   // drawer code
{% endif %}

If you find our reply helpful, please hit Like and Mark it as a Solution.

An award-winning North American Shopify Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

Hi there, where can I read more about the “settings” object? I’m struggling to find out information about this object and what data is there.

Thanks