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


PHP Order::getItems方法代码示例

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


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

示例1: createOrder

 public static function createOrder(Order $order)
 {
     echo '以下の内容で注文データを作成しました' . PHP_EOL;
     echo "商品番号\t" . "商品名\t" . "単価\t" . "数量\t" . "金額\t" . PHP_EOL;
     foreach ($order->getItems() as $order_item) {
         echo $order_item->getItem()->getId() . "\t" . $order_item->getItem()->getName() . "\t" . $order_item->getItem()->getPrice() . "\t" . $order_item->getAmount() . "\t" . $order_item->getItem()->getPrice() * $order_item->getAmount() . PHP_EOL;
     }
 }
开发者ID:JJmaz,项目名称:dp,代码行数:8,代码来源:OrderDao.php

示例2: distributeItems

 /**
  * Distribute Items.
  * 
  * @param Order $order
  * @param float $maxPricePerPackage
  * 
  * @return void
  * 
  * @throws \UnexpectedValueException
  */
 public function distributeItems(Order $order, $maxPricePerPackage)
 {
     // Calculate initial number of packages
     $numPackages = ceil($order->getTotalPrice() / $maxPricePerPackage);
     if ($numPackages > count($order->getItems())) {
         throw new \UnexpectedValueException('Some items will not fit into packages.');
     }
     $this->distributeItemsIntoPackages($order, $maxPricePerPackage, $numPackages);
 }
开发者ID:dermo666,项目名称:shippingCostExercise,代码行数:19,代码来源:PackageDistributor.php

示例3: createOrder

 public static function createOrder(Order $order)
 {
     echo "注文完了しました。\n";
     echo "商品番号\t商品名\t単価\t数量\t金額\n";
     foreach ($order->getItems() as $order_item) {
         echo $order_item->getItem()->getId() . "\t";
         echo $order_item->getItem()->getName() . "\t";
         echo $order_item->getItem()->getPrice() . "\t";
         echo $order_item->getAmount() . "\t";
         echo $order_item->getItem()->getPrice() * $order_item->getAmount();
         echo "\n";
     }
 }
开发者ID:JlR0-tt,项目名称:memo,代码行数:13,代码来源:OrderDao.class.php

示例4: setOrdersShopp

 protected function setOrdersShopp()
 {
     $time = strtotime($this->date . ' UTC');
     $dateInLocal = date("Y-m-d H:i:s", $time);
     global $wpdb;
     /*$rows = $wpdb->get_results(
     		"SELECT * FROM " . $wpdb->prefix . "shopp_purchase WHERE modified > '" . $dateInLocal . "' and (txnstatus = 'authed' or txnstatus = 'captured') order by modified ASC"
     			, ARRAY_A);*/
     $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "shopp_purchase WHERE modified > '" . $dateInLocal . "' order by modified ASC", ARRAY_A);
     //CREATE AN HOOK ON FUNCTION sc_orders_rows to allow customers to make changes
     $rows = apply_filters('sc_orders_rows', $rows, $this);
     foreach ($rows as $row) {
         $orderObj = new Order($this->software, $this->date, $row);
         $array = $orderObj->getItems();
         if (!empty($array)) {
             array_push($this->orders, new Order($this->software, $this->date, $row));
         }
     }
 }
开发者ID:bear12345678,项目名称:keylessoption,代码行数:19,代码来源:Orders.class.php

示例5: isDownloadable

function isDownloadable($software, $date, $row)
{
    $toReturn = false;
    global $wpdb;
    $table = $wpdb->prefix . "postmeta";
    $order = new Order($software, $date, $row);
    $i = 0;
    $j = 0;
    foreach ($order->getItems() as $item) {
        $i++;
        $result = $wpdb->get_row("SELECT * FROM " . $table . " WHERE post_id = " . $item->getProductID() . " and meta_key = '_downloadable'", ARRAY_A);
        if ($result['meta_value'] == "yes") {
            $toReturn = true;
            $j++;
        }
    }
    if ($i != $j) {
        $toReturn = false;
    }
    return $toReturn;
}
开发者ID:bear12345678,项目名称:keylessoption,代码行数:21,代码来源:functionsWoocommerce.php

示例6: order

 public static function order(Order $order)
 {
     $item_dao = ItemDao::getInstance();
     //1.ItemDaoインスタンスを取得し、
     foreach ($order->getItems() as $order_item) {
         //2.在庫を引き当て、
         $item_dao->setAside($order_item);
     }
     OrderDao::createOrder($order);
     //3.注文結果を表示する
 }
开发者ID:th1209,项目名称:php_design_pattern,代码行数:11,代码来源:facade.php

示例7: setNumber

 protected function setNumber($date)
 {
     $time = strtotime($date . ' UTC');
     $dateInLocal = date("Y-m-d H:i:s", $time);
     global $wpdb;
     $split = explode('.', $this->software->getVersion());
     if ($this->software->isCompatible()) {
         // Cas Shopperpress
         if ('shopperpress' == $this->software->getSoftware()) {
             $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "orderdata WHERE CONCAT(order_date,' ',order_time) > '" . $dateInLocal . "' order by CONCAT(order_date,' ',order_time) ASC");
             foreach ($orders as $order) {
                 $this->number++;
             }
         } else {
             if ('Shopp' == $this->software->getSoftware()) {
                 $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "shopp_purchase WHERE modified > '" . $dateInLocal . "' and (txnstatus = 'authed' or txnstatus = 'captured') order by modified ASC", ARRAY_A);
                 foreach ($orders as $order) {
                     $orderObj = new Order($this->software, $date, $order);
                     $array = $orderObj->getItems();
                     $this->number++;
                 }
             } else {
                 if ('Woocommerce' == $this->software->getSoftware()) {
                     include_once PLUGIN_PATH_SHIPWORKSWORDPRESS . 'functions/woocommerce/functionsWoocommerce.php';
                     $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "posts WHERE post_modified_gmt > '" . $dateInLocal . "' AND post_type = 'shop_order' order by post_modified_gmt ASC", ARRAY_A);
                     $count = 0;
                     foreach ($orders as $order) {
                         if ($count < 100) {
                             if (!isDownloadable($this->software, null, $order)) {
                                 $this->number++;
                                 $count = $count + 1;
                             }
                         } else {
                             break 1;
                         }
                     }
                 } else {
                     if ('WP eCommerce' == $this->software->getSoftware()) {
                         $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "wpsc_purchase_logs WHERE date > '" . $time . "' order by date ASC", ARRAY_A);
                         foreach ($orders as $order) {
                             $this->number++;
                         }
                     } else {
                         if ('Cart66 Lite' == $this->software->getSoftware()) {
                             $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "cart66_orders WHERE ordered_on > '" . $dateInLocal . "' order by ordered_on ASC", ARRAY_A);
                             foreach ($orders as $order) {
                                 $this->number++;
                             }
                         } else {
                             if ('Cart66 Pro' == $this->software->getSoftware()) {
                                 $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "cart66_orders WHERE ordered_on > '" . $dateInLocal . "' order by ordered_on ASC", ARRAY_A);
                                 foreach ($orders as $order) {
                                     $this->number++;
                                 }
                             } else {
                                 if ('Jigoshop' == $this->software->getSoftware()) {
                                     include_once PLUGIN_PATH_SHIPWORKSWORDPRESS . 'functions/jigoshop/functionsJigoshop.php';
                                     $orders = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "posts WHERE post_modified_gmt > '" . $dateInLocal . "' AND post_type = 'shop_order' order by post_modified_gmt ASC", ARRAY_A);
                                     foreach ($orders as $order) {
                                         $this->number++;
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:bear12345678,项目名称:keylessoption,代码行数:70,代码来源:Count.class.php

示例8: mapToDTO

 private function mapToDTO(Order $order)
 {
     return ['number' => $order->getNumber(), 'customer' => $order->getCustomer(), 'items' => array_map(function (OrderItem $item) {
         return ['productName' => $item->getProductName(), 'price' => ['amount' => $item->getPrice()->getAmount(), 'currency' => $item->getPrice()->getCurrency()], 'quantity' => $item->getQuantity()];
     }, $order->getItems())];
 }
开发者ID:jfilipczyk,项目名称:mongodb_datagenerator,代码行数:6,代码来源:OrderRepository.php


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