Get multisite product collection import working#294
Merged
ryanmitchell merged 4 commits intostatamic-rad-pack:mainfrom Jul 13, 2025
Merged
Get multisite product collection import working#294ryanmitchell merged 4 commits intostatamic-rad-pack:mainfrom
ryanmitchell merged 4 commits intostatamic-rad-pack:mainfrom
Conversation
Contributor
Author
|
Tests seem to be failing because the mock API response data is out of date. |
Contributor
|
It would have been the response for the version of the api it was targeting - 2024-07 I think. If they have changed it the addon will need to support both, as you suggested. |
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
Author
|
Just found a PR from a year ago making the exact change from |
Contributor
|
Yeah looks like I missed it. Thanks for this and the other PRs - appreciate the work you've done on them! |
Contributor
Author
|
Thanks for the quick merge and short feedback loop! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing product collections into a multisite setup is currently failing for a number of reasons.
This is an attempt to solve this by:
Use the short collection id instead of the full id
Previously, the collection queried was duplicated, so
gid://shopify/Collection/123445gid://shopify/Collection/12345. This should just begid://shopify/Collection/12345Use the lang of the site as query param
Previously, the whole locale was used (
en_US), which Shopify doesn't return translations for. Shortenseems to work.Here's an example query from the docs on the
translatableResourceendpoint:Adjust data path
The correct path through the response seems to be
data.translatableResource.translations, nottranslatableResource.translatableContent. This one might also be due to API schema changes on the Storefront end of things. Happy to add a conditional to keep backwards compatibility.Here's an example response from the docs on the
translatableResourceendpoint:{ "translatableResource": { "resourceId": "gid://shopify/Collection/1007901140", "translations": [ { "key": "title", "value": "la collection" } ] } }Assume a LocalizedTerm
For some reason, the term would always already be a LocalizedTerm instance, which doesn't have a
dataForLocalemethod. Switching to$term->in($local)seems to work better.