Skip to content

Commit c0ca5f3

Browse files
committed
ACP2E-3872: qty showing as 0 in the admin customer shopping cart section while adding BUNDLE products
1 parent c8ba4ab commit c0ca5f3

File tree

3 files changed

+86
-3
lines changed

3 files changed

+86
-3
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -11,6 +11,7 @@
1111
<section name="AdminCustomerActivitiesShoppingCartSection">
1212
<element name="productName" type="text" selector="//div[@id='sidebar_data_cart']//td[@class='col-item']"/>
1313
<element name="productPrice" type="text" selector="//div[@id='sidebar_data_cart']//td[@class='col-price']"/>
14+
<element name="productQty" type="text" selector="//div[@id='sidebar_data_cart']//td[@class='col-qty']"/>
1415
<element name="addToOrder" type="checkbox" selector="//input[contains(@id, 'sidebar-add_cart_item')]"/>
1516
</section>
1617
</sections>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCheckBundleProductInCustomerActivitiesShoppingCartTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Admin Check Bundle Product In Customer Activities Shopping Cart"/>
15+
<title value="Admin check bundle product in customer activities shopping cart test"/>
16+
<description value="Admin check bundle product in customer activities shopping cart"/>
17+
<severity value="MINOR"/>
18+
<group value="sales"/>
19+
</annotations>
20+
<before>
21+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
22+
<comment userInput="Create the category" stepKey="createCategoryComment"/>
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<createData entity="SimpleProduct2" stepKey="createFirstProduct"/>
25+
<createData entity="SimpleProduct2" stepKey="createSecondProduct"/>
26+
<createData entity="ApiBundleProduct" stepKey="createBundleProduct"/>
27+
<createData entity="DropDownBundleOption" stepKey="createBundleOption">
28+
<requiredEntity createDataKey="createBundleProduct"/>
29+
</createData>
30+
<createData entity="ApiBundleLink" stepKey="LinkOptionToFirstProduct">
31+
<requiredEntity createDataKey="createBundleProduct"/>
32+
<requiredEntity createDataKey="createBundleOption"/>
33+
<requiredEntity createDataKey="createFirstProduct"/>
34+
</createData>
35+
<createData entity="ApiBundleLink" stepKey="LinkOptionToSecondProduct">
36+
<requiredEntity createDataKey="createBundleProduct"/>
37+
<requiredEntity createDataKey="createBundleOption"/>
38+
<requiredEntity createDataKey="createSecondProduct"/>
39+
</createData>
40+
</before>
41+
<after>
42+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
43+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
44+
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
45+
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>
46+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
47+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
48+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
49+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
50+
<argument name="indices" value=""/>
51+
</actionGroup>
52+
</after>
53+
<!-- Login as customer -->
54+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
55+
<argument name="Customer" value="$$createCustomer$$"/>
56+
</actionGroup>
57+
<!-- Add Bundle Product to Cart -->
58+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openBundleProductPage">
59+
<argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$" />
60+
</actionGroup>
61+
<actionGroup ref="StorefrontAddBundleProductToTheCartActionGroup" stepKey="addBundleProductToCart">
62+
<argument name="productName" value="$createSecondProduct.name$"/>
63+
<argument name="quantity" value="1"/>
64+
</actionGroup>
65+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
66+
<!-- Search and open customer -->
67+
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCustomerGridPage">
68+
<argument name="menuUiId" value="magento-customer-customer"/>
69+
<argument name="submenuUiId" value="magento-customer-customer-manage"/>
70+
</actionGroup>
71+
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
72+
<argument name="customerId" value="$createCustomer.id$"/>
73+
</actionGroup>
74+
<comment userInput="Filter customer" stepKey="filterCreatedCustomer"/>
75+
<comment userInput="Click edit button" stepKey="clickEditButton"/>
76+
<!-- Click create order -->
77+
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
78+
<!-- Check bundle product in customer's activities in shopping cart section -->
79+
<see selector="{{AdminCustomerActivitiesShoppingCartSection.productName}}" userInput="$$createBundleProduct.name$$" stepKey="seeProductName"/>
80+
<see selector="{{AdminCustomerActivitiesShoppingCartSection.productQty}}" userInput="{{ApiSimpleSingleQty.quantity}}" stepKey="assertProductQty"/>
81+
</test>
82+
</tests>

app/code/Magento/Sales/view/adminhtml/templates/order/create/sidebar/items.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $sideBarPermissionCheck = $block->getData('sideBarPermissionCheck');
7979

8080
<?php if ($block->canDisplayItemQty()): ?>
8181
<td class="col-qty">
82-
<?= (float) $block->getItemQty($_item) ?>
82+
<?= (int) $block->getItemCount($_item) ?>
8383
</td>
8484
<?php endif; ?>
8585

0 commit comments

Comments
 (0)