Additional API functions - feature request
10 years 4 months ago #240591
by iedwards
Additional API functions - feature request was created by iedwards
-- url of the page with the problem -- :
www.artistpapers.co.uk
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
Hi,
The API is great if you want to interact with actions initiated within Hikashop, but I've got a situation where I would like to instigate an action from outside of Hikashop.
In my case I want to create a new user from RSForms, creating the Joomla user is easy but getting the address into Hikashop is tricky, it would be perfect therefore if there was a "Create New User" API function.
Thanks for listening!
Ian
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
Hi,
The API is great if you want to interact with actions initiated within Hikashop, but I've got a situation where I would like to instigate an action from outside of Hikashop.
In my case I want to create a new user from RSForms, creating the Joomla user is easy but getting the address into Hikashop is tricky, it would be perfect therefore if there was a "Create New User" API function.
Thanks for listening!
Ian
Please Log in or Create an account to join the conversation.
10 years 4 months ago #240606
by nicolas
Replied by nicolas on topic Additional API functions - feature request
Hi,
Well, there kind of is. But there is no documentation about it.
You can load the HikaShop main helper, then initiliaze the address model, populate an object, and save it:
Well, there kind of is. But there is no documentation about it.
You can load the HikaShop main helper, then initiliaze the address model, populate an object, and save it:
Code:
if(!defined('DS'))
define('DS',DIRECTORY_SEPARATOR);
if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php'))
return true;
$addressClass = hikashop_get('class.address');
$address = new stdClass();
$address->address_user_id = hikashop_loadUser();
$address->addres_firstname = $my_firstname;
$address->addres_lastname = $my_lastname;
$address->addres_city = $my_city;
.....
$addressClass->save($address);
The following user(s) said Thank You: iedwards
Please Log in or Create an account to join the conversation.
10 years 4 months ago #240664
by iedwards
Replied by iedwards on topic Additional API functions - feature request
Thank you Nicolas, that's perfect, I will use that this morning.
Regards,
Ian
Regards,
Ian
Please Log in or Create an account to join the conversation.
Time to create page: 0.204 seconds