0

this is my code

$URL='';(url of third party api)        
$simple  = simplexml_load_file($URL);

 foreach($simple->FEEDBACK as $result){

  $service_score=$result->SERVICESTARRATING;
  $service_feedback=$result->CUSTOMERCOMMENT;
  $vendor_reply=$result->VENDORCOMMENT;

  $orderId =Mage::getModel('sales/order')->
           loadByIncrementId($order_ref)->getEntityId(); 

  $order = Mage::getModel('sales/order')->load($orderId);

 $order->setData('score',$service_score);
 $order->setData('service_feedback',$service_feedback);
 $order->setData('response',$vendor_reply);

upto this code is working properly,when i try to use..

$order->save();  

its give error as written in title,please help..

0

First: you don't have to load Order again after you loaded with increment_id. You can load $order:

$order = Mage::getModel('sales/order')->loadByIncrementId($order_ref);
$order->setData('score',$service_score);
$order->setData('service_feedback',$service_feedback);
$order->setData('response',$vendor_reply);

Check if fields score, service_feedback and response exists in database table: sales_flat_order. I think these fields do not exists in table or the data you assign different than expected so you cannot save the order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.