add custom fields
This commit is contained in:
parent
55935dddde
commit
0631cb8b78
7 changed files with 88 additions and 22 deletions
|
@ -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
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
5
intaro.retailcrm/install/payment/.description.php
Normal file
5
intaro.retailcrm/install/payment/.description.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/netpay.sale/payment/netpay.sale/.description.php');
|
||||
|
||||
?>
|
5
intaro.retailcrm/install/payment/payment.php
Normal file
5
intaro.retailcrm/install/payment/payment.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/netpay.sale/payment/netpay.sale/payment.php');
|
||||
|
||||
?>
|
14
intaro.retailcrm/lib/payment/retailcrmbonus/.description.php
Executable file
14
intaro.retailcrm/lib/payment/retailcrmbonus/.description.php
Executable 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' => [],
|
||||
];
|
36
intaro.retailcrm/lib/payment/retailcrmbonus/handler.php
Executable file
36
intaro.retailcrm/lib/payment/retailcrmbonus/handler.php
Executable 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 [];
|
||||
}
|
||||
|
||||
}
|
3
intaro.retailcrm/lib/payment/retailcrmbonus/lang/en/.description.php
Executable file
3
intaro.retailcrm/lib/payment/retailcrmbonus/lang/en/.description.php
Executable file
|
@ -0,0 +1,3 @@
|
|||
<?
|
||||
$MESS["SALE_HPS_BONUS"] = "retailCRM bonus account";
|
||||
?>
|
2
intaro.retailcrm/lib/payment/retailcrmbonus/lang/ru/.description.php
Executable file
2
intaro.retailcrm/lib/payment/retailcrmbonus/lang/ru/.description.php
Executable file
|
@ -0,0 +1,2 @@
|
|||
<?
|
||||
$MESS["SALE_HPS_BONUS"] = "бонусный счет retailCRM";
|
Loading…
Add table
Reference in a new issue