When an app deep links a merchant into the theme editor to place or preview a block that lives in the cart drawer or on the cart page, the preview always renders with an empty cart.
There is no way to seed the preview with a cart line item, so the merchant lands on a page that renders the app block as blank and has no way to tell whether it configured correctly.
Can’t you just tell the user to add an item to the cart?
In theory the merchant could just add an item to the cart to preview the block inside the cart page or cart drawer, but in practice we found this is not reliable.
Add to cart requests are prone to 429 errors inside the theme editor, and on top of that many themes simply do not work when you try to add an item to the cart from within the theme editor context at all.
The rate limiting side of this is covered in the ongoing thread on bot detection and 429s, where Shopify’s own status update notes that for false positives “there is not yet a complete solution”.
How this was already solved in checkout editor
The checkout editor solves the same problem by populating the preview with a default product, so a merchant can see and configure checkout blocks without manually building a cart first:
Because previewing cart blocks in the theme editor is this unreliable, apps are pulling configuration that belongs in theme app extension settings into their own embedded app iframe instead, where they can control the preview. That splits the merchant experience across two surfaces and works against the whole point of theme app extensions.
A proposed solution
What I would like: an optional deep link parameter, something like cartPreview, that renders the theme editor preview with one or more placeholder line items, example:
shopify://admin/themes/current/editor?context=apps&template=${template}&activateAppId={api_key}/{handle}&CART_POPULATE=true
This removes a whole class of support tickets, brings cart blocks in line with the preview experience that already works for product and collection templates, and sidesteps the bot detection problem entirely for this case since no storefront cart request would be needed.
Happy to share a concrete example of the flow if that helps.
