Tags/topics: 
2
Answers
Vote up!
0
Vote down!

Add variation to a product thru code

Hi guys,

I'm doing a module here where the module read a xml url n turn those url into product array. The product is a book information.

I'm having problem creating a variation of product using code. All the book from that xml should have both Digital and Print edition product.

I managed to make the book into a product, but the next step to create a variation for it did not work. It either overwrite the previous edition and left with the latest or it create 2 separate product.

Is there somewhere here I can refer to?

TQ

Asked by: Fazrulhafiz
on March 24, 2014

2 Answers

Vote up!
0
Vote down!

So I understand, are you creating a new instance of a product variation, or a new definition?

delta195
Answer by: delta195
Posted: Mar 25, 2014
Vote up!
0
Vote down!

A new instance of a product Variation should be close enough.
I had created a while statement that create the first Print sku, then i want it to loop again to create Digital sku.

The problem where I've stuck seems to be when referring to the node_load where it either replace the Print sku with Digital sku or it created both as a diff products.

Answer by: Fazrulhafiz
Posted: Mar 25, 2014