protected function getOrderItems($order) { $items = []; foreach ($order->getItems() as $item) { $items[] = [ 'id' => $item->id(), 'quantity' => $item->getQuantity(), 'title' => $item->getTitle(), 'unit_price' => floor($item->getUnitPrice()->getNumber()), ]; } return $items; }
Commerceで注文情報から全Itemを得る方法
OTHER FAQ
カテゴリ | Core Ver. | 関連モジュール | タイトル |
---|---|---|---|
アップデート | 8.9.x | composer patch | patch を composer に 組み込む方法 |
アップデート | 8.9.x | Composer update | Composer で drupal/core-8.9.7 に更新できなくなった場合の処置 |
コンテンツの作成 | 8.9.x | CSS | キャプション付きの(右寄/左寄)画像を画像サイズを基準にきれいに表示する方法 |
リバースプロキシ | 8.9.x | mod_proxy mod_proxy_http mod_ssl | Apache2.4 から httpsサーバーへリバースプロキシする方法 |
アップデート | 8.9.x | PHP | CentosでPHPのバージョンアップ(例:5.3->5.6)を行う方法 |
テーマ | 8.9.x | Twig | Twig で 月末日を算出する方法 |
Migrate | 9.x | drush config | Upgrade source(環境) を 変更したときにやるべきこと |