当前位置: 首页>>代码示例>>PHP>>正文


PHP Order::getPropertyCollection方法代码示例

本文整理汇总了PHP中Bitrix\Sale\Order::getPropertyCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getPropertyCollection方法的具体用法?PHP Order::getPropertyCollection怎么用?PHP Order::getPropertyCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Sale\Order的用法示例。


在下文中一共展示了Order::getPropertyCollection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convertOrderToArray

 /**
  * @internal
  * @param Sale\Order $order
  * @return array
  */
 public static function convertOrderToArray(Sale\Order $order)
 {
     $fields = $order->getFieldValues();
     //getWeight
     $fields = array_merge($fields, array('ORDER_WEIGHT' => 0, 'BASKET_ITEMS' => array(), 'ORDER_PROP' => array(), 'DISCOUNT_LIST' => array(), 'TAX_LIST' => array(), 'VAT_RATE' => $order->getVatRate(), 'VAT_SUM' => $order->getVatSum()));
     /** @var Sale\Basket $basket */
     if ($basket = $order->getBasket()) {
         /** @var Sale\BasketItem $basketItem */
         foreach ($basket as $basketItem) {
             $fields['BASKET_ITEMS'][] = BasketCompatibility::convertBasketItemToArray($basketItem);
         }
     }
     /** @var Sale\PropertyValueCollection $basket */
     if ($propertyCollection = $order->getPropertyCollection()) {
         /** @var Sale\PropertyValue $property */
         foreach ($propertyCollection as $property) {
             //				$propertyValue = $property->getValue();
             $fields['ORDER_PROP'][$property->getPropertyId()] = $property->getValue();
         }
     }
     if ($propProfileName = $propertyCollection->getProfileName()) {
         $fields['PROFILE_NAME'] = $propProfileName->getValue();
     }
     if ($propPayerName = $propertyCollection->getPayerName()) {
         $fields['PAYER_NAME'] = $propPayerName->getValue();
     }
     if ($propUserEmail = $propertyCollection->getUserEmail()) {
         $fields['USER_EMAIL'] = $propUserEmail->getValue();
     }
     if ($propDeliveryLocationZip = $propertyCollection->getDeliveryLocationZip()) {
         $fields['DELIVERY_LOCATION_ZIP'] = $propDeliveryLocationZip->getValue();
     }
     if ($propDeliveryLocation = $propertyCollection->getDeliveryLocation()) {
         $fields['DELIVERY_LOCATION'] = $propDeliveryLocation->getValue();
     }
     if ($propTaxLocation = $propertyCollection->getTaxLocation()) {
         $fields['TAX_LOCATION'] = $propTaxLocation->getValue();
     }
     /** @var Sale\ShipmentCollection $shipmentCollection */
     if ($shipmentCollection = $order->getShipmentCollection()) {
         $fields['ORDER_WEIGHT'] = $shipmentCollection->getWeight();
     }
     $fields['DISCOUNT_LIST'] = DiscountCompatibility::getOldDiscountResult();
     /** @var Sale\Tax $tax */
     if ($tax = $order->getTax()) {
         $fields['TAX_LIST'] = $tax->getTaxList();
     }
     return $fields;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:54,代码来源:ordercompatibility.php

示例2: getOrderPropertiesByJS

    public static function getOrderPropertiesByJS(Order $order)
    {
        if ($order->getId() > 0) {
            $result = $order->getPropertyCollection()->getArray();
        } else {
            $result = self::getNotRelPropData($order);
        }
        return '
			<script type="text/javascript">
				BX.ready(function(){
					BX.Sale.Admin.OrderBuyer.setOrderPropsArray(' . \CUtil::PhpToJSObject($result) . ');
				});
			</script>
		';
    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:15,代码来源:orderbuyer.php

示例3: getView

    /**
     * @param Order $order
     * @return string HTML
     */
    public static function getView(Order $order, $orderBasket)
    {
        $currency = $order->getCurrency();
        $orderProps = $order->getPropertyCollection();
        if ($email = $orderProps->getUserEmail()) {
            $email = $email->getViewHtml();
        }
        if ($phone = $orderProps->getPhone()) {
            $phone = $phone->getViewHtml();
        }
        if ($name = $orderProps->getPayerName()) {
            $name = $name->getViewHtml();
        }
        $totalPrices = OrderEdit::getTotalPrices($order, $orderBasket, false);
        $result = '
			<div class="adm-bus-orderinfoblock adm-detail-tabs-block-pin" id="sale-order-edit-block-order-info">
				<div class="adm-bus-orderinfoblock-container">
				<div class="adm-bus-orderinfoblock-title">' . Loc::getMessage("SALE_ORDER_INFO", array("#ID#" => $order->getId(), "#NUM#" => strlen($order->getField("ACCOUNT_NUMBER")) > 0 ? $order->getField("ACCOUNT_NUMBER") : $order->getId(), "#DATE#" => $order->getDateInsert()->toString())) . " [" . $order->getSiteId() . "]" . '<div class="adm-bus-orderinfoblock-status success" id="order_info_order_status_name">' . $order->getField('STATUS_ID') . '</div> <!-- TODO -->
				</div>
				<div class="adm-bus-orderinfoblock-content">
					<div class="adm-bus-orderinfoblock-content-block-customer">
						<ul class="adm-bus-orderinfoblock-content-customer-info">
							<li>
								<span class="adm-bus-orderinfoblock-content-customer-info-param">' . Loc::getMessage("SALE_ORDER_INFO_FIO") . ':</span>
								<span class="adm-bus-orderinfoblock-content-customer-info-value" id="order_info_buyer_name">' . $name . '</span>
							</li>
							<li>
								<span class="adm-bus-orderinfoblock-content-customer-info-param">E-Mail:</span>
								<span class="adm-bus-orderinfoblock-content-customer-info-value"  id="order_info_buyer_email">' . $email . '</span>
							</li>
							<li>
								<span class="adm-bus-orderinfoblock-content-customer-info-param">' . Loc::getMessage("SALE_ORDER_INFO_PHONE") . ':</span>
								<span class="adm-bus-orderinfoblock-content-customer-info-value" id="order_info_buyer_phone">' . $phone . '</span>
							</li>
						</ul>
					</div>
					<div class="adm-bus-orderinfoblock-content-block-order">
						<ul class="adm-bus-orderinfoblock-content-order-info">
							<li>
								<span class="adm-bus-orderinfoblock-content-order-info-param">' . Loc::getMessage("SALE_ORDER_INFO_PRICE") . '</span>
								<span class="adm-bus-orderinfoblock-content-order-info-value" id="order_info_price_basket">' . SaleFormatCurrency(floatval($totalPrices["PRICE_BASKET"]), $currency) . '</span>
							</li>
							<li class="adm-bus-orderinfoblock-content-redtext">
								<span class="adm-bus-orderinfoblock-content-order-info-param">' . Loc::getMessage("SALE_ORDER_INFO_DISCOUNT_PRICE") . '</span>
								<span class="adm-bus-orderinfoblock-content-order-info-value" id="order_info_price_basket_discount">' . SaleFormatCurrency(floatval($totalPrices["PRICE_BASKET_DISCOUNTED"]), $currency) . '</span>
							</li>
							<li>
								<span class="adm-bus-orderinfoblock-content-order-info-param">' . Loc::getMessage("SALE_ORDER_INFO_DELIVERY_PRICE") . '</span>
								<span class="adm-bus-orderinfoblock-content-order-info-value" id="order_info_delivery_price">' . SaleFormatCurrency(floatval($order->getDeliveryPrice()), $currency) . '</span>
							</li>
						</ul>
						<ul class="adm-bus-orderinfoblock-content-order-info-result">
							<li>
								<span class="adm-bus-orderinfoblock-content-order-info-param">' . Loc::getMessage("SALE_ORDER_INFO_ALL_PRICE") . '</span>
								<span class="adm-bus-orderinfoblock-content-order-info-value" id="order_info_buyer_price">' . SaleFormatCurrency(floatval($order->getPrice()), $currency) . '</span>
							</li>
						</ul>
					</div>
					<div class="adm-bus-orderinfoblock-content-block-last">
						' . Loc::getMessage("SALE_ORDER_INFO_PAYED") . ': ' . SaleFormatCurrency(floatval($order->getSumPaid()), $currency) . '<ul class="adm-bus-orderinfoblock-content-last">';
        $updatersContent = "";
        foreach (self::getPaymentsInfo($order) as $payment) {
            $result .= '<a href="#payment_' . $payment["ID"] . '" style="text-decoration: none;">
				<li id="sale-admin-order-icon-payment-' . $payment["ID"] . '" class="adm-bus-orderinfoblock-content-last-icon ' . ($payment["IS_PAYED"] ? 'green' : 'red') . '" ';
            if (strval($payment["LOGOTIP_PATH"]) != '') {
                $result .= 'style="background-image: url(' . $payment["LOGOTIP_PATH"] . ');" ';
            }
            $result .= 'title="' . htmlspecialcharsbx($payment["NAME"]) . '"' . '><span></span></li></a>';
            if (strlen($updatersContent) > 0) {
                $updatersContent .= ",\n";
            }
            $updatersContent .= "\tPAYMENT_PAID_" . $payment["ID"] . ": function(paid) { BX.Sale.Admin.OrderInfo.setIconLamp('payment', '" . $payment["ID"] . "', (paid == 'Y' ? 'green' : 'red')); }";
        }
        $result .= '</ul>
						' . Loc::getMessage("SALE_ORDER_INFO_SHIPMENT") . '
						<ul class="adm-bus-orderinfoblock-content-last">';
        foreach (self::getShipmentsInfo($order) as $shipment) {
            $result .= '<a href="#shipment_' . $shipment["ID"] . '" style="text-decoration: none;">
				<li id="sale-admin-order-icon-shipment-' . $shipment["ID"] . '" class="adm-bus-orderinfoblock-content-last-icon ' . ($shipment["DEDUCTED"] == "Y" ? 'green' : 'red') . '" ';
            if (strval($shipment["LOGOTIP_PATH"]) != '') {
                $result .= 'style="background-image: url(' . $shipment["LOGOTIP_PATH"] . ');" ';
            }
            $result .= 'title="' . htmlspecialcharsbx($shipment["NAME"]) . '"' . '><span></span></li></a>';
            if (strlen($updatersContent) > 0) {
                $updatersContent .= ",\n";
            }
            $updatersContent .= "\tSHIPMENT_STATUS_" . $shipment["ID"] . ": function(shipmentStatus) { BX.Sale.Admin.OrderInfo.setIconLamp('shipment', '" . $shipment["ID"] . "', (shipmentStatus == 'DF' ? 'green' : 'red')); }";
        }
        $result .= '</ul>
					</div>
				</div>
				<div id="sale-order-edit-block-order-info-pin" onclick="BX.Sale.Admin.OrderEditPage.toggleFix(this.id, \'sale-order-edit-block-order-info\');" class="adm-detail-pin-btn-tabs" style="top: 9px;right: 5px;"></div>
				</div>
			</div>';
        $orderEditOpts = \CUserOptions::GetOption("sale_admin", "sale_order_edit", array());
        $isFixed = isset($orderEditOpts["fix_sale-order-edit-block-order-info"]) && $orderEditOpts["fix_sale-order-edit-block-order-info"] == "Y" ? true : false;
//.........这里部分代码省略.........
开发者ID:Satariall,项目名称:izurit,代码行数:101,代码来源:orderinfo.php

示例4: 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;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:20,代码来源:orderedit.php


注:本文中的Bitrix\Sale\Order::getPropertyCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。