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


PHP order::getActualPrice方法代码示例

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


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

示例1: getDeliveryPrice

 public function getDeliveryPrice(order $order)
 {
     $objects = umiObjectsCollection::getInstance();
     $deliveryAddress = $objects->getObject($order->delivery_address);
     if (!$deliveryAddress) {
         return "Невозможно автоматически определить стоимость";
     }
     $orderPrice = $order->getActualPrice();
     $weight = 0;
     $items = $order->getItems();
     foreach ($items as $item) {
         $element = $item->getItemElement();
         $itemWeight = (int) $element->getValue("weight");
         if ($itemWeight != 0) {
             $weight += $itemWeight * $item->getAmount();
         } else {
             return "Невозможно автоматически определить стоимость";
         }
     }
     $viewPost = $objects->getObject($this->object->viewpost)->getValue("identifier");
     if ($viewPost == 44 || $viewPost == 45) {
         $weight = $weight / 1000;
         $departureCity = $objects->getObject($this->object->departure_city);
         $departureCity = $departureCity instanceof umiObject ? $departureCity->getName() : "Москва";
         $city = $deliveryAddress->getValue("city");
         $response = $this->calculateSumEMS($price, $departureCity, $city, $weight, $min, $max, $flag);
         if ($flag == 'ok') {
             $price = $response->price;
             $min = $response->term->min;
             $max = $response->term->max;
             $flag = " {$price} руб. (займет от {$min} до {$max} дней)";
         }
         return $flag;
     } else {
         $typePost = $objects->getObject($this->object->typepost)->getValue("identifier");
         $value = $this->object->setpostvalue ? ceil($order->getActualPrice()) : 0;
         $zip = $deliveryAddress->getValue("index");
         $url = "http://www.russianpost.ru/autotarif/Autotarif.aspx?viewPost={$viewPost}&countryCode=643&typePost={$typePost}&weight={$weight}&value1={$value}&postOfficeId={$zip}";
         $content = umiRemoteFileGetter::get($url);
         if (preg_match("/<input id=\"key\" name=\"key\" value=\"(\\d+)\"\\/>/i", $content, $match)) {
             $key = trim($match[1]);
             $content = umiRemoteFileGetter::get($url, false, array('Content-type' => 'application/x-www-form-urlencoded'), array('key' => $key));
             $content = umiRemoteFileGetter::get($url);
         }
         if (preg_match("/span\\s+id=\"TarifValue\">([^<]+)<\\/span/i", $content, $match)) {
             $price = floatval(str_replace(",", ".", trim($match[1])));
             if ($price > 0) {
                 return $price;
             } elseif (preg_match("/span\\s+id=\"lblErrStr\">([^<]+)<\\/span/i", $content, $match)) {
                 return $match[1];
             }
         }
         return "Не определено. Свяжитесь с менеджером для уточнения информации.";
     }
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:55,代码来源:russianpost.php

示例2: getDeliveryPrice

 public function getDeliveryPrice(order $order)
 {
     $deliveryPrice = $this->object->price;
     $minOrderPrice = $this->object->order_min_price;
     if (is_null($minOrderPrice)) {
         return $deliveryPrice;
     }
     $orderPrice = $order->getActualPrice() - $order->getDeliveryPrice();
     return $orderPrice < $minOrderPrice ? $deliveryPrice : 0;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:10,代码来源:courier.php

示例3: renderBonusPayment

 public function renderBonusPayment(order $order, $template)
 {
     list($tpl_block) = def_module::loadTemplates("emarket/payment/" . $template, 'bonus_block');
     $customer = customer::get($order->getCustomerId());
     $block_arr = array('bonus' => $this->formatCurrencyPrice(array('reserved_bonus' => $order->getBonusDiscount(), 'available_bonus' => $customer->bonus, 'spent_bonus' => $customer->spent_bonus, 'actual_total_price' => $order->getActualPrice())));
     $block_arr['void:reserved_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $order->getBonusDiscount())));
     $block_arr['void:available_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $customer->bonus)));
     $block_arr['void:spent_bonus'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $customer->spent_bonus)));
     $block_arr['void:actual_total_price'] = $this->parsePriceTpl($template, $this->formatCurrencyPrice(array('actual' => $order->getActualPrice())));
     return def_module::parseTemplate($tpl_block, $block_arr);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:11,代码来源:__payments.php

示例4: sendManagerNotification

 public function sendManagerNotification(order $order)
 {
     $regedit = regedit::getInstance();
     $cmsController = cmsController::getInstance();
     $domains = domainsCollection::getInstance();
     $domainId = $cmsController->getCurrentDomain()->getId();
     $defaultDomainId = $domains->getDefaultDomain()->getId();
     if ($regedit->getVal("//modules/emarket/manager-email/{$domainId}")) {
         $emails = $regedit->getVal("//modules/emarket/manager-email/{$domainId}");
         $fromMail = $regedit->getVal("//modules/emarket/from-email/{$domainId}");
         $fromName = $regedit->getVal("//modules/emarket/from-name/{$domainId}");
     } elseif ($regedit->getVal("//modules/emarket/manager-email/{$defaultDomainId}")) {
         $emails = $regedit->getVal("//modules/emarket/manager-email/{$defaultDomainId}");
         $fromMail = $regedit->getVal("//modules/emarket/from-email/{$defaultDomainId}");
         $fromName = $regedit->getVal("//modules/emarket/from-name/{$defaultDomainId}");
     } else {
         $emails = $regedit->getVal('//modules/emarket/manager-email');
         $fromMail = $regedit->getVal("//modules/emarket/from-email");
         $fromName = $regedit->getVal("//modules/emarket/from-name");
     }
     $letter = new umiMail();
     $recpCount = 0;
     foreach (explode(',', $emails) as $recipient) {
         $recipient = trim($recipient);
         if (strlen($recipient)) {
             $letter->addRecipient($recipient);
             $recpCount++;
         }
     }
     if (!$recpCount) {
         return;
     }
     list($template) = def_module::loadTemplatesForMail("emarket/mail/default", "neworder_notification");
     try {
         $payment = payment::get($order->payment_id);
         $paymentName = $payment->name;
         $paymentStatus = order::getCodeByStatus($order->getPaymentStatus());
     } catch (coreException $e) {
         $paymentName = "";
         $paymentStatus = "";
     }
     $param = array();
     $param["order_id"] = $order->id;
     $param["order_name"] = $order->name;
     $param["order_number"] = $order->number;
     $param["payment_type"] = $paymentName;
     $param["payment_status"] = $paymentStatus;
     $param["price"] = $order->getActualPrice();
     $param["domain"] = cmsController::getInstance()->getCurrentDomain()->getHost();
     $content = def_module::parseTemplateForMail($template, $param);
     $langs = cmsController::getInstance()->langs;
     $letter->setFrom($fromMail, $fromName);
     $letter->setSubject($langs['notification-neworder-subject'] . " (#{$order->number})");
     $letter->setContent($content);
     $letter->commit();
     $letter->send();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:57,代码来源:__notification.php


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