@@ -56,7 +56,7 @@ public function __construct(
56
56
*/
57
57
public function execute (Observer $ observer )
58
58
{
59
- $ store = $ observer ->getEvent ()->getStore ();
59
+ $ storeId = ( int ) $ observer ->getEvent ()->getStore ()-> getId ();
60
60
$ result = $ observer ->getEvent ()->getResult ();
61
61
62
62
/* @var $quote Quote */
@@ -69,9 +69,9 @@ public function execute(Observer $observer)
69
69
if ($ this ->scopeConfig ->isSetFlag (
70
70
self ::XML_PATH_DISABLE_GUEST_CHECKOUT ,
71
71
ScopeInterface::SCOPE_STORE ,
72
- $ store
72
+ $ storeId
73
73
)
74
- || !$ this ->checkForShareableLinks ($ item , $ store )) {
74
+ || !$ this ->checkForShareableLinks ($ item , $ storeId )) {
75
75
$ result ->setIsAllowed (false );
76
76
break ;
77
77
}
@@ -85,10 +85,10 @@ public function execute(Observer $observer)
85
85
* Check for shareable link
86
86
*
87
87
* @param CartItemInterface $item
88
- * @param int $store
88
+ * @param int $storeId
89
89
* @return boolean
90
90
*/
91
- private function checkForShareableLinks (CartItemInterface $ item , int $ store ): bool
91
+ private function checkForShareableLinks (CartItemInterface $ item , int $ storeId ): bool
92
92
{
93
93
$ isSharable = true ;
94
94
$ option = $ item ->getOptionByCode ('downloadable_link_ids ' );
@@ -101,7 +101,7 @@ private function checkForShareableLinks(CartItemInterface $item, int $store): bo
101
101
$ link ->getIsShareable () == 2 && !$ this ->scopeConfig ->isSetFlag (
102
102
self ::XML_PATH_DOWNLOADABLE_SHAREABLE ,
103
103
ScopeInterface::SCOPE_STORE ,
104
- $ store
104
+ $ storeId
105
105
)
106
106
)
107
107
) {
0 commit comments