function to know that there is any shipping method available
public function haveShippingMethods() { if (count(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingRatesCollection())) { return true; } return false; }
use this code to get an array of billing address and shipping address
$all_data = array(); $customer = Mage::getModel(‘customer/session’)->getCustomer(); foreach($customer->getAddressesCollection() as $customer_address) { $all_data[] = $customer_address; } var_dump($all_data);
code to create a customer account
$customer = Mage::getModel('customer/customer'); $password = 'test1234'; $email = 'dtest@gmail.com'; $customer->setWebsiteId(Mage::app()->getWebsite()->getId()); $customer->loadByEmail($email); if(!$customer->getId()) { $groups = Mage::getResourceModel('customer/group_collection')->getData(); $groupID = '3'; $customer->setData( 'group_id', $groupID ); $customer->setEmail($email); $customer->setFirstname('test'); $customer->setLastname('testing'); $customer->setPassword($password); $customer->setConfirmation(null); $customer->save(); echo $customer->getId(); }