Skip to content

Commit be8cd4f

Browse files
author
Olexii Korshenko
committed
MAGETWO-39540: Wrong behaviour in case with no payment solutions
1 parent cb16b2b commit be8cd4f

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

app/code/Magento/Checkout/etc/frontend/sections.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@
3737
<action name="checkout/sidebar/updateItemQty">
3838
<section name="cart"/>
3939
</action>
40+
<action name="checkout/onepage/saveOrder">
41+
<section name="last-ordered-items"/>
42+
</action>
4043
</config>

app/code/Magento/Checkout/view/frontend/web/js/view/payment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ define(
2626
},
2727
isVisible: ko.observable(quote.isVirtual()),
2828
quoteIsVirtual: quote.isVirtual(),
29+
isPaymentMethodsAvailable: ko.computed(function () {
30+
return paymentService.getAvailablePaymentMethods().length > 0;
31+
}),
2932

3033
initialize: function () {
3134
this._super();

app/code/Magento/Checkout/view/frontend/web/template/payment.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@
2222
<!-- ko foreach: getRegion('beforeMethods') -->
2323
<!-- ko template: getTemplate() --><!-- /ko -->
2424
<!-- /ko -->
25-
<div id="checkout-payment-method-load" class="opc-payment">
25+
<div id="checkout-payment-method-load" class="opc-payment" data-bind="visible: isPaymentMethodsAvailable">
2626
<!-- ko foreach: getRegion('payment-methods-list') -->
2727
<!-- ko template: getTemplate() --><!-- /ko -->
2828
<!-- /ko -->
2929
</div>
30+
<div class="no-quotes-block" data-bind="visible: isPaymentMethodsAvailable() == false">
31+
<!-- ko text: $t('No Payment method available.')--><!-- /ko -->
32+
</div>
3033
<!-- ko foreach: getRegion('afterMethods') -->
3134
<!-- ko template: getTemplate() --><!-- /ko -->
3235
<!-- /ko -->

app/code/Magento/Sales/etc/frontend/sections.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../Magento/Customer/etc/sections.xsd">
10-
<action name="checkout/onepage/saveOrder">
11-
<section name="last-ordered-items"/>
12-
</action>
1310
<action name="sales/guest/reorder">
1411
<section name="cart"/>
1512
</action>

0 commit comments

Comments
 (0)