Ignore extension if the channel is not online shop

I need to be able to ignore an extension, or at least a function in the extension, if the channel is not the online store. In other words, if someone is checking out with the Shop App, I just want to ignore some code. Is there a way to determine what the sales channel is in an extension?

Hey Chris,

From digging into this, it looks like checkout UI Extensions do not provide direct access to sales channel details, which means you cannot directly implement logic based on the order’s originating sales channel within a checkout extension.

A possible workaround could involve setting a cart attribute at the time of checkout initiation that indicates the sales channel. This attribute can then be used within your extension to conditionally execute code.

That’s the issue – initiating the checkout. Right now, we are getting inundated by bots. The bot does not go through the normal add-to-cart routine nor do they click the checkout button.

So, there is no way to tell a bot from a Shop App customer at this point.

It’s really too bad Shopify does not take this more seriously. It has been an issue since checkout extensions. Previously, to prevent non-javascript bots, a simple <noscript> redirect took care of this.

Why Shopify hasn’t done this is beyond me. Or simply using recaptcha on the checkout page. Both solutions are so simple and yet so beyond Shopify’s capabilities.

<noscript> <meta http-equiv="refresh" content="0;url='404error.html'"> </noscript>

Please make this an option or just default to it. Why would anyone visit the current checkout page without javascript installed except if it's a bot.