File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \Sales \Block \Adminhtml \Order \Create \Sidebar ;
7
10
8
11
use Magento \Framework \Pricing \PriceCurrencyInterface ;
12
+ use Magento \Store \Model \ScopeInterface ;
9
13
10
14
/**
11
15
* Adminhtml sales order create sidebar block
@@ -132,7 +136,20 @@ public function getItemCount()
132
136
{
133
137
$ count = $ this ->getData ('item_count ' );
134
138
if ($ count === null ) {
135
- $ count = count ($ this ->getItems ());
139
+ $ useQty = $ this ->_scopeConfig ->getValue (
140
+ 'checkout/cart_link/use_qty ' ,
141
+ ScopeInterface::SCOPE_STORE
142
+ );
143
+ $ allItems = $ this ->getItems ();
144
+ if ($ useQty ) {
145
+ $ count = 0 ;
146
+ foreach ($ allItems as $ item ) {
147
+ $ count += $ item ->getQty ();
148
+ }
149
+ } else {
150
+ $ count = count ($ allItems );
151
+ }
152
+
136
153
$ this ->setData ('item_count ' , $ count );
137
154
}
138
155
return $ count ;
You can’t perform that action at this time.
0 commit comments