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


PHP BFCHelper::getSingleOrderFromService方法代码示例

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


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

示例1: JDate

    $jdate->modify('-1 month');
}
$selectdate = true;
if (!empty($hashorder)) {
    //	 controllo se ho un ordine
    $orderid = BFCHelper::decrypt($hashorder);
    //	controllo se è un ordine numerico
    if (is_numeric($orderid)) {
        //		controllo se esiste già una recensione per quell'ordine altrimenti no la faccio vedere
        $ratingCount = BFCHelper::getTotalRatingsByOrderId($orderid);
        if ($ratingCount > 0) {
            //ordine con già una recensione
            $ratingError = 2;
            $showForm = false;
        } else {
            $order = BFCHelper::getSingleOrderFromService($orderid);
            //		controllo se esiste l'ordine
            if (isset($order) && ($order->Status === 5 || $order->Status === 20)) {
                $dateCheckin = BFCHelper::parseJsonDate($order->StartDate, 'Y-m-d');
                $dateCheckin = new JDate($dateCheckin);
                $dateCheckout = BFCHelper::parseJsonDate($order->EndDate, 'Y-m-d');
                $dateCheckout = new JDate($dateCheckout);
                $expirationjdate = new JDate('now -1 month');
                // 3:20 PM, December 1st, 2012
                $checkin = $dateCheckin->format('Ym01');
                if (($dateCheckout < $expirationjdate || $dateCheckout > $jdate) && !array_key_exists($checkin, $listDateArray)) {
                    $ratingError = 5;
                    $showForm = false;
                }
                $selectdate = false;
                $name = BFCHelper::getItem($order->CustomerData, 'nome');
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:31,代码来源:rating.php

示例2: display


//.........这里部分代码省略.........
                    $obj->Name = $item->Name;
                    $totalItems[] = $obj;
                    break;
            }
            if ($this->checkAnalytics($listName) && $config->get('eecenabled', 0) == 1) {
                $checkAnalytics = true;
                switch ($itemType) {
                    case 0:
                        $value = $totalItems[0];
                        $obj = new stdClass();
                        $obj->id = "" . $value->Id . " - " . $type;
                        $obj->name = $value->Name;
                        $obj->category = $item->MainCategoryName;
                        $obj->brand = $item->Name;
                        $obj->variant = 'NS';
                        $document->addScriptDeclaration('callAnalyticsEEc("addProduct", [' . json_encode($obj) . '], "item");');
                        break;
                    case 1:
                        $allobjects = array();
                        foreach ($totalItems as $key => $value) {
                            $obj = new stdClass();
                            $obj->id = "" . $value->Id . " - " . $type;
                            $obj->name = $value->Name;
                            $obj->category = $item->MainCategoryName;
                            $obj->brand = $item->Name;
                            $obj->position = $key;
                            $allobjects[] = $obj;
                        }
                        $document->addScriptDeclaration('callAnalyticsEEc("addImpression", ' . json_encode($allobjects) . ', "list");');
                        break;
                    case 2:
                        $orderid = JRequest::getString('orderid');
                        if (!empty($orderid)) {
                            $order = BFCHelper::getSingleOrderFromService($orderid);
                            $purchaseObject = new stdClass();
                            $purchaseObject->id = "" . $order->OrderId;
                            $purchaseObject->affiliation = "" . $order->Label;
                            $purchaseObject->revenue = $order->TotalAmount;
                            $purchaseObject->tax = 0.0;
                            $allobjects = array();
                            $allservices = array();
                            $svcTotal = 0;
                            if (!empty($order->NotesData) && !empty(simpledom_load_string($order->NotesData)->xpath("//price"))) {
                                $allservices = array_values(array_filter(simpledom_load_string($order->NotesData)->xpath("//price"), function ($prc) {
                                    return (string) $prc->tag == "extrarequested";
                                }));
                                if (!empty($allservices)) {
                                    foreach ($allservices as $svc) {
                                        $svcObj = new stdClass();
                                        $svcObj->id = "" . (int) $svc->priceId . " - Service";
                                        $svcObj->name = (string) $svc->name;
                                        $svcObj->category = "Services";
                                        $svcObj->brand = $item->Name;
                                        $svcObj->variant = (string) BFCHelper::getItem($order->NotesData, 'nome', 'unita');
                                        $svcObj->price = round((double) $svc->discountedamount / (int) $svc->quantity, 2);
                                        $svcObj->quantity = (int) $svc->quantity;
                                        $allobjects[] = $svcObj;
                                        $svcTotal += (double) $svc->discountedamount;
                                    }
                                }
                                $mainObj = new stdClass();
                                $mainObj->id = "" . $order->RequestedItemId . " - Resource";
                                $mainObj->name = (string) BFCHelper::getItem($order->NotesData, 'nome', 'unita');
                                $mainObj->variant = (string) BFCHelper::getItem($order->NotesData, 'refid', 'rateplan');
                                $mainObj->category = $item->MainCategoryName;
                                $mainObj->brand = $item->Name;
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:67,代码来源:view.html.php


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