New Shopify Certification now available: Liquid Storefronts for Theme Developers

Identify channel in Script Editor

timd
Shopify Expert
120 6 72

I have a plus client with a checkout script discount which was limited to the Online Store channel only (App Only Discount).

But I’ve had to add a 2nd discount to this script and run into an issue where the 2nd discount needs to be accessible on both the Online Store & Storefront API channels (Free Tote over $180).

So I need a way to identify within the Script Editor which channel the customer is from and enable/disable discounts based on their channel. It doesn’t appear from Shopify’s Scripts API documentation whether it possible to identify the channel, anyone have any ideas?

sales channels.jpg

Replies 2 (2)
saudslm
Shopify Partner
5 0 0

Hi @timd 

Were you able to figure this out? I'm stuck in a similar scenario where I need to identity the sales channel.
Any input from anybody would be highly appreciated.

timd
Shopify Expert
120 6 72

No luck unfortunately. After a bit of back and forward with Shopify's support trying to see if this was possible they said that theres no way. I requested for this to be added but its not likely : (