本文整理汇总了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');
示例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;