How to Upload Orders from CSV in Magento Frontend by Customer

csvorders

I have customer type as wholesaler.if any wholesaler logged into magento from front end he should be able to place bulk orders through csv as an option.

I mean he knows all product skus.
Is there any extension to meet this requirment? otherwise i need to code?

Thanks in advance.Please comment if any clarification needed?

Best Answer

I have a client that has something similar to this on their site. As far as I know there are no extensions for it. We wrote something custom and it's not that difficult. You need a form to upload the file then just a module with a controller that validates and parses the file, looks up each product by the SKU and adds to the cart similar to this:

// Validate file and collect SKUs, quantities into $row assoc array
$cart = Mage::getModel('checkout/cart');
foreach ($row as $sku => $qty) {
  $product = Mage::getModel('catalog/product')->getIdBySku($sku);
  if ($product)
    $cart->addProduct($product, array('qty' => $qty));
}
$cart->save();
$this->_redirect('checkout/cart');
return;

I left out a lot of details, of course, but that is the gist of it.

Related Topic