Override products without using the handle.

Solved
Oblify
Tourist
12 2 2

Hi everyone,

I'm wondering if there's any other way to override products using another value than the handle (e.g. SKU)?
The reason why I need this is rather complicated and I think there are not many ways around it.

0 Likes
Jayvin
Shopify Partner
217 34 57

Hi,

That's simple.

  1. Get all products from your store
  2. Filter the products by looking for the correct sku in all the products variants
  3. Once the you get product, you just use this endpoint to override the existing product with updated properties, variants or whatever you want to update
0 Likes
Anonymous
Not applicable
1811 0 0

Hello

 

Not possible unfortunately, only handles can replace products

0 Likes
Oblify
Tourist
12 2 2

Hi, thank you for your reply.

Are you sure there are no alternatives?
I mean, it's as simple as using another value other than the handle to recognize and override my products..

0 Likes
Jayvin
Shopify Partner
217 34 57

Hi Oblify,

Just use the product update endpoint:

PUT /admin/api/2021-04/products/XXXXXX.json
{
  "product": {
    "id": XXXXXX,
         ...... other properties you want to update goes in here...
  }
}

 

0 Likes
Oblify
Tourist
12 2 2

This is an accepted solution.

I've installed an app called StockSync to solve my problem, just in case anyone has the same problem as I did.
In case StockSync is not right for you, there is also Moose Sync which does the same thing but I haven't tried it.

0 Likes