Esempio n. 1
0
 public function updateAttributeTest()
 {
     $productId = '3';
     $attrData = '["1","2","10","11"]';
     $imgData = '{"tempImgIds":[52],"defaultImgId":0}';
     try {
         $attr = json_decode($attrData);
         $img = json_decode($imgData);
         $attrValueDa = new AttributeValueDa();
         $attrResult = $attrValueDa->updateAttributeValues($productId, $attr);
         $imageDa = new ImageDa();
         $imageResult = $imageDa->updateProductImage($productId, $img);
         $result = $attrResult + $imageResult;
         echo $result;
     } catch (Exception $e) {
         echo 'Caught exception: ', $e->getMessage(), "\n";
     }
 }