Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed disabled guest checkout issue in case of downloadable product #23972

Merged
merged 32 commits into from
Aug 1, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
548ea7b
fixed disabled guest checkout issue in case of downloadable product #…
Aug 1, 2019
1cf1389
fixed disabled guest checkout issue in case of downloadable product #…
Aug 14, 2019
65cf71b
Merge branch '2.3-develop' of https://github.com/magento/magento2 int…
Aug 14, 2019
a1dd986
fixed disabled guest checkout issue in case of downloadable product #…
Aug 14, 2019
c3e1ce0
fixed disabled guest checkout issue in case of downloadable product #…
Aug 14, 2019
caf9ef7
made const as private
Sep 4, 2019
98dd6c0
Revert const visibility modifier
sidolov Sep 5, 2019
9f37b2f
item wise check added for shareable links
Sep 10, 2019
993a1e5
magento/magento2#23972: Refactoring, static and unit tests fix.
engcom-Foxtrot Oct 8, 2019
575d9e5
magento/magento2#23972: MFTF test fix.
engcom-Foxtrot Oct 18, 2019
c343492
Merge branch '2.4-develop' into 23971
ihor-sviziev Mar 5, 2020
4d045cd
Merge branch '2.4-develop' into 23971
ihor-sviziev Apr 6, 2020
05a3348
Merge branch '2.4-develop' into 23971
ihor-sviziev Apr 9, 2020
9e9bc69
Fixed disabled guest checkout issue in case of downloadable product
ihor-sviziev Apr 9, 2020
4380ff6
fixed disabled guest checkout issue in case of downloadable product
ihor-sviziev Apr 9, 2020
f4eb33e
fixed disabled guest checkout issue in case of downloadable product
ihor-sviziev Apr 9, 2020
11f21bf
fixed disabled guest checkout issue in case of downloadable product
ihor-sviziev Apr 16, 2020
59e7f33
Merge branch '2.4-develop' into 23971
ihor-sviziev Apr 16, 2020
49e2fa9
Merge branch '2.4-develop' into 23971
ihor-sviziev May 18, 2020
5389a71
Merge branch '2.4-develop' into 23971
ihor-sviziev Jun 3, 2020
938a68c
magento/magento2#23972 fixed disabled guest checkout issue
ihor-sviziev Jun 3, 2020
08e3875
magento/magento2#23972 fixed disabled guest checkout issue
ihor-sviziev Jun 3, 2020
4c50949
magento/magento2#23972 fixed disabled guest checkout issue
ihor-sviziev Jun 3, 2020
af4b740
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 3, 2020
592915d
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 3, 2020
4dac91c
Merge branch '2.4-develop' into 23971
ihor-sviziev Jun 4, 2020
4db0172
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 5, 2020
f1e11ea
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 5, 2020
88778bd
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 10, 2020
63ad4a3
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 10, 2020
88953ac
magento/magento2#23972 fix disabled guest checkout issue
ihor-sviziev Jun 10, 2020
11e34b3
Merge branch '2.4-develop' into 23971
engcom-Kilo Jul 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
use Magento\Framework\Event\ObserverInterface;
use Magento\Store\Model\ScopeInterface;

/**
* Check is allowed guest checkout for downloadable items.
*/
class IsAllowedGuestCheckoutObserver implements ObserverInterface
{
/**
* Xml path to disable checkout
*/
const XML_PATH_DISABLE_GUEST_CHECKOUT = 'catalog/downloadable/disable_guest_checkout';
private const XML_PATH_DISABLE_GUEST_CHECKOUT = 'catalog/downloadable/disable_guest_checkout';
ihor-sviziev marked this conversation as resolved.
Show resolved Hide resolved

/**
* Xml path to get downloadable Shareable setting
*/
private const XML_PATH_DOWNLOADABLE_SHAREABLE = 'catalog/downloadable/shareable';
ihor-sviziev marked this conversation as resolved.
Show resolved Hide resolved

/**
* Core store config
Expand Down Expand Up @@ -46,7 +54,12 @@ public function execute(\Magento\Framework\Event\Observer $observer)
self::XML_PATH_DISABLE_GUEST_CHECKOUT,
ScopeInterface::SCOPE_STORE,
$store
)) {
) && $this->_scopeConfig->isSetFlag(
self::XML_PATH_DOWNLOADABLE_SHAREABLE,
ScopeInterface::SCOPE_STORE,
$store
)
) {
return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
<data key="scope_id">0</data>
<data key="value">1</data>
</entity>
<entity name="EnableShareableDownloadableItems">
<data key="path">catalog/downloadable/shareable</data>
<data key="scope_id">0</data>
<data key="value">1</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</annotations>
<before>
<magentoCLI command="config:set {{EnableGuestCheckoutWithDownloadableItems.path}} {{EnableGuestCheckoutWithDownloadableItems.value}}" stepKey="enableGuestCheckoutWithDownloadableItems" />
<magentoCLI command="config:set {{EnableShareableDownloadableItems.path}} {{EnableShareableDownloadableItems.value}}" stepKey="enableShareableDownloadableItems" />
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="DownloadableProductWithOneLink" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function testIsAllowedGuestCheckoutConfigSetToFalse()
->method('getResult')
->will($this->returnValue($this->resultMock));

$this->scopeConfig->expects($this->once())
$this->scopeConfig->expects($this->at(0))
->method('isSetFlag')
->with(
IsAllowedGuestCheckoutObserver::XML_PATH_DISABLE_GUEST_CHECKOUT,
Expand All @@ -185,6 +185,15 @@ public function testIsAllowedGuestCheckoutConfigSetToFalse()
)
->willReturn(false);

$this->scopeConfig->expects($this->at(1))
->method('isSetFlag')
->with(
IsAllowedGuestCheckoutObserver::XML_PATH_DOWNLOADABLE_SHAREABLE,
ScopeInterface::SCOPE_STORE,
$this->storeMock
)
->willReturn(true);

$this->observerMock->expects($this->exactly(2))
->method('getEvent')
->will($this->returnValue($this->eventMock));
Expand Down