Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setCustomerType example
$this
->connection->
insert
(
's_emarketing_referer',
[
'userID' =>
$customer
->
getId
(
)
,
'referer' =>
$customer
->
getReferer
(
)
,
'date' =>
date
(
'Y-m-d H:i:s'
)
,
]
)
;
}
private
function
saveCustomer
(
ShopStruct
$shop
, Customer
$customer
)
: void
{
if
(
$customer
->
getValidation
(
)
!== ContextService::FALLBACK_CUSTOMER_GROUP
)
{
$customer
->
setCustomerType
(
Customer::CUSTOMER_TYPE_BUSINESS
)
;
}
$customerConfirmed
= !
$customer
->
getDoubleOptinRegister
(
)
||
$customer
->
getDoubleOptinConfirmDate
(
)
!== null;
$customer
->
setActive
(
$customerConfirmed
)
;
if
(
!
$customerConfirmed
)
{
// Reset login information if Double-Opt-In is active
$customer
->
setFirstLogin
(
null
)
;
$customer
->
setLastLogin
(
null
)
;
$customer
->
setDoubleOptinEmailSentDate
(
new
DateTime
(
)
)
;
}