Set Answer Products in Custom Process
Content
Hello
I have an array of product IDs ($productList), and I would like to set them as Answer Products, overwriting the existing ones. I'm trying in this way:
$answer->Products = new RNCPHP\ServiceProductArray();
for($i = 0; $i < sizeof($productList); $i++)
{
$answer->Products[$i] = new RNCPHP\ServiceProduct();
$answer->Products[$i]->ServiceProduct = RNCPHP\ServiceProduct ::fetch($productList[$i]);
$answer->Products[$i]->ServiceProduct->save();
}
$answer->save();
I haven't errors, but Answer Products array is empty at the end of test harness .
Am I missing something?
Thanks very much
0