Skip to content

Commit a1dd986

Browse files
author
rani-webkul
committed
fixed disabled guest checkout issue in case of downloadable product #23971
1 parent 65cf71b commit a1dd986

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

app/code/Magento/Downloadable/Observer/IsAllowedGuestCheckoutObserver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
5555
self::XML_PATH_DOWNLOADABLE_SHAREABLE,
5656
ScopeInterface::SCOPE_STORE,
5757
$store
58-
)) {
58+
)
59+
) {
5960
return $this;
6061
}
6162

app/code/Magento/Downloadable/Test/Unit/Observer/IsAllowedGuestCheckoutObserverTest.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,6 @@ public function testIsAllowedGuestCheckoutConfigSetToTrue($productType, $isAllow
144144
$this->storeMock
145145
)
146146
->willReturn(true);
147-
148-
$this->scopeConfig->expects($this->once())
149-
->method('isSetFlag')
150-
->with(
151-
IsAllowedGuestCheckoutObserver::XML_PATH_DOWNLOADABLE_SHAREABLE,
152-
ScopeInterface::SCOPE_STORE,
153-
$this->storeMock
154-
)
155-
->willReturn(false);
156147

157148
$this->observerMock->expects($this->exactly(3))
158149
->method('getEvent')
@@ -185,7 +176,7 @@ public function testIsAllowedGuestCheckoutConfigSetToFalse()
185176
->method('getResult')
186177
->will($this->returnValue($this->resultMock));
187178

188-
$this->scopeConfig->expects($this->once())
179+
$this->scopeConfig->expects($this->at(0))
189180
->method('isSetFlag')
190181
->with(
191182
IsAllowedGuestCheckoutObserver::XML_PATH_DISABLE_GUEST_CHECKOUT,
@@ -194,7 +185,7 @@ public function testIsAllowedGuestCheckoutConfigSetToFalse()
194185
)
195186
->willReturn(false);
196187

197-
$this->scopeConfig->expects($this->once())
188+
$this->scopeConfig->expects($this->at(1))
198189
->method('isSetFlag')
199190
->with(
200191
IsAllowedGuestCheckoutObserver::XML_PATH_DOWNLOADABLE_SHAREABLE,

0 commit comments

Comments
 (0)