0

Create a custom form for the registration(or creating customer account) of customers is it possible?

Advance Thanks for help.

app/code/local/Namespace/Customform/IndexController.php

public function saveAction()
{

    $data = $this->getRequest()->getPost();

    $firstname = $data['firstname'];
    $lastname = $data['lastname'];
    $company = $data['companyname'];
    $address1 = $data['address1'];
    $address2 = $data['address2'];
    $city = $data['city'];
    $state = $data['state'];
    $zipcode = $data['zipcode'];
    $phone = $data['phone'];
    $email = $data['email'];
    $pass = $data['password'];

    $websiteId = Mage::app()->getWebsite()->getId();
    $store = Mage::app()->getStore();

    $customer = Mage::getModel("customer/customer");
    $customer   ->setWebsiteId($websiteId)
                ->setStore($store)
                ->setFirstname($firstname)
                ->setLastname($lastname)
                ->setEmail($email)
                ->setPassword($pass);

    $customer->save();

    $address = Mage::getModel("customer/address");
    $address->setCustomerId($customer->getId())
            ->setFirstname($firstname)
            ->setLastname($lastname)
            ->setPostcode($zipcode)
            ->setCity($city)
            ->setTelephone($phone)
            ->setCompany($company)
            ->setState($state);


    $address->save();



}

how to use cURL functions for the same use in customer save and customer address

Ravindrasinh Zala
  • 2,125
  • 3
  • 14
  • 46

0 Answers0