|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* This file is part of EC-CUBE |
|
4
|
|
|
* |
|
5
|
|
|
* Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved. |
|
6
|
|
|
* |
|
7
|
|
|
* http://www.lockon.co.jp/ |
|
8
|
|
|
* |
|
9
|
|
|
* This program is free software; you can redistribute it and/or |
|
10
|
|
|
* modify it under the terms of the GNU General Public License |
|
11
|
|
|
* as published by the Free Software Foundation; either version 2 |
|
12
|
|
|
* of the License, or (at your option) any later version. |
|
13
|
|
|
* |
|
14
|
|
|
* This program is distributed in the hope that it will be useful, |
|
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17
|
|
|
* GNU General Public License for more details. |
|
18
|
|
|
* |
|
19
|
|
|
* You should have received a copy of the GNU General Public License |
|
20
|
|
|
* along with this program; if not, write to the Free Software |
|
21
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
22
|
|
|
*/ |
|
23
|
|
|
|
|
24
|
|
|
namespace Eccube\Service; |
|
25
|
|
|
|
|
26
|
|
|
use Eccube\Application; |
|
27
|
|
|
use Eccube\Entity\Cart; |
|
28
|
|
|
use Eccube\Entity\Customer; |
|
29
|
|
|
use Eccube\Entity\Order; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
33
|
|
|
*/ |
|
34
|
|
|
class OrderService |
|
35
|
|
|
{ |
|
36
|
24 |
|
/** @var \Eccube\Application */ |
|
37
|
|
|
public $app; |
|
38
|
24 |
|
|
|
39
|
|
|
public function __construct(Application $app) |
|
|
|
|
|
|
40
|
|
|
{ |
|
41
|
|
|
$this->app = $app; |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* 合計数量を取得 |
|
46
|
|
|
* |
|
47
|
1 |
|
* @param Order $Order |
|
48
|
|
|
* @return int |
|
49
|
1 |
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
50
|
1 |
|
*/ |
|
51
|
|
|
public function getTotalQuantity(Order $Order) |
|
52
|
|
|
{ |
|
53
|
|
|
return $Order->calculateTotalQuantity(); |
|
54
|
1 |
|
} |
|
55
|
1 |
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* 小計を取得 |
|
58
|
|
|
* |
|
59
|
|
|
* @param Order $Order |
|
60
|
|
|
* @return int |
|
61
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
62
|
|
|
*/ |
|
63
|
6 |
|
public function getSubTotal(Order $Order) |
|
64
|
|
|
{ |
|
65
|
6 |
|
return $Order->calculateSubTotal(); |
|
66
|
6 |
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* 消費税のみの小計を取得 |
|
70
|
|
|
* |
|
71
|
6 |
|
* @param Order $Order |
|
72
|
6 |
|
* @return int |
|
73
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
74
|
|
|
*/ |
|
75
|
|
|
public function getTotalTax(Order $Order) |
|
76
|
|
|
{ |
|
77
|
|
|
return $Order->calculateTotalTax(); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
6 |
|
/** |
|
81
|
|
|
* 商品種別を取得 |
|
82
|
6 |
|
* |
|
83
|
6 |
|
* @param Order $Order |
|
84
|
|
|
* @return array |
|
85
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
86
|
|
|
*/ |
|
87
|
|
|
public function getProductTypes(Order $Order) |
|
88
|
6 |
|
{ |
|
89
|
6 |
|
return $Order->getProductTypes(); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* 下位互換用関数 |
|
94
|
|
|
* |
|
95
|
|
|
* @return Order |
|
96
|
|
|
* |
|
97
|
|
|
* @see ShoppingService::newOrder() |
|
98
|
|
|
* |
|
99
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
100
|
|
|
*/ |
|
101
|
|
|
public function newOrder() |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->app['eccube.service.shopping']->newOrder(); |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
|
|
|
|
|
107
|
|
|
* 下位互換用関数 |
|
108
|
|
|
* |
|
109
|
|
|
* @param $cartItems |
|
|
|
|
|
|
110
|
|
|
* @param Customer|null $Customer |
|
111
|
|
|
* @param $preOrderId |
|
|
|
|
|
|
112
|
|
|
* @return Order |
|
113
|
|
|
* |
|
114
|
|
|
* @see ShoppingService::createOrder() |
|
115
|
|
|
* |
|
116
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
117
|
|
|
*/ |
|
118
|
|
|
public function registerPreOrderFromCartItems($cartItems, Customer $Customer = null, $preOrderId) |
|
|
|
|
|
|
119
|
|
|
{ |
|
120
|
|
|
return $this->app['eccube.service.shopping']->createOrder($Customer); |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* 下位互換用関数 |
|
125
|
|
|
* |
|
126
|
|
|
* @param Order $Order |
|
127
|
|
|
* @param Cart $Cart |
|
|
|
|
|
|
128
|
|
|
* @return Order |
|
129
|
|
|
* |
|
130
|
|
|
* @see ShoppingService::getAmount() |
|
131
|
|
|
* |
|
132
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getAmount(Order $Order, Cart $Cart) |
|
|
|
|
|
|
135
|
|
|
{ |
|
136
|
|
|
return $this->app['eccube.service.shopping']->getAmount($Order); |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
|
|
|
|
|
140
|
|
|
* 下位互換用関数 |
|
141
|
|
|
* |
|
142
|
|
|
* @param $em トランザクション制御されているEntityManager |
|
|
|
|
|
|
143
|
|
|
* @param Order $Order 受注情報 |
|
|
|
|
|
|
144
|
|
|
* @return bool true : 成功、false : 失敗 |
|
145
|
|
|
* |
|
146
|
|
|
* @see ShoppingService::isOrderProduct() |
|
147
|
|
|
* |
|
148
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
149
|
|
|
*/ |
|
150
|
|
|
public function isOrderProduct($em, Order $Order) |
|
151
|
|
|
{ |
|
152
|
|
|
return $this->app['eccube.service.shopping']->isOrderProduct($em, $Order); |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
/** |
|
|
|
|
|
|
156
|
|
|
* 下位互換用関数 |
|
157
|
|
|
* |
|
158
|
|
|
* @param $em トランザクション制御されているEntityManager |
|
|
|
|
|
|
159
|
|
|
* @param Order $Order 受注情報 |
|
|
|
|
|
|
160
|
|
|
* @param $formData フォームデータ |
|
|
|
|
|
|
161
|
|
|
* |
|
162
|
|
|
* @see ShoppingService::setOrderUpdate() |
|
163
|
|
|
* |
|
164
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
165
|
|
|
*/ |
|
166
|
|
|
public function setOrderUpdate($em, Order $Order, $formData) |
|
|
|
|
|
|
167
|
|
|
{ |
|
168
|
|
|
$this->app['eccube.service.shopping']->setOrderUpdate($Order, $formData); |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
|
|
|
|
|
172
|
|
|
* 下位互換用関数 |
|
173
|
|
|
* |
|
174
|
|
|
* @param $em トランザクション制御されているEntityManager |
|
|
|
|
|
|
175
|
|
|
* @param Order $Order 受注情報 |
|
|
|
|
|
|
176
|
|
|
* |
|
177
|
|
|
* @see ShoppingService::setStockUpdate() |
|
178
|
|
|
* |
|
179
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
180
|
|
|
*/ |
|
181
|
|
|
public function setStockUpdate($em, Order $Order) |
|
182
|
|
|
{ |
|
183
|
|
|
$this->app['eccube.service.shopping']->setStockUpdate($em, $Order); |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
/** |
|
|
|
|
|
|
187
|
|
|
* 下位互換用関数 |
|
188
|
|
|
* |
|
189
|
|
|
* @param $em トランザクション制御されているEntityManager |
|
|
|
|
|
|
190
|
|
|
* @param Order $Order 受注情報 |
|
|
|
|
|
|
191
|
|
|
* @param Customer $user ログインユーザ |
|
|
|
|
|
|
192
|
|
|
* |
|
193
|
|
|
* @see ShoppingService::setCustomerUpdate() |
|
194
|
|
|
* |
|
195
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
196
|
|
|
*/ |
|
197
|
|
|
public function setCustomerUpdate($em, Order $Order, Customer $user) |
|
|
|
|
|
|
198
|
|
|
{ |
|
199
|
|
|
$this->app['eccube.service.shopping']->setCustomerUpdate($Order, $user); |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
|
|
203
|
|
|
} |
|
204
|
|
|
|