本文整理汇总了PHP中Bitrix\Sale\Order::getPersonTypeId方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getPersonTypeId方法的具体用法?PHP Order::getPersonTypeId怎么用?PHP Order::getPersonTypeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Sale\Order
的用法示例。
在下文中一共展示了Order::getPersonTypeId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPaymentsInfo
protected static function getPaymentsInfo(Order $order)
{
$payments = $order->getPaymentCollection();
if (!$payments) {
return array();
}
$result = array();
/** @var $payment \Bitrix\Sale\Payment */
foreach ($payments as $payment) {
$id = $payment->getField("PAY_SYSTEM_ID");
$ptId = $order->getPersonTypeId();
if (!$id || !$ptId) {
continue;
}
$params = OrderPayment::getPaySystemParams($id, $ptId);
if (!$params) {
continue;
}
$result[] = array("ID" => $payment->getId(), "NAME" => $params["NAME"], "LOGOTIP_PATH" => $params["LOGOTIP_PATH"], "IS_PAYED" => $payment->isPaid());
}
return $result;
}
示例2: getOrderFields
/**
* @param Sale\Order $order
*
* @return array
*/
public static function getOrderFields(Sale\Order $order)
{
$result = new Sale\Result();
$paymentSystemId = false;
$deliveryId = false;
/** @var Sale\PaymentCollection $paymentCollection */
if ($paymentCollection = $order->getPaymentCollection()) {
/** @var Sale\Payment $payment */
if ($payment = $paymentCollection->rewind()) {
$paymentSystemId = $payment->getPaymentSystemId();
}
}
/** @var Sale\ShipmentCollection $shipe */
if ($shipmentCollection = $order->getShipmentCollection()) {
/** @var Sale\Shipment $shipment */
foreach ($shipmentCollection as $shipment) {
if ($shipment->getDeliveryId() > 0) {
$deliveryId = $shipment->getDeliveryId();
break;
}
}
}
$fields = array("SITE_ID" => $order->getSiteId(), "LID" => $order->getSiteId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "PRICE" => $order->getPrice(), "CURRENCY" => $order->getCurrency(), "USER_ID" => $order->getUserId(), "PAY_SYSTEM_ID" => $paymentSystemId, "PRICE_DELIVERY" => $order->getDeliveryPrice(), "DELIVERY_ID" => $deliveryId, "DISCOUNT_VALUE" => $order->getDiscountPrice(), "TAX_VALUE" => $order->getTaxValue(), "TRACKING_NUMBER" => $order->getField('TRACKING_NUMBER'), "PAYED" => $order->getField('PAYED'), "CANCELED" => $order->getField('CANCELED'), "STATUS_ID" => $order->getField('STATUS_ID'), "RESERVED" => $order->getField('RESERVED'));
$orderFields = static::convertOrderToArray($order);
if (is_array($orderFields)) {
$orderFields = $fields + $orderFields;
$orderFields = static::convertDateFieldsToOldFormat($orderFields);
}
$result->setData(array('FIELDS' => $fields, 'ORDER_FIELDS' => $orderFields));
return $result;
}
示例3: loadForOrder
public static function loadForOrder(Order $order)
{
$objects = array();
$propertyValues = array();
$propertyValuesMap = array();
$properties = array();
if ($order->getId() > 0) {
$result = OrderPropsValueTable::getList(array('select' => array('ID', 'NAME', 'VALUE', 'CODE', 'ORDER_PROPS_ID'), 'filter' => array('ORDER_ID' => $order->getId())));
while ($row = $result->fetch()) {
$propertyValues[$row['ID']] = $row;
$propertyValuesMap[$row['ORDER_PROPS_ID']] = $row['ID'];
}
}
$filter = array();
if ($order->getPersonTypeId() > 0) {
$filter[] = array('=PERSON_TYPE_ID' => $order->getPersonTypeId());
}
$result = OrderPropsTable::getList(array('select' => array('ID', 'PERSON_TYPE_ID', 'NAME', 'TYPE', 'REQUIRED', 'DEFAULT_VALUE', 'SORT', 'USER_PROPS', 'IS_LOCATION', 'PROPS_GROUP_ID', 'DESCRIPTION', 'IS_EMAIL', 'IS_PROFILE_NAME', 'IS_PAYER', 'IS_LOCATION4TAX', 'IS_FILTERED', 'CODE', 'IS_ZIP', 'IS_PHONE', 'IS_ADDRESS', 'ACTIVE', 'UTIL', 'INPUT_FIELD_LOCATION', 'MULTIPLE', 'SETTINGS'), 'filter' => $filter, 'order' => array('SORT' => 'ASC')));
while ($row = $result->fetch()) {
$properties[$row['ID']] = $row;
}
$result = OrderPropsRelationTable::getList(array('select' => array('PROPERTY_ID', 'ENTITY_ID', 'ENTITY_TYPE'), 'filter' => array('PROPERTY_ID' => array_keys($properties))));
$propRelation = array();
while ($row = $result->fetch()) {
if (empty($row)) {
continue;
}
if (!isset($propRelation[$row['PROPERTY_ID']])) {
$propRelation[$row['PROPERTY_ID']] = array();
}
$propRelation[$row['PROPERTY_ID']][] = $row;
}
foreach ($properties as $property) {
$id = $property['ID'];
if (isset($propertyValuesMap[$id])) {
$fields = $propertyValues[$propertyValuesMap[$id]];
unset($propertyValues[$propertyValuesMap[$id]]);
unset($propertyValuesMap[$id]);
} else {
if ($property['ACTIVE'] == 'N' || $property['UTIL'] == 'Y') {
continue;
}
$fields = null;
}
if (isset($propRelation[$id])) {
$objects[] = new static($property, $fields, $propRelation[$id]);
} else {
$objects[] = new static($property, $fields);
}
}
foreach ($propertyValues as $propertyValue) {
$objects[] = new static(null, $propertyValue);
}
return $objects;
}
示例4: prepareData
public static function prepareData(Order $order)
{
$result = array("USER_ID" => $order->getUserId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "BUYER_USER_NAME" => OrderEdit::getUserName($order->getUserId()), "USER_DESCRIPTION" => $order->getField("USER_DESCRIPTION"));
return $result;
}
示例5: saveProfileData
public static function saveProfileData($profileId, Order $order, array $formData)
{
$result = new Result();
$errors = array();
if (!($profileName = $order->getPropertyCollection()->getProfileName())) {
$result->addError(new EntityError(Loc::getMessage("SALE_ORDEREDIT_PROFILE_ERROR_NAME")));
return $result;
}
$res = \CSaleOrderUserProps::DoSaveUserProfile($order->getUserId(), $profileId, $profileName->getValue(), $order->getPersonTypeId(), $propCollection = $formData["PROPERTIES"], $errors);
if ($res === false) {
if (!empty($errors)) {
foreach ($errors as $error) {
$result->addError(new EntityError($error . "<br>\n"));
}
} else {
$result->addError(new EntityError(Loc::getMessage("SALE_ORDEREDIT_PROFILE_ERROR_SAVE")));
}
}
return $result;
}
示例6: prepareData
public static function prepareData(Order $order)
{
if (\CBXFeatures::IsFeatureEnabled('SaleAccounts')) {
$strBuyerProfileUrl = '/bitrix/admin/sale_buyers_profile.php?USER_ID=' . $order->getUserId() . '&lang=' . LANGUAGE_ID;
} else {
$strBuyerProfileUrl = '/bitrix/admin/user_edit.php?ID=' . $order->getUserId() . '&lang=' . LANGUAGE_ID;
}
$result = array("USER_ID" => $order->getUserId(), "PERSON_TYPE_ID" => $order->getPersonTypeId(), "BUYER_USER_NAME" => OrderEdit::getUserName($order->getUserId()), "USER_DESCRIPTION" => $order->getField("USER_DESCRIPTION"), "BUYER_URL" => $strBuyerProfileUrl);
return $result;
}
示例7: fillEmptyOrderData
/**
* Fill empty order data.
*
* @param Order $order Order object.
* @return void
*/
protected function fillEmptyOrderData(Order $order)
{
$this->orderData = array('ID' => $order->getId(), 'USER_ID' => $order->getUserId(), 'SITE_ID' => $order->getSiteId(), 'ORDER_PRICE' => $order->getPrice(), 'ORDER_WEIGHT' => 0, 'CURRENCY' => $order->getCurrency(), 'PERSON_TYPE_ID' => $order->getPersonTypeId(), 'BASKET_ITEMS' => array(), 'PRICE_DELIVERY' => 0, 'PRICE_DELIVERY_DIFF' => 0, 'DELIVERY_ID' => 0, 'CUSTOM_PRICE_DELIVERY' => 'N', 'SHIPMENT_CODE' => 0, 'SHIPMENT_ID' => 0);
$paymentCollection = $order->getPaymentCollection();
/** @var Payment $payment */
foreach ($paymentCollection as $payment) {
if ($payment->isInner()) {
continue;
}
if (!isset($this->orderData['PAY_SYSTEM_ID'])) {
$this->orderData['PAY_SYSTEM_ID'] = $payment->getPaymentSystemId();
break;
}
}
unset($payment, $paymentCollection);
if (!isset($this->orderData['PAY_SYSTEM_ID'])) {
$this->orderData['PAY_SYSTEM_ID'] = 0;
}
}