Question

how can i get customer order numbers in one drop-down ? in magento

enter image description here

Was it helpful?

Solution

<?php $orders = Mage::getResourceModel('sales/order_collection')
                ->addFieldToSelect('*')
                ->addFieldToFilter('customer_id',Mage::getSingleton('customer/session')->getCustomer()->getId())
                ->setOrder('created_at', 'desc');
?>
<select >
 <option value="">None</option>
  <?php foreach($orders as $order) {
?>
 <option value="<?php echo $order->getIncrementId() ?>"><?php echo $order->getIncrementId() ?></option>
  <?php } ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top