Sales Channels & Apps Restrictions? #32096
Replies: 32 comments 4 replies
-
Thanks for the issue. I'm not familiar with the concept of sales channels. Looking at the Admin API docs, it's possible to filter orders by sales channel, but I don't see any indication that other object types can be filtered this way. Do you happen to know where I can learn more about how sales channels work? |
Beta Was this translation helpful? Give feedback.
-
@sslotsky Sales Channels are how Shopify controls what products show up on the Online Store, Shopify POS, Social Media (ads), and any Private App integrations (like this plugin). You can set availability on any product/collection, screenshots attached, and more insight here If I'm not mistaken, I believe that @bahamagician is pulling products that are not available on his Private App integration |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info @iamkratos that was really helpful. It looks like the Admin API makes this available through publication data, but that data is only available for limited access scopes:
We'll have to think on how to do this correctly. It will almost certainly involve opting in via |
Beta Was this translation helpful? Give feedback.
-
Hey, @iamkratos is correct. Products not marked for inclusion in a particular sales channel are being included in the results pulled. |
Beta Was this translation helpful? Give feedback.
-
This is causing problems adding items to cart because they should not be visible on the store |
Beta Was this translation helpful? Give feedback.
-
While we're still working this out, can folks here who are experiencing the issue let me know if my previous comment looks like it would be helpful for you? https://github.com/gatsbyjs/gatsby-source-shopify/issues/118#issuecomment-814900262 |
Beta Was this translation helpful? Give feedback.
-
publishedOnCurrentPublication (Boolean!) Sounds like what I'm expecting. I am surprised this is not the default and the API has access outside the channel |
Beta Was this translation helpful? Give feedback.
-
It's the admin API that we're using and I think the intention is that you can have an accurate reflection of what's really in the database. It makes sense why they would exclude these products from the Storefront API. |
Beta Was this translation helpful? Give feedback.
-
@lamellama follow up questions
|
Beta Was this translation helpful? Give feedback.
-
Here's what I'm thinking. We can add a new pluginOption called e.g. Then if publication data is also desired, |
Beta Was this translation helpful? Give feedback.
-
Actually I'm partly wrong about this! So this really only leaves the question of whether or not you also need publication data to be sourced as well. If that's not useful to anyone, we can skip it and ship the new field that will hopefully help you solve your problem. |
Beta Was this translation helpful? Give feedback.
-
I have currently modified the plugin to add publishedOnCurrentPublication to product and collection queries and then filtered my createPages accordingly which achieves what I need. This is the only functionality I need but I am wondering if there is a more efficient way to avoid querying the extra data althogether. |
Beta Was this translation helpful? Give feedback.
-
Taking yet another look at the docs and I see one thing that could work. There is a filter key called |
Beta Was this translation helpful? Give feedback.
-
I've inquired about this with Shopify so hopefully we'll have an answer soon. |
Beta Was this translation helpful? Give feedback.
-
@sslotsky Did some digging this weekend, and found this Could this provide the logic we need to resolve this issue? |
Beta Was this translation helpful? Give feedback.
-
When you create a private app to connect to Shopify such as 'Gatsby' that is then listed as an available sales channel. So it would make sense for the default to be online store with the option to have the 'Gatsby' Channel as the main preference. One problem with the shopify system is that when a new sales channel is created, all products are not enabled on that channel by default. So for a novice user, it would be best to have the default set to the online store but the ability to override with inputting your preferred sales channel in the config. |
Beta Was this translation helpful? Give feedback.
-
@sslotsky No, we don't want the Online Store channel (the channel is typically used for product availability in a standard Shopify theme). When I create a new Private App in Shopify, it adds a new channel to all the product pages that shares the same name as the app. In the screenshots attached, I would want the channel to be the V8 (WMG) |
Beta Was this translation helpful? Give feedback.
-
Thanks y'all this is super duper helpful |
Beta Was this translation helpful? Give feedback.
-
Ok, I believe this is the solution being requested: const publishedStatus = this.pluginOptions.salesChannel
? encodeURIComponent(`${this.pluginOptions.salesChannel}=visible`)
: `published`;
const filters = [`status:active`, `published_status:${publishedStatus}`]; If you supply |
Beta Was this translation helpful? Give feedback.
-
@sslotsky looks slick 😎 |
Beta Was this translation helpful? Give feedback.
-
One more question. Given the solution we've agreed on here, is it useful in any way to also include the following fields:
We can add them if they are useful, but there's some cost because they all require certain permissions. |
Beta Was this translation helpful? Give feedback.
-
@sslotsky I don't think we need them. I never used these on the previous gatsby-source-shopify, and I'm not sure how I could make use of them in my builds. |
Beta Was this translation helpful? Give feedback.
-
Published in the newest |
Beta Was this translation helpful? Give feedback.
-
@sslotsky unfortunately, I think we have to re-open this. Although Shopify displays the Private App integration as a Sales Channel, it doesn't consider it one in the API. I've tried configuring my store use the new method but it wouldn't work. |
Beta Was this translation helpful? Give feedback.
-
I tried the other day too stating a salesChannel and it didn’t filter them out.
Regards
Paul Kidd
Thunderfix
…________________________________
From: iamkratos ***@***.***>
Sent: Tuesday, May 11, 2021 4:00:53 PM
To: gatsbyjs/gatsby-source-shopify ***@***.***>
Cc: Thunderfix ***@***.***>; Comment ***@***.***>
Subject: Re: [gatsbyjs/gatsby-source-shopify] Sales Channels & Apps Restrictions? (#118)
@sslotsky<https://github.com/sslotsky> unfortunately, I think we have to re-open this. Although Shopify displays the Private App integration as a Sales Channel, it doesn't consider it one in the API. I've tried configuring my store use the new method but it wouldn't work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://github.com/gatsbyjs/gatsby-source-shopify/issues/118#issuecomment-838631577>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AC7LM6ROQNOQGBYVXFAWTSTTNFBCLANCNFSM42PFZ2OQ>.
|
Beta Was this translation helpful? Give feedback.
-
@iamkratos did you try that with their API directly? If it's true that their API does not consider the private app to be a sales channel, then I'm not sure how y'all want this to behave. |
Beta Was this translation helpful? Give feedback.
-
maybe this is the reason taken from |
Beta Was this translation helpful? Give feedback.
-
seems sales channel scope is only for public apps: https://community.shopify.com/c/Shopify-APIs-SDKs/Private-App-as-a-sales-channel/td-p/418433 |
Beta Was this translation helpful? Give feedback.
-
Would be cool to get this working. I currently use a dirty graphql filter as workaround:
|
Beta Was this translation helpful? Give feedback.
-
Here's a couple updates on sales channel support with
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Previously, only products marked for inclusion in a particular Sales Channel or App was included in the products returned from the shopify api. However, now I'm getting all of the products in the store regardless of whether they're meant to be included in the App that I've used to set up the API key. Is there a way to exclude those products from the results returned?
Beta Was this translation helpful? Give feedback.
All reactions