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


PHP CSaleBasket::getList方法代码示例

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


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

示例1: getOrderInfo

 protected static function getOrderInfo($orderId)
 {
     // order itself
     $order = \CSaleOrder::getById($orderId);
     // buyer info
     $siteUserId = $order['USER_ID'];
     $phone = '';
     $email = '';
     $result = \CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId));
     while ($row = $result->fetch()) {
         if (empty($phone) && stripos($row['CODE'], 'PHONE') !== false) {
             $stPhone = static::normalizePhoneNumber($row['VALUE']);
             if (!empty($stPhone)) {
                 $phone = sha1($stPhone);
             }
         }
         if (empty($email) && stripos($row['CODE'], 'EMAIL') !== false) {
             if (!empty($row['VALUE'])) {
                 $email = sha1($row['VALUE']);
             }
         }
     }
     // products info
     $products = array();
     $result = \CSaleBasket::getList(array(), $arFilter = array('ORDER_ID' => $orderId), false, false, array('PRODUCT_ID'));
     while ($row = $result->fetch()) {
         $products[] = array('product_id' => $row['PRODUCT_ID'], 'recommendation' => '0');
     }
     // all together
     $data = array('order_id' => $orderId, 'user_id' => $siteUserId, 'phone' => $phone, 'email' => $email, 'products' => $products);
     return $data;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:32,代码来源:catalog.php

示例2: getOrderInfo

 protected static function getOrderInfo($orderId)
 {
     // order itself
     $order = \CSaleOrder::getById($orderId);
     // buyer info
     $siteUserId = $order['USER_ID'];
     $phone = '';
     $email = '';
     $result = \CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId));
     while ($row = $result->fetch()) {
         if (empty($phone) && stripos($row['CODE'], 'PHONE') !== false) {
             $stPhone = static::normalizePhoneNumber($row['VALUE']);
             if (!empty($stPhone)) {
                 $phone = sha1($stPhone);
             }
         }
         if (empty($email) && stripos($row['CODE'], 'EMAIL') !== false) {
             if (!empty($row['VALUE'])) {
                 $email = sha1($row['VALUE']);
             }
         }
     }
     // products info
     $products = array();
     $result = \CSaleBasket::getList(array(), $arFilter = array('ORDER_ID' => $orderId, 'MODULE' => 'catalog'), false, false, array('PRODUCT_ID', 'RECOMMENDATION', 'QUANTITY', 'PRICE', 'CURRENCY'));
     while ($row = $result->fetch()) {
         $productInfo = \CCatalogSKU::GetProductInfo($row['PRODUCT_ID']);
         $iblockId = 0;
         if (!empty($productInfo['ID'])) {
             $realProductId = $productInfo['ID'];
             $iblockId = $productInfo['IBLOCK_ID'];
         } else {
             $realProductId = $row['PRODUCT_ID'];
             // get iblock id
             $element = \Bitrix\Iblock\ElementTable::getRow(array('select' => array('IBLOCK_ID'), 'filter' => array('=ID' => $realProductId)));
             if (!empty($element)) {
                 $iblockId = $element['IBLOCK_ID'];
             }
         }
         $products[] = array('product_id' => $realProductId, 'iblock_id' => $iblockId, 'quantity' => $row['QUANTITY'], 'price' => $row['PRICE'], 'currency' => $row['CURRENCY'], 'recommendation' => $row['RECOMMENDATION']);
     }
     // all together
     $data = array('order_id' => $orderId, 'user_id' => $siteUserId, 'phone' => $phone, 'email' => $email, 'products' => $products, 'price' => $order['PRICE'], 'currency' => $order['CURRENCY']);
     return $data;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:45,代码来源:catalog.php


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