Sku_builder Question


#1

I created a base product with the following sku.

F30Sticker-{COLOR}-{YEAR}

{COLOR} and {YEAR} are there so that I can use the sku builder product modifier. I created all of the product variations, variation options and modifier with seek and set properties and then linked the variations to the base product. If I look at the list of poducts in my store I am still left with the original and it’s id.

Here are my questions.

  1. When linking variations to a base product that uses the sku builder, am I supposed to get more than one product?
  2. How do I add a modified product to the cart if I only have one base product id?

Take care,

Jon


#2

Hi Jon,

Have you built the child products? /v2/products/:uuid/build; this should return a list of all the child products built (or an error if any conflict or problem was detected).

When you get the base product by ID, the response should include a section within the meta section of the body. This in turn should include the properties variations and variation_matrix.

The variations property will give you all the information required to display the variations, the variation_matrix will provide a map of variation option IDs and the corresponding child product id.

Codepen example of using variations - this was done quiet a while back (there might be a difference in how these collections are indexed but hopefully you will get the idea) The ‘interesting’ part of the code is the getChildID method

Hope this helps.


#3

Thanks for the reply. I do not see the child product ids when I look up my product. The screen shot below may help.


#4

Can I just confirm…

After attaching the variations to the base product have you hit the build endpoint?

/v2/products/c9cc935a-e873-4937-a351-89ad2a49bb54/build

You must hit this endpoint to trigger the building of the child products…


#5

I’m having trouble with the build. It’s telling me the slug has previously been used which, does not make sense. Any ideas?


#6

Yes - unfortunately you have another product with a slug equal to the one trying to be built on one of the child products.

If you can give me your storeID or clientID (NOT client_secret!!!) I can have a look for you.


#7

Here is the clientID.

0VvSm47eg3QJ1nVnsWEVIGpHwurrZRoBUupWXlaZGH


#8

I’ve figured out what the issue was. I have to append the name and slug for each product. I did not see this in the example that was shown in the docs so I omitted it. Thanks for the help.