當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Basket::getOrder方法代碼示例

本文整理匯總了PHP中Basket::getOrder方法的典型用法代碼示例。如果您正苦於以下問題:PHP Basket::getOrder方法的具體用法?PHP Basket::getOrder怎麽用?PHP Basket::getOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Basket的用法示例。


在下文中一共展示了Basket::getOrder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: basket

 function basket()
 {
     if ($_POST) {
         $basket = new Basket();
         $basket->toOrder();
         $this->redirect('/cabinet/basket/thanks/');
     } else {
         if (Funcs::$uri[2] == 'delivery') {
             $seo['seo_title'] = 'Условия доставки';
             Funcs::setMeta($seo);
             $basket = new Basket();
             $data['order'] = $basket->getOrder();
             $data['delivery'] = $basket->getDelivery($data['order']);
             View::render('cabinet/delivery', $data);
         } elseif (Funcs::$uri[2] == 'thanks') {
             $seo['seo_title'] = 'Благодарим вас за заказ!';
             Funcs::setMeta($seo);
             View::render('basket/thanks');
         } else {
             $data['seo_title'] = 'Корзина';
             Funcs::setMeta($data);
             $basket = new Basket();
             $data['order'] = $basket->getOrder();
             //$data['delivery']=$basket->getDelivery($data['order']);
             //$data['payment']=$basket->getOrder($data['order']);
             View::render('cabinet/basket', $data);
         }
     }
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:29,代碼來源:CabinetController.php

示例2: purchase

 public function purchase()
 {
     if ($_POST) {
         $basket = new Basket();
         $basket->setPurchase();
         $this->redirect('/basket/finish/');
     } else {
         $tree['seo_title'] = $tree['seo_keywords'] = $tree['seo_description'] = 'Ваши данные';
         Funcs::setMeta($tree);
         $basket = new Basket();
         $tree['order'] = $basket->getOrder();
         View::render('basket/purchase', $tree);
     }
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:14,代碼來源:BasketController.php

示例3: getBasket

 public static function getBasket()
 {
     print View::getRenderEmpty('basket/basketinc', Basket::getOrder());
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:4,代碼來源:BasketModel.php

示例4: getParcel

 public static function getParcel($what, $orderid = 0)
 {
     $data = array('volume' => 0, 'weight' => 0, 'height' => 0, 'width' => 0, 'length' => 0);
     if ($what == 'site') {
         $order = Basket::getOrder();
         $arrField = 'goods';
         $data = array('volume' => 0, 'weight' => 0);
         foreach ($order[$arrField] as $item) {
             if ($item['set'] == true) {
                 foreach ($item['goods'] as $goods) {
                     $temp = Catalog::getArticle($goods['sizeId']);
                     $data['volume'] += $temp['height'] * $temp['width'] * $temp['length'];
                     $data['weight'] += $temp['weight'];
                     if ($temp['width'] > $data['width']) {
                         $data['width'] = $temp['width'];
                     }
                     if ($temp['length'] > $data['length']) {
                         $data['length'] = $temp['length'];
                     }
                     $data['height'] += $temp['height'];
                 }
             } else {
                 $temp = Catalog::getArticle($item['sizeId']);
                 $data['volume'] += $temp['height'] * $temp['width'] * $temp['length'];
                 $data['weight'] += $temp['weight'];
                 if ($temp['width'] > $data['width']) {
                     $data['width'] = $temp['width'];
                 }
                 if ($temp['length'] > $data['length']) {
                     $data['length'] = $temp['length'];
                 }
                 $data['height'] += $temp['height'];
             }
         }
         $data['volume'] = $data['volume'] / 1000000;
         $data['weight'] = $data['weight'] / 1000;
         $address = Region::getCity($_SESSION['iuser']['address'][0]['city']);
     } else {
         $order = Orders::getOrderById($orderid);
         foreach ($order['goods'] as $item) {
             $temp = Goods::getSizeByName($item['tree'], $item['size']);
             $data['volume'] += $temp['height'] * $temp['width'] * $temp['length'];
             $data['weight'] += $temp['weight'];
             if ($temp['width'] > $data['width']) {
                 $data['width'] = $temp['width'];
             }
             if ($temp['length'] > $data['length']) {
                 $data['length'] = $temp['length'];
             }
             $data['height'] += $temp['height'];
         }
         $data['volume'] = $data['volume'] / 1000000;
         $data['weight'] = $data['weight'] / 1000;
         $address = IuserAddress::getCity($order['address']['city']);
     }
     return array('data' => $data, 'address' => $address);
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:57,代碼來源:DeliveryModel.php


注:本文中的Basket::getOrder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。