Skip to content

Commit af4b740

Browse files
authored
#23972 fix disabled guest checkout issue
1 parent 4c50949 commit af4b740

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(
5656
*/
5757
public function execute(Observer $observer)
5858
{
59-
$store = $observer->getEvent()->getStore();
59+
$storeId = (int)$observer->getEvent()->getStore()->getId();
6060
$result = $observer->getEvent()->getResult();
6161

6262
/* @var $quote Quote */
@@ -69,9 +69,9 @@ public function execute(Observer $observer)
6969
if ($this->scopeConfig->isSetFlag(
7070
self::XML_PATH_DISABLE_GUEST_CHECKOUT,
7171
ScopeInterface::SCOPE_STORE,
72-
$store
72+
$storeId
7373
)
74-
|| !$this->checkForShareableLinks($item, $store)) {
74+
|| !$this->checkForShareableLinks($item, $storeId)) {
7575
$result->setIsAllowed(false);
7676
break;
7777
}
@@ -85,10 +85,10 @@ public function execute(Observer $observer)
8585
* Check for shareable link
8686
*
8787
* @param CartItemInterface $item
88-
* @param int $store
88+
* @param int $storeId
8989
* @return boolean
9090
*/
91-
private function checkForShareableLinks(CartItemInterface $item, int $store): bool
91+
private function checkForShareableLinks(CartItemInterface $item, int $storeId): bool
9292
{
9393
$isSharable = true;
9494
$option = $item->getOptionByCode('downloadable_link_ids');
@@ -101,7 +101,7 @@ private function checkForShareableLinks(CartItemInterface $item, int $store): bo
101101
$link->getIsShareable() == 2 && !$this->scopeConfig->isSetFlag(
102102
self::XML_PATH_DOWNLOADABLE_SHAREABLE,
103103
ScopeInterface::SCOPE_STORE,
104-
$store
104+
$storeId
105105
)
106106
)
107107
) {

0 commit comments

Comments
 (0)