Beispiel #1
0
 function displayOrder($sType, $iId)
 {
     $sMethodName = 'get' . ucfirst($sType);
     $aOrder = $this->_oDb->{$sMethodName}(array('type' => 'id', 'id' => $iId));
     $aSeller = $this->_oDb->getVendorInfoProfile((int) $aOrder['seller_id']);
     $aResult = array('client_name' => getNickName($aOrder['client_id']), 'client_url' => getProfileLink($aOrder['client_id']), 'bx_if:show_link' => array('condition' => !empty($aSeller['profile_url']), 'content' => array('seller_name' => $aSeller['profile_name'], 'seller_url' => $aSeller['profile_url'])), 'bx_if:show_text' => array('condition' => empty($aSeller['profile_url']), 'content' => array('seller_name' => $aSeller['profile_name'])), 'order' => $aOrder['order'], 'provider' => $aOrder['provider'], 'error' => $aOrder['error_msg'], 'date' => $aOrder['date_uf'], 'bx_repeat:items' => array());
     if ($sType == BX_PMT_ORDERS_TYPE_PENDING) {
         $aItems = BxPmtCart::items2array($aOrder['items']);
     } else {
         $aItems = BxPmtCart::items2array($aOrder['seller_id'] . '_' . $aOrder['module_id'] . '_' . $aOrder['item_id'] . '_' . $aOrder['item_count']);
     }
     foreach ($aItems as $aItem) {
         $aInfo = BxDolService::call((int) $aItem['module_id'], 'get_cart_item', array($aOrder['client_id'], $aItem['item_id']));
         $aResult['bx_repeat:items'][] = array('bx_if:link' => array('condition' => !empty($aInfo['url']), 'content' => array('title' => $aInfo['title'], 'url' => $aInfo['url'])), 'bx_if:text' => array('condition' => empty($aInfo['url']), 'content' => array('title' => $aInfo['title'])), 'quantity' => $aItem['item_count'], 'price' => $aInfo['price'], 'currency_code' => $aSeller['currency_code']);
     }
     return $this->parseHtmlByName($sType . '_order.html', $aResult);
 }
Beispiel #2
0
 function getPendingOrders($aParams)
 {
     $sDateFormat = $this->_oConfig->getDateFormat('orders');
     $sFilterAddon = "";
     if (!empty($aParams['filter'])) {
         $sFilterAddon = " AND (DATE_FORMAT(FROM_UNIXTIME(`ttp`.`date`), '" . $sDateFormat . "') LIKE '%" . $aParams['filter'] . "%' OR `tp`.`NickName` LIKE '%" . $aParams['filter'] . "%' OR `ttp`.`order` LIKE '%" . $aParams['filter'] . "%')";
     }
     $sSql = "SELECT\n               `ttp`.`id` AS `id`,\n               `ttp`.`order` AS `order`,\n               `ttp`.`amount` AS `amount`,\n               '-' AS `license`,\n               `ttp`.`items` AS `items`,\n               `ttp`.`date` AS `date`,\n               DATE_FORMAT(FROM_UNIXTIME(`ttp`.`date`), '" . $sDateFormat . "') AS `date_uf`,\n               `tp`.`ID` AS `user_id`,\n               `tp`.`NickName` AS `user_name`\n           FROM `" . $this->_sPrefix . "transactions_pending` AS `ttp`\n           LEFT JOIN `Profiles` AS `tp` ON `ttp`.`client_id`=`tp`.`ID`\n           WHERE `ttp`.`seller_id`='" . $aParams['seller_id'] . "' AND (ISNULL(`ttp`.`order`) OR (NOT ISNULL(`ttp`.`order`) AND `ttp`.`error_code` NOT IN ('0' ,'1'))) " . $sFilterAddon . "\n           ORDER BY `ttp`.`date` DESC\n           LIMIT " . $aParams['start'] . ", " . $aParams['per_page'];
     $aOrders = $this->getAll($sSql);
     foreach ($aOrders as $iKey => $aOrder) {
         $aProducts = BxPmtCart::items2array($aOrder['items']);
         $aOrders[$iKey]['products'] = count($aProducts);
         $iItems = 0;
         foreach ($aProducts as $aProduct) {
             $iItems += (int) $aProduct['item_count'];
         }
         $aOrders[$iKey]['items'] = $iItems;
     }
     return $aOrders;
 }
Beispiel #3
0
 function __construct(&$oDb, &$oConfig, &$oTemplate)
 {
     parent::__construct($oDb, $oConfig, $oTemplate);
 }
Beispiel #4
0
 function BxPfwCart(&$oDb, &$oConfig, &$oTemplate)
 {
     parent::BxPmtCart($oDb, $oConfig, $oTemplate);
 }