We’re building a Shopify app and want to reliably override the native cart drawer across all theme types (official and third-party) to display our custom app-based cart drawer instead. While exploring this, we noticed that using selectors like a[href=‘/cart’] to identify cart triggers is unreliable, as not all themes follow the same structure or use this selector. So we’re also trying to figure out:
- What’s the most consistent or reliable way to detect cart/cart drawer triggers across themes?
- Is there a recommended method, API, extension, or function to hook into or replace the default cart drawer behaviour?