Skip to content

The correct way for adding products and product variations? #671

Answered by omadawnx
omadawnx asked this question in Q&A
Discussion options

You must be logged in to vote

ok.. after sleeping on it, finally got it to work.
You were right about the attributes, they are like an axis for hanging variations on.
So I needed to create a product attribute with a value (options) of "something" (some random value, in this case 00000000),
and when creating the variations, they need to be attached to that attribute with the specific option.

here's a working code I'm using to test this:

`

       // a category for the product (previously created)
        ProductCategoryLine productCategoryLine = new ProductCategoryLine()
        {
            id = 118,
            name = "test",
            slug = "test"
        };

        // prepare a sample product image
        Prod…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@omadawnx
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by omadawnx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants