Skip to content

Commit 2e3f99c

Browse files
committed
ACP2E-3807: [Cloud] Recent Orders not appearing in other store view if the orders are created on one store view
1 parent c8ba4ab commit 2e3f99c

File tree

3 files changed

+84
-8
lines changed

3 files changed

+84
-8
lines changed

app/code/Magento/Sales/Block/Order/Recent.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Sales\Block\Order;
77

@@ -90,9 +90,6 @@ private function getRecentOrders()
9090
)->addAttributeToFilter(
9191
'customer_id',
9292
$customerId
93-
)->addAttributeToFilter(
94-
'store_id',
95-
$this->storeManager->getStore()->getId()
9693
)->addAttributeToFilter(
9794
'status',
9895
['in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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="StorefrontVerifyOrderDashboardTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Recent Orders appearing on Dashboard"/>
15+
<title value="Verify recent Orders appearing in other store view if the orders are created on another store view"/>
16+
<description value="Verify recent Orders appearing in other store view if the orders are created on another store view"/>
17+
<testCaseId value="ACP2E-3807"/>
18+
<useCaseId value="ACP2E-3807"/>
19+
<severity value="MINOR"/>
20+
<group value="Sales"/>
21+
</annotations>
22+
23+
<before>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
<!-- Create customer -->
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
<!-- Create store view -->
28+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView">
29+
<argument name="customStore" value="customStore"/>
30+
</actionGroup>
31+
<!-- Create product -->
32+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
33+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
34+
<argument name="indices" value=""/>
35+
</actionGroup>
36+
</before>
37+
<after>
38+
<!-- Customer log out -->
39+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
40+
<!-- Delete customer -->
41+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
42+
<!-- Delete product -->
43+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
44+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView">
45+
<argument name="customStore" value="customStore"/>
46+
</actionGroup>
47+
<!-- Admin log out -->
48+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
49+
</after>
50+
<!-- Login as customer -->
51+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
52+
<argument name="Customer" value="$$createCustomer$$"/>
53+
</actionGroup>
54+
<!-- 2. Switch store view -->
55+
<amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="goToStore2ProductPage"/>
56+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="SwitchStoreView">
57+
<argument name="storeView" value="customStore"/>
58+
</actionGroup>
59+
<waitForPageLoad time="10" stepKey="waitForProductPageLoad"/>
60+
<!-- Add product to cart -->
61+
<click selector="{{StorefrontProductPageSection.addToCart}}" stepKey="addToCart"/>
62+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
63+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
64+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToReview"/>
65+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
66+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
67+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
68+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
69+
</actionGroup>
70+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
71+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView">
72+
<argument name="storeView" value="_defaultStore"/>
73+
</actionGroup>
74+
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="navigateToCustomerDashboardPage"/>
75+
<waitForPageLoad stepKey="waitForPageLoad2"/>
76+
<scrollTo selector="{{StorefrontCustomerResentOrdersSection.blockResentOrders}}" stepKey="scrollToResent"/>
77+
<seeElement selector="{{StorefrontCustomerResentOrdersSection.viewOrder({$grabOrderNumber})}}" stepKey="seeOrderInGrid"/>
78+
</test>
79+
</tests>

app/code/Magento/Sales/Test/Unit/Block/Order/RecentTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -95,7 +95,7 @@ public function testConstructMethod(): void
9595
->getMockForAbstractClass();
9696
$storeMock = $this->getMockBuilder(StoreInterface::class)
9797
->getMockForAbstractClass();
98-
$this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock);
98+
$this->storeManagerMock->expects($this->exactly(0))->method('getStore')->willReturn($storeMock);
9999
$storeMock->expects($this->any())->method('getId')->willReturn($storeId);
100100

101101
$orderCollection = $this->createPartialMock(Collection::class, [

0 commit comments

Comments
 (0)