1
0
Fork 0
mirror of synced 2025-04-04 14:23:33 +03:00

ref #91040 Добавлена инициализация шаблона для работы с подписками

Добалена подписка при работе с прогроммой лояльности
Добавлена обработка подписки при регистрации клиента.
This commit is contained in:
Ivan Chaplygin 2023-07-14 14:48:35 +03:00
parent 85b53c6e27
commit 3f084d1eee
5 changed files with 64 additions and 1 deletions

View file

@ -81,3 +81,4 @@ $MESS["SEC"] = "сек.";
$MESS["RESEND_SMS"] = "Отправить смс повторно";
$MESS["RESEND_POSSIBLE"] = "Повторная отправка смс возможна через";
$MESS["LOYALTY_CONNECTION_ERROR"] = "Возникли проблемы с подключением к удаленному серверу. Попробуйте перезагрузить страницу.";
$MESS["SUBSCRIBE_EMAIL"] = "Подписаться на события";

View file

@ -540,6 +540,19 @@ if ($arResult["LOYALTY_CONNECTION_ERROR"] === true) {
<td><?=GetMessage("REGISTER_CAPTCHA_PROMT")?>:<span class="starrequired">*</span></td>
<td><input type="text" name="captcha_word" maxlength="50" value="" autocomplete="off"/></td>
</tr>
<tr>
<td></td>
<td>
<div class="fields boolean">
<div class="fields boolean">
<label>
<input type="checkbox" name="UF_SUBSCRIBE_USER_EMAIL" id="checkbox_UF_SUBSCRIBE_USER_EMAIL"> <?=GetMessage("SUBSCRIBE_EMAIL")?>
</label>
</div>
</div>
</td>
</tr>
<?
}
/* !CAPTCHA */

View file

@ -0,0 +1,21 @@
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/header.php');
$APPLICATION->SetTitle('Регистрация');
?>
<?php $APPLICATION->IncludeComponent(
'bitrix:main.register',
'default_subscribe',
[
'AUTH' => 'Y',
'REQUIRED_FIELDS' => [],
'SET_TITLE' => 'Y',
'SHOW_FIELDS' => ['NAME'],
'SUCCESS_PAGE' => '',
'USER_PROPERTY' => [],
'USER_PROPERTY_NAME' => '',
'USE_BACKURL' => 'Y',
]
); ?>
<?php require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/footer.php'); ?>

View file

@ -162,7 +162,7 @@ class CustomerBuilder implements BuilderInterface
$this->customer->externalId = $this->user->getId();
$this->customer->email = $this->user->getEmail();
$this->customer->createdAt = $this->user->getDateRegister();
$this->customer->subscribed = false;
$this->customer->subscribed = !empty($this->user->getSubscribe());
}
/**

View file

@ -524,6 +524,14 @@ class User extends AbstractSerializableModel
*/
private $loyalty;
/**
* @var bool
*
* @Mapping\Type("boolean")
* @Mapping\SerializedName("UF_SUBSCRIBE_USER_EMAIL")
*/
private $subscribe;
/**
* @return int
*/
@ -1730,4 +1738,24 @@ class User extends AbstractSerializableModel
{
$this->loyalty = $loyalty;
}
/**
* @return bool
*/
public function getSubscribe()
{
return $this->subscribe;
}
/**
* @param bool $subscribe
* @return $this
*/
public function setSubscribe($subscribe)
{
$this->subscribe = $subscribe;
return $this;
}
}