Anyway, I've done my first modules, simple codes, etc
Now Im in big challange - from simple page at PHP code I need to add new customer.
I found at libs function addCustomer($data).
When I tried this:
Code: Select all
$nowykustomer = array(
'customer_group_id' => 1,
'store_id' => 0,
'language_id' => (int)$this->config->get('config_language_id'),
'firstname' => "Kodowy",
'lastname' => "Programistyczny",
'email' => "mail@utworzony.przez.skrypt",
'telephone' => 112903201,
'password' => "password"
'ip' => $_SERVER['REMOTE_ADDR']
);
$this->customer->addCustomer($nowykustomer);
Sooo... im beg all of You - help me, please. I freaky don't know how to deal with problem. I tried so many $data and always is the same result...
What I do wrong?... Well big THX for helping
Edit: I'm using newest OpenCart... Soo... I've tried every options and... propably to solve my problem is simple using MySQL action. I'm right?
Code: Select all
INSERT INTO `oc_customer` ........
Code: Select all
$this->db->query("INSERT INTO `oc_customer` (`customer_id`, `customer_group_id`, `store_id`, `language_id`, `firstname`, `lastname`, `email`, `telephone`, `fax`, `password`, `salt`, `cart`, `wishlist`, `newsletter`, `address_id`, `custom_field`, `ip`, `status`, `safe`, `token`, `code`, `date_added`) VALUES (NULL, '1',".(int)$this->config->get('config_store_id').",".(int)$this->config->get('config_language_id').", 'FIRSTNAME', 'LASTNAME', 'E-M@IL.DOT.COM', 'TELEPHONE', '', 'MD5-HASH-PASSWORD', 'SALT-FOR-PASSWORD', NULL, NULL, '1', '1', '', '".$_SERVER['REMOTE_ADDR']."', '1', '0', '', '', '0000-00-00 00:00:00')");
Bless You all