Just another WordPress.com weblog

Hello Everyone,

You can delete order of particular customer using below code .. You need to run below code in adminpanel.

<?php $order = Mage::getModel(‘sales/order’)->getCollection()
->addAttributeToFilter(‘customer_id’,’14’);//”14″ is a id of customer
print_r($order->count()); // It display no. of order place by customer whose id is ’14’
foreach ($order as $ord) {
echo $ord->getIncrementId() . ‘<br>’; //It display increment id of order
$ord->delete(); //This statement delete order
} ?>

I hope the above code is help you to delete sales order in magento

Thanks,
Bijal Bhavsar 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: