CustomerService
This service class contains functions related to the customer.
All public functions are available in the Twig template renderer.
Namespace
IO\Services
Type | Name | Description |
---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods
public __construct($accountRepository, $coreContactRepository, $contactRepository, $contactAddressRepository, $addressRepository, $contactClassRepository, $sessionStorageRepository)
CustomerService constructor.
Type |
Name |
Description |
|
||
|
||
|
||
|
||
|
||
|
||
|
public getContactId():int
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Get the ID of the current contact from the session
public getContactClassData($contactClassId):array
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Get the data of a contact class
Type |
Name |
Description |
|
Unique id of a contact class |
public showNetPrices():bool
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Check if net prices should be shown
public showNetPricesByContactId($contactId):bool
Check if net prices should be shown for this contact
Type |
Name |
Description |
|
Unique id of a contact |
public getContactClassMinimumOrderQuantity():int
Gets the minimum order quantity of the current contacts contact class
public registerCustomer($contactData, $billingAddressData = [], $deliveryAddressData = []):Contact
Create a contact with addresses if specified
Type |
Name |
Description |
|
The contacts data |
|
|
The contacts billing address |
|
|
The contacts delivery address |
public createAccount($accountData):Account
Creates an user account
Type |
Name |
Description |
|
User account data |
Create a new contact
Type |
Name |
Description |
|
The contacts data |
public getContact():Contact
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Find the current contact
public getContactClassId():int
Deprecated!
since 5.0.0 will be removed in 6.0.0 |
Gets the current contact's contact class id
public updateContact($contactData):Contact
Update a contact
Type |
Name |
Description |
|
New contact data |
public updatePassword($newPassword, $contactId, $hash = ""):mixed
Update a customers password
Type |
Name |
Description |
|
The new password |
|
|
Id of the contact |
|
|
Optional: Security hash |
public getAddresses($typeId = null):array \| Collection
List the addresses of a contact
Type |
Name |
Description |
|
Type of address |
public getAddress($addressId, $typeId):Address
Get an address by ID
Type |
Name |
Description |
|
Unique id of address |
|
|
Type of address |
public createAddress($addressData, $typeId):Address
Create an address with the specified address type
Type |
Name |
Description |
|
The address data |
|
|
Type of address |
public updateAddress($addressId, $addressData, $typeId):Address
Update an address
Type |
Name |
Description |
|
Id of address to update |
|
|
Updated address data |
|
|
Type of address to update |
public deleteAddress($addressId, $typeId)
Delete an address
Type |
Name |
Description |
|
Id of address to delete |
|
|
Type of address to delete |
public getOrders($page = 1, $items = 10, $filters = []):array \| PaginatedResult
Get a list of orders for the current contact
Type |
Name |
Description |
|
Optional: What page to get |
|
|
Optional: How many items per page |
|
|
Optional: Additional filters |
public hasReturns():bool
Check if a contact has made return orders
public getReturns($page = 1, $items = 10, $filters = [], $wrapped = true):PaginatedResult
Get a list of return orders for the current contact
Type |
Name |
Description |
|
||
|
||
|
||
|
public getLatestOrder():LocalizedOrder
Get the last order created by the current contact
public resetGuestAddresses()
Resets the baskets current addresses if current contact is a guest
public getEmail():string
Gets the email address of the current contact
public getContactNumber($contactId):string
Gets a contacts contact number
Type |
Name |
Description |
|
Unique id of a contact |
public deleteGuestAddresses()
Delete adresses that are not bound to a contact
public fromMemoryCache()
public resetMemoryCache($key = null)
Type |
Name |
Description |
|