Pergunta

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

enter image description here

Foi útil?

Solução

<?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 } ?>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top