Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento import customer data with link up order data

Because of some issue I rollback database and found that 3 customers are deleted but that customer's order remain as it is.

Now What I need to do is import customer details which are deleted with associated order.

I try to import customer details using csv file and then replace "entity_id" with the old id. entity_id changed successfully but still I can't see order details on customer details.

Please help me how can I link existing order data with new customer.....

like image 783
Indian Avatar asked Nov 12 '22 18:11

Indian


1 Answers

parag, you can try to load the order and than set the customer id again something like this

$yourOrderId = 123;  
$yourCustomerId = 3454;

$_order = Mage::getModel('sales/order')->load($yourOrderId);
$_order->setCustomerId($yourCustomerId);
$_order->save();

Please take the db backup before making any change

like image 79
Ram Sharma Avatar answered Nov 14 '22 20:11

Ram Sharma