Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

Set Answer Products in Custom Process (2 Comments)

$
0
0

Topic by ilamukky

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


Viewing all articles
Browse latest Browse all 2504

Trending Articles