30 self::LANDING_STORE_CLOTHES,
31 self::LANDING_STORE_INSTAGRAM,
32 self::LANDING_STORE_CHATS,
33 self::LANDING_STORE_MINI_ONE_ELEMENT,
34 self::LANDING_STORE_MINI_CATALOG,
35 self::LANDING_STORE_STORE_V3,
47 $result = Sale\TradingPlatformTable::add([
50 "NAME" =>
Loc::getMessage(
'SALE_LANDING_NAME', [
'#NAME#' => $data[
'TITLE']]),
52 "CLASS" =>
'\\'.static::class,
53 "XML_ID" => static::generateXmlId(),
56 if ($result->isSuccess())
59 $this->
id = $result->getId();
62 return $result->isSuccess();
78 return (
int)mb_substr($this->
getCode(), mb_strrpos($this->
getCode(),
'_') + 1);
118 $fields = $event->getParameter(
'fields');
119 if (
$fields[
'TYPE'] !==
'STORE')
124 $primary = $event->getParameter(
'primary');
126 if (!$landing->isInstalled())
134 $fields = $event->getParameter(
'fields');
140 $primary = $event->getParameter(
'primary');
142 if ($landing->isInstalled())
144 Sale\TradingPlatformTable::update(
156 public static function onLandingSiteDelete(Main\
Event $event)
158 $primary = $event->getParameter(
'primary');
161 if ($landing->isInstalled())
168 $dbRes = $tradeBindingCollection::getList([
171 '=TRADING_PLATFORM_ID' => $landing->getId()
177 $landing->unsetActive();
181 $landing->uninstall();
191 $id = $event->getParameter(
'id');
192 $delete = $event->getParameter(
'delete');
194 $res = \Bitrix\Landing\Site::getList([
200 'CHECK_PERMISSIONS' =>
'N',
211 if (!$landing || !$landing->isInstalled())
218 $landing->unsetActive();
222 $landing->setActive();
232 return static::TRADING_PLATFORM_CODE.static::CODE_DELIMITER.$id;
238 public function getInfo()
240 if (!Main\Loader::includeModule(
'landing'))
251 $dbRes = \Bitrix\Landing\Site::getList([
253 '=ID' => $this->getSiteId(),
254 'CHECK_PERMISSIONS' =>
'N',
255 '=DELETED' => [
'Y',
'N'],
259 if ($data = $dbRes->fetch())
262 $this->site[
'PUBLIC_URL'] = \Bitrix\Landing\Site::getPublicUrl($this->getSiteId());
271 if (!isset($data[
'XML_ID']) || !$data[
'XML_ID'])
273 return parent::getAnalyticCode();
276 foreach (static::$stores as $store)
278 if (mb_strpos($data[
'XML_ID'], $store) !==
false)
284 return $data[
'XML_ID'];
295 if ($type === static::LINK_TYPE_PUBLIC_DETAIL_ORDER)
297 return $this->getLandingSysPageUrl(
300 'SECTION' =>
'orders',
301 'ID' => $order->getId()
306 if ($type === static::LINK_TYPE_PUBLIC_FEEDBACK)
308 return $this->getLandingSysPageUrl(
'feedback');
319 private function getLandingSysPageUrl(
string $type, array $additional = []): string
321 if (!Main\Loader::includeModule(
'landing'))
326 return \Bitrix\Landing\Syspage::getSpecialPage($this->getSiteId(), $type, $additional);
334 return (
string)($this->
getInfo()[
'TITLE'] ??
'');
344 if (!isset($info[
'XML_ID']))
349 return mb_strpos($info[
'XML_ID'], $type) !==
false;
static loadMessages($file)
static getMessage($code, $replace=null, $language=null)