In Medusa admin, when i import a list of products through csv, it does not have a column for collection and sales channel. so after uploading products, i have to update the database by running a query in database for attaching a sales channel to a product OR update/edit each product in medusa admin. else product will not be visible in product list in store front, since not attached to a sales channel.
And similarly run a query / or update each product in admin to include collection . for large number of products, running a query seems to be only solution. Is there any alternate solution to this.
#importing products in medusa admin
7 messages · Page 1 of 1 (latest)
Unfortunately, no. You may also want to add collection & sales channel through the API instead of directly through the database.
I suppose, that I cannot include any extra columns in the csv for import, since it would not recognize it. So the only solution in case of bulk imports could be to build a custom API route for imports in admin, which has customization to include sales channel and collection
@weak bridge You could do that, or instead of building custom API routes, you could instead make sequential calls to the existing sales channel and collection routes.
could you please elaborate on what do you mean by making sequential calls to sales channel and collection routes, i did not get it
@weak bridge Look into using the Admin API. For example, if you already have a collection, you can add your new product to the collection when you upload through the API, like this:
const response = await medusa.admin.products.create({ // ... other fields here collection_id: "myCollectionID" })
@weak bridge Just some warning though... I've been trying to get set up with Medusa for almost 6 months, it requires a ton of work and a lot of the documentation isn't up to date. Possibly the team is more focused on their enterprise products, understandably. But I've been recommending to people that unless they absolutely have to use Medusa, first try another solution like Shopify.