1
0
Fork 0
mirror of synced 2025-04-20 01:21:01 +00:00

add custom fields

This commit is contained in:
Sergey Chazov 2020-08-18 18:29:24 +03:00 committed by Павел
parent 55935dddde
commit 0631cb8b78
7 changed files with 88 additions and 22 deletions

View file

@ -236,7 +236,7 @@ class intaro_retailcrm extends CModule
$this->addBonusPaySystem();
$this->addLPUserFields();
$this->addLPEvents();
try {
$this->addLPOrderProps();
} catch (ObjectPropertyException | ArgumentException | SystemException $e) {
@ -1534,15 +1534,16 @@ class intaro_retailcrm extends CModule
];
$obUserField = new CUserTypeEntity;
$dbRes = CUserTypeEntity::GetList([], ["FIELD_NAME" => $filedName])->fetch();
if (!$dbRes['ID']) {
$obUserField->Add($arProps);
}
}
}
/**
* @param $personId
*
* @return \Bitrix\Main\ORM\Data\AddResult|mixed
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\ObjectPropertyException
@ -1563,21 +1564,22 @@ class intaro_retailcrm extends CModule
if (is_array($LPGroup)) {
return $LPGroup['ID'];
}
if ($LPGroup === false) {
$groupFields = [
'PERSON_TYPE_ID' => $personId,
'NAME' => self::LP_ORDER_GROUP_NAME,
'NAME' => self::LP_ORDER_GROUP_NAME,
];
$result = OrderPropsGroupTable::add($groupFields);
$result = OrderPropsGroupTable::add($groupFields);
return $result->getId();
}
}
/**
* @param $personID
* @param $groupID
*
* @throws \Bitrix\Main\ArgumentException
* @throws \Bitrix\Main\ObjectPropertyException
* @throws \Bitrix\Main\SystemException
@ -1595,21 +1597,21 @@ class intaro_retailcrm extends CModule
if ($bonusProp === null) {
CSaleOrderProps::Add(
[
"REQUIRED" => "N",
"NAME" => self::BONUS_COUNT,
"TYPE" => "TEXT",
"CODE" => "BONUS_RETAILCRM",
"USER_PROPS" => "Y",
"IS_LOCATION" => "N",
"REQUIRED" => "N",
"NAME" => self::BONUS_COUNT,
"TYPE" => "TEXT",
"CODE" => "BONUS_RETAILCRM",
"USER_PROPS" => "Y",
"IS_LOCATION" => "N",
"IS_LOCATION4TAX" => "N",
"IS_EMAIL" => "N",
"IS_EMAIL" => "N",
"IS_PROFILE_NAME" => "N",
"IS_PAYER" => "N",
'IS_FILTERED' => 'Y',
'PERSON_TYPE_ID' => $personID,
'PROPS_GROUP_ID' => $groupID,
"DEFAULT_VALUE" => 0,
"DESCRIPTION" => self::BONUS_COUNT,
"IS_PAYER" => "N",
'IS_FILTERED' => 'Y',
'PERSON_TYPE_ID' => $personID,
'PROPS_GROUP_ID' => $groupID,
"DEFAULT_VALUE" => 0,
"DESCRIPTION" => self::BONUS_COUNT,
]
);
}
@ -1713,5 +1715,4 @@ class intaro_retailcrm extends CModule
);
}
}
}

View file

@ -0,0 +1,5 @@
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/netpay.sale/payment/netpay.sale/.description.php');
?>

View file

@ -0,0 +1,5 @@
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/netpay.sale/payment/netpay.sale/payment.php');
?>

View file

@ -0,0 +1,14 @@
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
use \Bitrix\Main\Localization\Loc;
Loc::loadMessages(__FILE__);
$data = [
'NAME' => Loc::getMessage("SALE_HPS_BONUS"),
'SORT' => 100,
'CODES' => [],
];

View file

@ -0,0 +1,36 @@
<?php
namespace Sale\Handlers\PaySystem;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Request;
use Bitrix\Sale\PaySystem;
use Bitrix\Sale\Payment;
Loc::loadMessages(__FILE__);
/**
* Class RetailCrmBonusHandler
* @package Sale\Handlers\PaySystem
*/
class RetailCrmBonusHandler extends PaySystem\BaseServiceHandler
{
/**
* @param Payment $payment
* @param Request|null $request
* @return PaySystem\ServiceResult
*/
public function initiatePay(Payment $payment, Request $request = null)
{
return new PaySystem\ServiceResult();
}
/**
* @return array
*/
public function getCurrencyList()
{
return [];
}
}

View file

@ -0,0 +1,3 @@
<?
$MESS["SALE_HPS_BONUS"] = "retailCRM bonus account";
?>

View file

@ -0,0 +1,2 @@
<?
$MESS["SALE_HPS_BONUS"] = "бонусный счет retailCRM";