App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
We are trying to build one solution in which we need to display a few details on Order's Thank You Page.
[Before Theme App Extensions]
We can do it with ScriptTag to load in order status page.
https://shopify.dev/api/admin-rest/2022-01/resources/scripttag#top
We can use display_scope as the order_status page.
[Using Theme App Extensions]
How we can add our app block or app embed blocks to display on Thank you page only?
I am unable to find any documents related to that.
Thank you 🙂
We had same problem and Shopify confirmed that app embedded blocks can not be added to checkout pages (I suppose Thank You page is considered a checkout page), so just use script tags exclusively for checkout pages and app embedded blocks for everything else. Script tags example:
/* globals Shopify */
(() => {
docReady(() => {
if (Shopify && Shopify.checkout && Shopify.Checkout.step === 'thank_you') {
// DO YOUR STUFF HERE FOR THANK YOU PAGE
}
});
function docReady(fn) {
// see if DOM is already available
if (document.readyState === 'complete' || document.readyState === 'interactive') {
// call on next available tick
setTimeout(fn, 1);
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
})();
@axess It seems your suggestion is to use an app embed block for all storefront pages except the Thank You page, and then rely on a ScriptTag for the Thank You page.
Shopify is telling me with my app that I have to use an app embed block and not use ScriptTag. Will Shopify even allow use of a ScriptTag?
@Chad_Johnson what was your final approach? using app embed block for other pages and scripttag for thank you page? did your app get accepted with this approach?
@randomdude1 @3Adigit Sorry for the delayed response. It seems Shopify's forum software failed to email me about your question.
I ended up using a script tag specifically for the Thank You page. When creating a script tag via API, you can set `display_scope` to `order_status`, and, if my memory serves my right, I believe it will execute on the Order Status and Thank You pages.
I never submitted my app for review. Based on my vague recollection of my research notes, I think this won't be a problem when submitting your app. If it is, then I would fight back and tell Shopify they need to provide a way to implement app block functionality on the Thank You page.