I want to create customer programmatically and want to assign current login customer quote but unable to do that. Here is script, Please see and help me.
// create customer
$websiteId = Mage::app()->getWebsite()->getId();
$store = Mage::app()->getStore();
$firstname ="Firstname";
$lastname = "Lastname";
$email = "[email protected]";
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId)
->setStore($store)
->setFirstname($firstname)
->setLastname($lastname)
->setEmail($email)
->setPassword('test123');
$customer->save();
$customer_id = $customer->getId();
// quote assign to new customer
$session = Mage::getSingleton('checkout/session');
$current_quote_id = $session->getQuoteId();
$currentQuote = Mage::getModel('sales/quote')->load($current_quote_id);
$currentQuoteItem = $currentQuote->getAllItems();
$newQuote = Mage::getModel('sales/quote');
$newQuote->assignCustomer($customer);
$newQuote->addItem($currentQuoteItem);
$newQuote->setQuote($newQuote);
$newQuote->collectTotals()->save();
Above script is creating the customer but not assinging the quote in customer's account.