File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed
Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 33 * Copyright © Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
7+ declare (strict_types=1 );
8+
69namespace Magento \Sales \Block \Adminhtml \Order \Create \Sidebar ;
710
811use Magento \Framework \Pricing \PriceCurrencyInterface ;
Original file line number Diff line number Diff line change 99
1010use Magento \Catalog \Model \Product ;
1111use Magento \Catalog \Pricing \Price \FinalPrice ;
12+ use Magento \Store \Model \ScopeInterface ;
1213
1314/**
1415 * Adminhtml sales order create sidebar cart block
@@ -146,4 +147,30 @@ private function getCartItemCustomPrice(Product $product): ?float
146147
147148 return null ;
148149 }
150+
151+ /**
152+ * @inheritdoc
153+ */
154+ public function getItemCount ()
155+ {
156+ $ count = $ this ->getData ('item_count ' );
157+ if ($ count === null ) {
158+ $ useQty = $ this ->_scopeConfig ->getValue (
159+ 'checkout/cart_link/use_qty ' ,
160+ ScopeInterface::SCOPE_STORE
161+ );
162+ $ allItems = $ this ->getItems ();
163+ if ($ useQty ) {
164+ $ count = 0 ;
165+ foreach ($ allItems as $ item ) {
166+ $ count += $ item ->getQty ();
167+ }
168+ } else {
169+ $ count = count ($ allItems );
170+ }
171+ $ this ->setData ('item_count ' , $ count );
172+ }
173+
174+ return $ count ;
175+ }
149176}
Original file line number Diff line number Diff line change 4646 </actionGroup >
4747
4848 <!-- Add product to cart -->
49- <actionGroup ref =" AddSimpleProductToCart " stepKey =" addProductToCart " >
49+ <actionGroup ref =" StorefrontAddSimpleProductWithQtyActionGroup " stepKey =" addSimpleProductToCart " >
5050 <argument name =" product" value =" $$createProduct$$" />
51+ <argument name =" quantity" value =" 2" />
5152 </actionGroup >
5253
5354 <!-- Login as admin -->
6465 <click selector =" {{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey =" clickCreateOrder" />
6566
6667 <!-- Check product in customer's activities in shopping cart section -->
68+ <see selector =" {{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput =" Shopping Cart (2)" stepKey =" seeCorrectNumberInCart" />
6769 <see selector =" {{AdminCustomerActivitiesShoppingCartSection.productName}}" userInput =" $$createProduct.name$$" stepKey =" seeProductNameInShoppingCartSection" />
6870 <see selector =" {{AdminCustomerActivitiesShoppingCartSection.productPrice}}" userInput =" $$createProduct.price$$" stepKey =" seeProductPriceInShoppingCartSection" />
6971
7577 <!-- Assert product in items ordered grid -->
7678 <see selector =" {{AdminCustomerCreateNewOrderSection.productName}}" userInput =" $$createProduct.name$$" stepKey =" seeProductName" />
7779 <see selector =" {{AdminCustomerCreateNewOrderSection.productPrice}}" userInput =" $$createProduct.price$$" stepKey =" seeProductPrice" />
78- <seeInField selector =" {{AdminCustomerCreateNewOrderSection.productQty}}" userInput =" {{ApiSimpleSingleQty.quantity}} " stepKey =" seeProductQty" />
80+ <seeInField selector =" {{AdminCustomerCreateNewOrderSection.productQty}}" userInput =" 2 " stepKey =" seeProductQty" />
7981 </test >
8082</tests >
You can’t perform that action at this time.
0 commit comments